diff --git a/firmware/applications/Makefile b/firmware/applications/Makefile index 86a45db..dacc19e 100644 --- a/firmware/applications/Makefile +++ b/firmware/applications/Makefile @@ -33,6 +33,7 @@ endif WRAP=wrapper LIBNAME=app + ########################################################################## # GNU GCC compiler flags ########################################################################## @@ -66,21 +67,21 @@ $(LOBJ): OBJS += $(LOBJ) endif -ifeq "$(APP)" "tester" +ifeq "$(wildcard $(APP))" "$(APP)" ifndef TYPE TYPE=$(APP) endif TSRCS = $(wildcard $(TYPE)/*.c) TOBJS = $(foreach mod,$(TSRCS),$(subst .c,.o,$(mod))) -TWRAP=tester.gen +TWRAP=$(APP).gen .PHONY: $(TWRAP) $(APP).o: $(TWRAP) $(TWRAP): - ./mktester $(TSRCS) > $@ + ./mkfirmware $(APP) $(TSRCS) > $@ OBJS += $(TOBJS) endif @@ -93,7 +94,7 @@ $(LIBFILE): $(OBJS) $(WRAPOBJ) $(CC) $(CFLAGS) -o $@ $< clean: - rm -f $(OBJS) $(WRAPOBJ) $(WRAPSRC) $(LIBFILE) *.o */*.o + rm -f $(OBJS) $(WRAPOBJ) $(WRAPSRC) $(LIBFILE) *.o */*.o *.gen %.c: @echo diff --git a/firmware/applications/mktester b/firmware/applications/mkfirmware similarity index 95% rename from firmware/applications/mktester rename to firmware/applications/mkfirmware index 661351d..fdf7f2d 100755 --- a/firmware/applications/mktester +++ b/firmware/applications/mkfirmware @@ -1,5 +1,8 @@ #!/bin/sh +APP=$1 +shift + for f in $* ; do grep -h '^void ' $f|sed 's/^void //;s/(.*//'|while read a ; do echo "void $a(void);" @@ -58,7 +61,7 @@ done echo "NULL" echo "};" -echo "inline void generated_tick(void){" +echo "inline void tick_${APP}(void){" for f in $* ; do grep -h '^void tick_' $f|sed 's/^void //;s/(.*//'|while read a ; do echo "$a();" diff --git a/firmware/applications/tester.c b/firmware/applications/tester.c index 50a3542..667b335 100644 --- a/firmware/applications/tester.c +++ b/firmware/applications/tester.c @@ -16,9 +16,3 @@ void main_tester(void) { handleMenu(&mainmenu); gotoISP(); }; - -void tick_tester(void){ - generated_tick(); -}; - -