remade the use of symbols.[c,h].

symbols will now always be included in compilation
This commit is contained in:
fros4943 2007-01-09 09:13:36 +00:00
parent cada8d324f
commit 1fbce051c3

View File

@ -1,4 +1,4 @@
# $Id: Makefile.cooja,v 1.9 2006/11/06 18:07:51 fros4943 Exp $ # $Id: Makefile.cooja,v 1.10 2007/01/09 09:13:36 fros4943 Exp $
## The COOJA Simulator Contiki platform Makefile ## The COOJA Simulator Contiki platform Makefile
## ##
@ -33,7 +33,7 @@ COOJA_INTFS = beep.c button-sensor.c ip.c leds-arch.c moteid.c \
pir-sensor.c radio-arch.c rs232.c vib-sensor.c \ pir-sensor.c radio-arch.c rs232.c vib-sensor.c \
clock.c log.c radio-sensor.c cfs-cooja.c clock.c log.c radio-sensor.c cfs-cooja.c
CORE_FILES = random.c sensors.c leds.c serial.c cfs.c CORE_FILES = random.c sensors.c leds.c serial.c cfs.c symbols.c
CONTIKI_TARGET_SOURCEFILES = \ CONTIKI_TARGET_SOURCEFILES = \
$(COOJA_BASE) $(COOJA_INTFS) $(CORE_FILES) $(PROJECT_SOURCEFILES) $(COOJA_BASE) $(COOJA_INTFS) $(CORE_FILES) $(PROJECT_SOURCEFILES)
@ -65,15 +65,21 @@ vpath %.c $(PROJECTDIRS) \
### Define custom targets ### Define custom targets
$(LIBFILE): $(MAINFILE) $(PROJECT_OBJECTFILES) $(DEPFILE) $(LIBFILE): $(MAINFILE) $(PROJECT_OBJECTFILES) $(DEPFILE)
ifdef SYMBOLS ifdef SYMBOLS
# Recreate symbols file and relink with final memory layout (twice)
$(CC) $(CFLAGS) -c symbols.c -o $(OBJECTDIR)/symbols.o
$(LD) -Map=$(MAPFILE) -shared $(LD_ARGS_1) -o $@ $^ $(LD_ARGS_2)
${CONTIKI}/tools/make-symbols-nm $(LIBFILE) ${CONTIKI}/tools/make-symbols-nm $(LIBFILE)
$(CC) $(CFLAGS) -c symbols.c -o $(OBJECTDIR)/symbols.o $(CC) $(CFLAGS) -c symbols.c -o $(OBJECTDIR)/symbols.o
$(LD) -Map=$(MAPFILE) -shared $(LD_ARGS_1) -o $@ $^ $(OBJECTDIR)/symbols.o $(LD_ARGS_2) $(LD) -Map=$(MAPFILE) -shared $(LD_ARGS_1) -o $@ $^ $(LD_ARGS_2)
${CONTIKI}/tools/make-symbols-nm $(LIBFILE)
$(CC) $(CFLAGS) -c symbols.c -o $(OBJECTDIR)/symbols.o
$(LD) -Map=$(MAPFILE) -shared $(LD_ARGS_1) -o $@ $^ $(OBJECTDIR)/symbols.o $(LD_ARGS_2)
else else
$(LD) -Map=$(MAPFILE) -shared $(LD_ARGS_1) -o $@ $^ $(LD_ARGS_2) $(LD) -Map=$(MAPFILE) -shared $(LD_ARGS_1) -o $@ $^ $(LD_ARGS_2)
endif endif
$(DEPFILE): ${addprefix $(OBJECTDIR)/, $(CONTIKI_SOURCEFILES:.c=.o)} $(DEPFILE): ${addprefix $(OBJECTDIR)/, $(CONTIKI_SOURCEFILES:.c=.o)}
$(AR) rcf $@ $^ $(AR) rcf $@ $^
.PHONY: symbols.c
symbols.c:
# Create initial symbol files if not existing
${CONTIKI}/tools/make-empty-symbols