summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthew Sotoudeh <matthew@masot.net>2024-09-02 17:21:14 -0700
committerMatthew Sotoudeh <matthew@masot.net>2024-09-02 17:21:14 -0700
commit6a86be8a6bc85a0cb4c36a3f64db79d775b811a8 (patch)
tree474be1e74ee7b8c383014aa4543623c406c88c62
parent6a1d9613fb6c036dc8d41bfdfeeb6e80ac4f17a8 (diff)
More options
-rwxr-xr-xscripts/foldercc6
1 files 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
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback