Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do not create config.jou on Windows #727

Merged
merged 1 commit into from
Feb 4, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading