From cf78ec45317988c2e91b06ec07a65b406bf52d5b Mon Sep 17 00:00:00 2001 From: John-Mark Gurney Date: Mon, 25 Apr 2022 11:39:01 -0700 Subject: [PATCH] add target to generate list of sysinits used This is to help make sure everything you think is starting is.. --- mk/mu.progs.mk | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/mk/mu.progs.mk b/mk/mu.progs.mk index 75dc553..65ec284 100644 --- a/mk/mu.progs.mk +++ b/mk/mu.progs.mk @@ -34,7 +34,7 @@ PROGEXT = .elf DEPENDS += .arm_deps .for i in $(PROGS) -ALLTGTS+= $(i)$(PROGEXT) $(i).list +ALLTGTS+= $(i)$(PROGEXT) $(i).list $(i).sysinit ASRCS.$(i) = $(SRCS) $(SRCS.$(i)) OBJS.$(i) = $(ASRCS.$(i):C/.c$/.o/) @@ -43,6 +43,9 @@ ARM_DEP_SRCS+= $(ASRCS.$(i)) $(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 +$(i).sysinit: $(ASRCS.$(i)) + grep ^SYSINIT $(.ALLSRC) | sort -k 2 -k 3 > $@ || (rm -f $@ && false) + $(i).list: $(i)$(PROGEXT) $(ARMOBJDUMP) -h -S $(.ALLSRC) > $@ || (rm -f $@ && false) .endfor