aboutsummaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authoruser <user@clank>2026-07-18 00:38:38 +0200
committeruser <user@clank>2026-07-18 00:38:38 +0200
commitba2d7ae1d7b319645b10aaa31a7f664f9f80c25c (patch)
treee01e6c7c710a661defe2515ff9657f08cddcb283 /Makefile
parenttools: gbtype prints hub errors to stderr and exits 1 (diff)
downloadgbos-ba2d7ae1d7b319645b10aaa31a7f664f9f80c25c.tar.gz
gbos-ba2d7ae1d7b319645b10aaa31a7f664f9f80c25c.tar.xz
gbos-ba2d7ae1d7b319645b10aaa31a7f664f9f80c25c.zip
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.
Diffstat (limited to '')
-rw-r--r--Makefile16
1 files changed, 9 insertions, 7 deletions
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)