Fixed some build system stuff

This commit is contained in:
Joppe Blondel
2026-10-07 14:42:54 +02:00
parent da02d8c855
commit 5637db47fd
3 changed files with 9 additions and 28 deletions
+3 -13
View File
@@ -9,10 +9,10 @@ SUBDIRS :=
SOURCES := $(addprefix ./, $(addsuffix .asm, $(FILES)))
TARGETS := $(addprefix $(BUILDDIR)/, $(addsuffix .bin, $(FILES)))
TOPTARGETS := all clean size
TOPTARGETS := all clean
$(TOPTARGETS): $(SUBDIRS)
all: $(BUILDDIR) $(TARGETS) size
all: $(BUILDDIR) $(TARGETS)
clean:
rm -rf $(BUILDDIR)
@@ -20,21 +20,11 @@ clean:
$(BUILDDIR):
mkdir -p $(BUILDDIR)
$(BUILDDIR)/%.bin: ./%.asm
$(BUILDDIR)/%.bin: ./%.asm $(BUILDDIR)/memory.inc
echo '>$<'
$(ASM) $(ASMFLAGS) $< $@
size:
@for file in $(TARGETS); do \
if [ -f "$$file" ]; then \
echo "$$file: $$(wc -c < "$$file") bytes"; \
else \
echo "$$file: Not built yet (run 'make')"; \
fi \
done
$(SUBDIRS):
$(MAKE) -C $@ $(or $(MAKECMDGOALS),all) --no-print-directory
.PHONY: $(TOPTARGETS) $(SUBDIRS)