.MAIN: all .PHONY: all PROGEXT = .elf .for i in $(PROGS) ALLTGTS+= $(i)$(PROGEXT) $(i).list ASRCS.$(i) = $(SRCS) $(SRCS.$(i)) OBJS.$(i) = $(ASRCS.$(i):C/.c$/.o/) DEPENDS += .arm_deps .arm_deps: $(ASRCS.$(i)) .arm_deps: $(ARMCC) $(ARMTARGET) $(CFLAGS) $(.ALLSRC) -MM > $@ || (rm -f $@ && false) .PHONY: depend depend: $(DEPENDS) $(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).list: $(i)$(PROGEXT) $(ARMOBJDUMP) -h -S $(.ALLSRC) > $@ || (rm -f $@ && false) .endfor .for i in $(DEPENDS) .sinclude "$i" .endfor all: $(ALLTGTS) .PHONY: runbuild runbuild: $(SRCS) Makefile mk/*.mk for i in $(.MAKEFILE_LIST) $(.ALLSRC) $$(cat $(DEPENDS) | gsed ':x; /\\$$/ { N; s/\\\n//; tx }' | sed -e 's/^[^:]*://'); do if [ "$$i" != ".." ]; then echo $$i; fi; done | sort -u | entr -d sh -c 'echo starting...; cd $(.CURDIR) && $(MAKE) $(.MAKEFLAGS) depend && $(MAKE) $(.MAKEFLAGS) all' # native objects .SUFFIXES: .no .c.no: $(CC) $(CFLAGS) -c $< -o $@ .c.o: $(ARMCC) $(ARMTARGET) $(CFLAGS) -c $< -o $@