mirror of
https://github.com/oliverschmidt/contiki.git
synced 2025-01-18 03:30:31 +00:00
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,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
|
||||
##
|
||||
@ -79,18 +79,26 @@ CFLAGSNO = $(EXTRA_CC_ARGS) -Wall -g -I/usr/local/include
|
||||
CFLAGS = $(CFLAGSNO)
|
||||
|
||||
### Define custom targets
|
||||
REDEF_PRINTF=1
|
||||
$(LIBFILE): $(MAINFILE) $(PROJECT_OBJECTFILES) $(ARFILE)
|
||||
ifdef SYMBOLS
|
||||
@echo Generating symbols
|
||||
# Recreate symbols file and relink with final memory layout (twice)
|
||||
${CONTIKI}/tools/make-symbols-nm $(LIBFILE)
|
||||
$(CC) $(CFLAGS) -c symbols.c -o $(OBJECTDIR)/symbols.o
|
||||
$(LINK_COMMAND_1) $^ $(LINK_COMMAND_2)
|
||||
${CONTIKI}/tools/make-symbols-nm $(LIBFILE)
|
||||
$(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)
|
||||
else
|
||||
$(LINK_COMMAND_1) $^ $(LINK_COMMAND_2)
|
||||
endif
|
||||
|
||||
$(ARFILE): ${addprefix $(OBJECTDIR)/, $(CONTIKI_SOURCEFILES:.c=.o)}
|
||||
$(AR_COMMAND_1) $^ $(AR_COMMAND_2)
|
||||
|
Loading…
x
Reference in New Issue
Block a user