aboutsummaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
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)