Replaced make-empty-symbols with empty-symbols.[c|h]

The symbol generation shell scripts cause CRLF issues on Windows/Cygwin again and again. Instead of fixing this yet again I opted to remove the symbol generation script at least for the "no symbols" scenario with two C source files to be copied.
This commit is contained in:
Oliver Schmidt 2011-04-03 13:24:58 +02:00
parent 4a731dfda9
commit f83fb3704b
12 changed files with 29 additions and 20 deletions

View File

@ -168,7 +168,8 @@ else
endif
empty-symbols.c:
@${CONTIKI}/tools/make-empty-symbols
cp ${CONTIKI}/tools/empty-symbols.c symbols.c
cp ${CONTIKI}/tools/empty-symbols.h symbols.h
upload_ocd_%: %.bin

View File

@ -153,7 +153,8 @@ else
endif
empty-symbols.c:
@${CONTIKI}/tools/make-empty-symbols
cp ${CONTIKI}/tools/empty-symbols.c symbols.c
cp ${CONTIKI}/tools/empty-symbols.h symbols.h

View File

@ -146,7 +146,8 @@ endif
# Add a namelist to the kernel
%.out: %.co $(PROJECT_OBJECTFILES) contiki-$(TARGET).a
$(CONTIKI)/tools/make-empty-symbols
cp ${CONTIKI}/tools/empty-symbols.c symbols.c
cp ${CONTIKI}/tools/empty-symbols.h symbols.h
$(CC) $(LDFLAGS) $(CFLAGS) -o $@ $^ $(LIBC) symbols.c
ifdef SYMBOLS
$(CONTIKI)/tools/avr-make-symbols $@
@ -176,7 +177,8 @@ endif
# $(STRIP) --strip-unneeded -g -x $@
%.co: %.c
$(CONTIKI)/tools/make-empty-symbols
cp ${CONTIKI}/tools/empty-symbols.c symbols.c
cp ${CONTIKI}/tools/empty-symbols.h symbols.h
$(CC) $(CFLAGS) -DAUTOSTART_ENABLE -c $< -o $@
%-stripped.o: %.o
@ -193,4 +195,5 @@ endif
avrdude ${AVRDUDE_OPTIONS} -P ${AVRDUDE_PORT} -c ${AVRDUDE_PROGRAMMER} -p ${MCU} -U flash:w:$<
symbols.c:
@${CONTIKI}/tools/make-empty-symbols
cp ${CONTIKI}/tools/empty-symbols.c symbols.c
cp ${CONTIKI}/tools/empty-symbols.h symbols.h

View File

@ -108,7 +108,8 @@ CUSTOM_RULE_C_TO_CO=yes
$(OBJCOPY) -O binary $< $@
symbols.c:
@${CONTIKI}/tools/make-empty-symbols
cp ${CONTIKI}/tools/empty-symbols.c symbols.c
cp ${CONTIKI}/tools/empty-symbols.h symbols.h
%.$(TARGET): %_$(TARGET).bin
@

View File

@ -94,9 +94,9 @@ loader-init.o: ${CONTIKI_TARGET}/loader/loader-init.S
.PHONY: symbols.c symbols.h
ifdef CORE
symbols.c:
# @${CONTIKI}/tools/msp430-make-symbols $(CORE)
$(NM) $(CORE) | awk -f $(CONTIKI)/tools/mknmlist > symbols.c
else
symbols.c symbols.h:
@${CONTIKI}/tools/make-empty-symbols
cp ${CONTIKI}/tools/empty-symbols.c symbols.c
cp ${CONTIKI}/tools/empty-symbols.h symbols.h
endif

View File

@ -25,10 +25,10 @@ ifdef CORE
.PHONY: symbols.c symbols.h
symbols.c symbols.h:
$(NM) -C $(CORE) | grep -v @ | grep -v dll_crt0 | awk -f $(CONTIKI)/tools/mknmlist > symbols.c
# @${CONTIKI}/tools/make-symbols $(CORE)
else
symbols.c symbols.h:
@${CONTIKI}/tools/make-empty-symbols
cp ${CONTIKI}/tools/empty-symbols.c symbols.c
cp ${CONTIKI}/tools/empty-symbols.h symbols.h
endif
contiki-$(TARGET).a: ${addprefix $(OBJECTDIR)/,symbols.o}

View File

@ -236,7 +236,8 @@ symbols.c:
$(NM) $(CORE) | awk -f $(CONTIKI)/tools/mknmlist > symbols.c
else
symbols.c symbols.h:
@$(CONTIKI)/tools/make-empty-symbols
cp ${CONTIKI}/tools/empty-symbols.c symbols.c
cp ${CONTIKI}/tools/empty-symbols.h symbols.h
endif
%.$(TARGET): %.co $(PROJECT_OBJECTFILES) $(PROJECT_LIBRARIES) contiki-$(TARGET).a $(OBJECTDIR)/symbols.o

View File

@ -21,8 +21,8 @@ LDFLAGS = -Wl,-Map=contiki-$(TARGET).map,-export-dynamic
ifdef CORE
symbols.c symbols.h:
$(NM) $(CORE) | awk -f $(CONTIKI)/tools/mknmlist > symbols.c
# @${CONTIKI}/tools/make-symbols $(CORE)
else
symbols.c symbols.h:
@${CONTIKI}/tools/make-empty-symbols
cp ${CONTIKI}/tools/empty-symbols.c symbols.c
cp ${CONTIKI}/tools/empty-symbols.h symbols.h
endif

View File

@ -120,4 +120,5 @@ mtype%.o: contiki-cooja-main.o
symbols.c:
# Create initial symbol files if not existing
${CONTIKI}/tools/make-empty-symbols
cp ${CONTIKI}/tools/empty-symbols.c symbols.c
cp ${CONTIKI}/tools/empty-symbols.h symbols.h

4
tools/empty-symbols.c Normal file
View File

@ -0,0 +1,4 @@
#include "symbols.h"
const int symbols_nelts = 0;
const struct symbols symbols[] = {{0,0}};

3
tools/empty-symbols.h Normal file
View File

@ -0,0 +1,3 @@
#include "loader/symbols.h"
extern const struct symbols symbols[1];

View File

@ -1,6 +0,0 @@
#!/bin/sh
echo "#include \"symbols.h\"" > symbols.c
echo "const int symbols_nelts = 0;" >> symbols.c
echo "const struct symbols symbols[] = {{0,0}};" >> symbols.c
echo "#include \"loader/symbols.h\"" > symbols.h
echo "extern const struct symbols symbols[1];">> symbols.h