From 18dc47fa2bee0e5ae87463f5891b79e8b30f257f Mon Sep 17 00:00:00 2001 From: Stefan `Sec` Zehl Date: Tue, 19 Jul 2011 10:14:54 +0200 Subject: [PATCH] Fix dependecies and building for APP=loadable --- firmware/applications/Makefile | 23 ++++++++++++++++------- firmware/applications/mkwrapper | 7 +++++-- 2 files changed, 21 insertions(+), 9 deletions(-) diff --git a/firmware/applications/Makefile b/firmware/applications/Makefile index 50b0058..25a35c4 100644 --- a/firmware/applications/Makefile +++ b/firmware/applications/Makefile @@ -21,13 +21,6 @@ endif OBJS += $(ME_OBJ).o endif -ifeq "$(APP)" "loadable" -ifndef LAPP -LAPP=blinktest -endif -OBJS += ../loadable/$(LAPP).o -endif - WRAP=wrapper LIBNAME=app @@ -49,6 +42,22 @@ LIBFILE=lib$(LIBNAME).a all: $(LIBFILE) +ifeq "$(APP)" "loadable" +ifndef LAPP +LAPP=blinktest +endif +LSRC=../loadable/$(LAPP).c +LOBJ=loadable_$(LAPP).o + +.PHONY: $(LOBJ) + +$(LOBJ): + $(CC) $(CFLAGS) -o $@ $(LSRC) + $(RM) $(LIBFILE) + +OBJS += $(LOBJ) +endif + $(LIBFILE): $(OBJS) $(WRAPOBJ) $(AR) rcs $@ $(OBJS) $(WRAPOBJ) diff --git a/firmware/applications/mkwrapper b/firmware/applications/mkwrapper index 174a124..26830e1 100755 --- a/firmware/applications/mkwrapper +++ b/firmware/applications/mkwrapper @@ -2,7 +2,7 @@ for a in $* ; do case $a in - */*) continue;; + loadable_*) continue;; esac base=${a%.o} echo "void main_$base(void);" @@ -14,7 +14,7 @@ echo "void wrapper(void){" for a in $* ; do case $a in - */*) continue;; + loadable_*) continue;; esac base=${a%.o} echo "main_$base();" @@ -25,6 +25,9 @@ echo "}" echo "void tick_wrapper(void){" for a in $* ; do + case $a in + loadable_*) continue;; + esac base=${a%.o} grep -q \ tick_$base ${base}.c && echo "tick_$base();" done