From cd7bd758eab69ac8bccb09d3fd265e12760390f0 Mon Sep 17 00:00:00 2001 From: John-Mark Gurney Date: Fri, 4 Feb 2022 02:22:10 -0800 Subject: [PATCH] move more into mu.progs.mk, reorder depends.. --- Makefile | 5 ----- mk/mu.progs.mk | 12 +++++++++--- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/Makefile b/Makefile index 773b4ff..5e892c9 100644 --- a/Makefile +++ b/Makefile @@ -34,8 +34,6 @@ SOEXT=dylib .error Unsupported platform: $(PLATFORM) .endif -PROGEXT = .elf - PROGS = lora.gw lora.irr SRCS.lora.gw = main.c @@ -82,9 +80,6 @@ rng_save.c: Makefile echo '};' \ ) > $@ || (rm $@ && false) -.arm_deps: - $(ARMCC) $(ARMTARGET) $(CFLAGS) $(.ALLSRC) -MM > $@ || (rm -f $@ && false) - .test_deps: $(LIBSYOTE_TEST_SRCS) $(CC) $(CFLAGS) $(.ALLSRC) -MM | sed -e 's/\.o:/\.no:/' > $@ || (rm -f $@ && false) diff --git a/mk/mu.progs.mk b/mk/mu.progs.mk index cfbb7f0..26e3d8d 100644 --- a/mk/mu.progs.mk +++ b/mk/mu.progs.mk @@ -1,6 +1,8 @@ .MAIN: all .PHONY: all +PROGEXT = .elf + .for i in $(PROGS) ALLTGTS+= $(i)$(PROGEXT) $(i).list ASRCS.$(i) = $(SRCS) $(SRCS.$(i)) @@ -10,12 +12,12 @@ DEPENDS += .arm_deps .arm_deps: $(ASRCS.$(i)) +.arm_deps: + $(ARMCC) $(ARMTARGET) $(CFLAGS) $(.ALLSRC) -MM > $@ || (rm -f $@ && false) + .PHONY: depend depend: $(DEPENDS) -.for i in $(DEPENDS) -.sinclude "$i" -.endfor $(i)$(PROGEXT) $(i).map: $(OBJS.$(i)) $(ARMCC) $(ARMTARGET) -o $(i)$(PROGEXT) $(.ALLSRC) -T$(LINKER_SCRIPT) --specs=nosys.specs -Wl,-Map="$(i).map" -Wl,--gc-sections -static --specs=nano.specs -Wl,--start-group -lc -lm -Wl,--end-group @@ -23,6 +25,10 @@ $(i).list: $(i)$(PROGEXT) $(ARMOBJDUMP) -h -S $(.ALLSRC) > $@ || (rm -f $@ && false) .endfor +.for i in $(DEPENDS) +.sinclude "$i" +.endfor + all: $(ALLTGTS) .PHONY: runbuild