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 endif
empty-symbols.c: 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 upload_ocd_%: %.bin

View file

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

View file

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

View file

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

View file

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

View file

@ -120,4 +120,5 @@ mtype%.o: contiki-cooja-main.o
symbols.c: symbols.c:
# Create initial symbol files if not existing # 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