From ba2d7ae1d7b319645b10aaa31a7f664f9f80c25c Mon Sep 17 00:00:00 2001 From: user Date: Sat, 18 Jul 2026 00:38:38 +0200 Subject: refactor: c/ -> usr/, compiled program blobs out of the source tree Userland sources live in usr/ (fits the Unix theme better than 'c'). SDCC output .bin blobs land in build/usr/ with the other build artifacts instead of littering the source dir; programs.asm INCBINs them from there. Byte-identical ROM. --- Makefile | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index bc0eac7..9a7875b 100644 --- a/Makefile +++ b/Makefile @@ -17,17 +17,19 @@ all: $(ROM) $(BUILD)/%.o: src/%.asm | $(BUILD) rgbasm $(ASFLAGS) -o $@ $< -# C programs: compiled with SDCC into ROM-bank blobs and INCBIN'd by programs.asm -CBLOBS := c/chello.bin c/echo.bin c/true.bin c/false.bin c/uname.bin \ - c/pid.bin c/cat.bin c/wc.bin c/head.bin c/args.bin \ - c/ls.bin c/save.bin c/rm.bin c/sh.bin c/ps.bin c/kill.bin c/spin.bin c/blk.bin c/mkdir.bin c/count.bin c/ptest.bin c/necho.bin c/wget.bin c/chat.bin c/netd.bin c/ping.bin c/nslookup.bin c/dhcp.bin c/irc.bin +# Userland C programs (usr/): compiled with SDCC into ROM-bank blobs under +# $(BUILD)/usr and INCBIN'd by programs.asm +PROGS := chello echo true false uname pid cat wc head args \ + ls save rm sh ps kill spin blk mkdir count ptest necho \ + wget chat netd ping nslookup dhcp irc +CBLOBS := $(patsubst %,$(BUILD)/usr/%.bin,$(PROGS)) $(BUILD)/programs.o: $(CBLOBS) # C programs also depend on the shared libc sources -$(CBLOBS): c/libc.c c/gbos.h +$(CBLOBS): usr/libc.c usr/gbos.h -c/%.bin: c/%.c c/crt0.s c/libc.s c/build.sh - sh c/build.sh $< $@ +$(BUILD)/usr/%.bin: usr/%.c usr/crt0.s usr/libc.s usr/build.sh + sh usr/build.sh $< $@ $(ROM): $(OBJS) rgblink -m $(BUILD)/gbos.map -n $(BUILD)/gbos.sym -o $@ $(OBJS) -- cgit v1.3.1-sl0p