minidol/Makefile: add wrapper support
authorSebastian <basti@sraa.de>
Wed, 25 Sep 2013 12:03:49 +0000 (14:03 +0200)
committerSebastian <basti@sraa.de>
Wed, 25 Sep 2013 12:03:49 +0000 (14:03 +0200)
Every DOL process needs a wrapper file to contain the per-process
data structures. This file is named Process_Name_Wrapper.c and
is now built/linked automatically.

Furthermore, the Makefile does not delete intermediates anymore.

minidol/Makefile

index 698da9f67d90e0d325c2b9783a9fe26816bed0b5..8fe07a310a0ce0c9034b9a7f80e7587285bc6d28 100644 (file)
@@ -14,11 +14,12 @@ ELIB        := lib
 
 # Host application and host objects
 HOSTAPP        = $(DEST)/ep_application
-HOBJS  = $(HDEST)/buffers.o
+HOBJS  = $(HDEST)/main.o
 
 # Epiphany applications and common objects
-EPAPPS = $(DEST)/Data_Generator.srec $(DEST)/Weight_Generator.srec
-ECOMMON        = $(EDEST)/dol.o
+EPAPPS = $(DEST)/Beam_Former.srec
+EWRAPPERS = $(patsubst $(DEST)%,$(EDEST)%,$(EPAPPS:.srec=_Wrapper.o))
+ECOMMON        = $(EDEST)/dol.o $(EDEST)/buffers.o
 
 # Epiphany build flags
 CC     = e-gcc
@@ -33,12 +34,13 @@ HCFLAGS     = -I$(EPIPHANY_HOME)/tools/host/include -std=c99 -Wall
 HLFLAGS        = -L$(EPIPHANY_HOME)/tools/host/lib -le-hal
 
 # Global rules
+.SECONDARY:
 .PHONY: all run host cores clean
 all: run
 
 host: $(HOSTAPP)
 
-cores: $(EPAPPS)
+cores: $(ECOMMON) $(EWRAPPERS) $(EPAPPS)
 
 run: host cores
        @echo -e "\tRUN"
@@ -64,7 +66,7 @@ $(DEST)/%.srec: $(EDEST)/%.elf
        @echo -e "\t(EPIPHANY) OBJCOPY $@"
        @$(OBJCOPY) $(OCFLAGS) --output-target srec --srec-forceS3 $^ $@
 
-$(EDEST)/%.elf: $(ECOMMON) $(EDEST)/%.o
+$(EDEST)/%.elf: $(EDEST)/%.o $(EDEST)/%_Wrapper.o $(ECOMMON)
        @echo -e "\t(EPIPHANY) LINK\t$@"
        @$(CC) -o $@ $^ $(LFLAGS)