renaming printf/putchar/puts symbols to avoid jni library loading overriding our custom implementations
experimental: directly references objcopy (tested on win32+linux)
This commit is contained in:
parent
d79b1d55f7
commit
115a2b0782
1 changed files with 12 additions and 4 deletions
|
@ -1,4 +1,4 @@
|
||||||
# $Id: Makefile.cooja,v 1.22 2007/11/29 04:57:04 fros4943 Exp $
|
# $Id: Makefile.cooja,v 1.23 2008/10/05 15:43:09 fros4943 Exp $
|
||||||
|
|
||||||
## The COOJA Simulator Contiki platform Makefile
|
## The COOJA Simulator Contiki platform Makefile
|
||||||
##
|
##
|
||||||
|
@ -79,18 +79,26 @@ CFLAGSNO = $(EXTRA_CC_ARGS) -Wall -g -I/usr/local/include
|
||||||
CFLAGS = $(CFLAGSNO)
|
CFLAGS = $(CFLAGSNO)
|
||||||
|
|
||||||
### Define custom targets
|
### Define custom targets
|
||||||
|
REDEF_PRINTF=1
|
||||||
$(LIBFILE): $(MAINFILE) $(PROJECT_OBJECTFILES) $(ARFILE)
|
$(LIBFILE): $(MAINFILE) $(PROJECT_OBJECTFILES) $(ARFILE)
|
||||||
ifdef SYMBOLS
|
ifdef SYMBOLS
|
||||||
|
@echo Generating symbols
|
||||||
# Recreate symbols file and relink with final memory layout (twice)
|
# Recreate symbols file and relink with final memory layout (twice)
|
||||||
${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
|
||||||
$(LINK_COMMAND_1) $^ $(LINK_COMMAND_2)
|
$(LINK_COMMAND_1) $^ $(LINK_COMMAND_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
|
||||||
|
endif ## SYMBOLS
|
||||||
|
|
||||||
|
ifdef REDEF_PRINTF
|
||||||
|
@echo Redefining printf
|
||||||
|
-$(foreach OBJ,$^, objcopy --redefine-sym printf=log_printf $(OBJ); )
|
||||||
|
-$(foreach OBJ,$^, objcopy --redefine-sym puts=log_puts $(OBJ); )
|
||||||
|
-$(foreach OBJ,$^, objcopy --redefine-sym putchar=log_putchar $(OBJ); )
|
||||||
|
endif ## REDEF_PRINTF
|
||||||
|
|
||||||
$(LINK_COMMAND_1) $^ $(LINK_COMMAND_2)
|
$(LINK_COMMAND_1) $^ $(LINK_COMMAND_2)
|
||||||
else
|
|
||||||
$(LINK_COMMAND_1) $^ $(LINK_COMMAND_2)
|
|
||||||
endif
|
|
||||||
|
|
||||||
$(ARFILE): ${addprefix $(OBJECTDIR)/, $(CONTIKI_SOURCEFILES:.c=.o)}
|
$(ARFILE): ${addprefix $(OBJECTDIR)/, $(CONTIKI_SOURCEFILES:.c=.o)}
|
||||||
$(AR_COMMAND_1) $^ $(AR_COMMAND_2)
|
$(AR_COMMAND_1) $^ $(AR_COMMAND_2)
|
||||||
|
|
Loading…
Add table
Reference in a new issue