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