improve application Makfile

This commit is contained in:
Stefan `Sec` Zehl 2011-08-01 01:08:05 +02:00
parent 1ccda41467
commit 621bca40b3
3 changed files with 9 additions and 11 deletions

View File

@ -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

View File

@ -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();"

View File

@ -16,9 +16,3 @@ void main_tester(void) {
handleMenu(&mainmenu);
gotoISP();
};
void tick_tester(void){
generated_tick();
};