Skip to content

Commit

Permalink
Do not create config.jou on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
Akuli committed Feb 4, 2025
1 parent 987226a commit 4ba8b61
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 10 deletions.
10 changes: 2 additions & 8 deletions Makefile.windows
Original file line number Diff line number Diff line change
@@ -1,20 +1,14 @@
all: jou.exe

config.jou:
echo "# auto-generated by Makefile" > config.jou
echo "@public" >> config.jou
echo "def get_jou_clang_path() -> byte*:" >> config.jou
echo " return NULL" >> config.jou

jou_bootstrap.exe: bootstrap.sh
./bootstrap.sh

jou.exe: jou_bootstrap.exe config.jou $(wildcard compiler/*.jou compiler/*/*.jou)
jou.exe: jou_bootstrap.exe $(wildcard compiler/*.jou compiler/*/*.jou)
rm -rf compiler/jou_compiled && ./jou_bootstrap.exe -o jou.exe --linker-flags "$(wildcard libs/lib*.a)" compiler/main.jou

# Does not delete tmp/bootstrap_cache because bootstrapping is slow.
.PHONY: clean
clean:
bash -O extglob -c "rm -rvf tmp/!(bootstrap_cache)"
rm -vf *.exe config.jou
rm -vf *.exe
find . -name jou_compiled -print -exec rm -rf '{}' +
6 changes: 4 additions & 2 deletions compiler/run.jou
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,12 @@ import "stdlib/mem.jou"
import "stdlib/io.jou"
import "stdlib/process.jou"

import "../config.jou"
import "./command_line_args.jou"
import "./paths.jou"

if not WINDOWS:
import "../config.jou"


@public
def run_linker(objpaths: byte**, exepath: byte*) -> None:
Expand Down Expand Up @@ -38,7 +40,7 @@ def run_linker(objpaths: byte**, exepath: byte*) -> None:
strcat(quoted_object_files, "\"")

size = strlen(instdir) + strlen(quoted_object_files) + strlen(exepath) + strlen(linker_flags) + 100
if get_jou_clang_path() != NULL:
if not WINDOWS:
size += strlen(get_jou_clang_path())
command: byte* = malloc(size)

Expand Down

0 comments on commit 4ba8b61

Please sign in to comment.