From 6a86be8a6bc85a0cb4c36a3f64db79d775b811a8 Mon Sep 17 00:00:00 2001 From: Matthew Sotoudeh Date: Mon, 2 Sep 2024 17:21:14 -0700 Subject: More options --- scripts/foldercc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/foldercc b/scripts/foldercc index 3bdc022..8ece427 100755 --- a/scripts/foldercc +++ b/scripts/foldercc @@ -107,10 +107,10 @@ def main(argv): subprocess.run(["rm", "-rf", out_path]) os.mkdir(out_path) makefile = open(f"{out_path}/Makefile", "w") - makefile.write("a.out: " + ' '.join([f"{i}.o" for i in range(len(all_os))]) + "\n") + makefile.write("a.out: " + ' '.join([f"{i}.o" for i in range(len(all_os))]) + " $(OTHER_OBJS)\n") argstr = list(map(shlex.quote, stripped_args)) argstr = ' '.join(argstr) - makefile.write(f"\t$(CC) $^ -o $@ {argstr}\n\n") + makefile.write(f"\t$(CC) $(CFLAGS) $^ -o $@ {argstr}\n\n") for i, o_file in enumerate(all_os): f = open(o_file, "rb") if f.read(5) == b"DIETC": @@ -119,7 +119,7 @@ def main(argv): with open(f"{out_path}/{i}.c", "wb") as i_file: i_file.write(f.read()) makefile.write(f"{i}.o: {i}.c\n") - makefile.write(f"\t$(CC) -c $^ -o $@ {argstr} -Wno-builtin-declaration-mismatch\n\n") + makefile.write(f"\t$(CC) $(CFLAGS) -c $^ -o $@ {argstr} -Wno-builtin-declaration-mismatch\n\n") # TODO: include a postprocessing pass ... else: # regular .o -- cgit v1.2.3