using OBJECTDIR instead of "obj_cooja" + bugfix: allow for externally defined CC

This commit is contained in:
fros4943 2010-06-11 15:17:26 +00:00
parent 53e150f240
commit 8f1988e7fc

View file

@ -1,4 +1,4 @@
# $Id: Makefile.cooja,v 1.40 2010/03/23 12:07:29 adamdunkels Exp $
# $Id: Makefile.cooja,v 1.41 2010/06/11 15:17:26 fros4943 Exp $
## The COOJA Simulator Contiki platform Makefile
##
@ -40,10 +40,10 @@ $(MAKECMDGOALS): $(CONTIKI)/tools/cooja/dist/cooja.jar
endif ## QUICKSTART
#MAIN_SRC = obj_cooja/$(LIBNAME).c
MAIN_OBJ = obj_cooja/$(LIBNAME).o
ARCHIVE = obj_cooja/$(LIBNAME).a
JNILIB = obj_cooja/$(LIBNAME).cooja
#MAIN_SRC = $(OBJECTDIR)/$(LIBNAME).c
MAIN_OBJ = $(OBJECTDIR)/$(LIBNAME).o
ARCHIVE = $(OBJECTDIR)/$(LIBNAME).a
JNILIB = $(OBJECTDIR)/$(LIBNAME).cooja
CONTIKI_APP_OBJ = $(CONTIKI_APP).co
### COOJA platform sources
@ -72,7 +72,7 @@ CONTIKI_SOURCEFILES += $(CONTIKI_TARGET_SOURCEFILES)
CONTIKI_CPU=$(CONTIKI)/cpu/x86
### Compiler arguments
CC = gcc
#CC = gcc
CFLAGSNO = $(EXTRA_CC_ARGS) -Wall -g -I/usr/local/include -DCLASSNAME=$(CLASSNAME)
CFLAGS = $(CFLAGSNO)
@ -86,7 +86,7 @@ endif
REDEF_PRINTF=1 # Redefine functions to enable printf()s inside Cooja
### Define custom targets
$(ARCHIVE): ${addprefix obj_cooja/, $(CONTIKI_SOURCEFILES:.c=.o)}
$(ARCHIVE): ${addprefix $(OBJECTDIR)/, $(CONTIKI_SOURCEFILES:.c=.o)}
$(AR_COMMAND_1) $^ $(AR_COMMAND_2)
$(JNILIB): $(CONTIKI_APP_OBJ) $(MAIN_OBJ) $(PROJECT_OBJECTFILES) $(ARCHIVE)
@ -94,10 +94,10 @@ ifdef SYMBOLS
@echo Generating symbols
# Recreate symbols file and relink with final memory layout (twice)
${CONTIKI}/tools/make-symbols-nm $(JNILIB)
$(CC) $(CFLAGS) -c symbols.c -o obj_cooja/symbols.o
$(CC) $(CFLAGS) -c symbols.c -o $(OBJECTDIR)/symbols.o
$(LINK_COMMAND_1) $^ $(LINK_COMMAND_2)
${CONTIKI}/tools/make-symbols-nm $(JNILIB)
$(CC) $(CFLAGS) -c symbols.c -o obj_cooja/symbols.o
$(CC) $(CFLAGS) -c symbols.c -o $(OBJECTDIR)/symbols.o
endif ## SYMBOLS
ifdef REDEF_PRINTF
@echo Redefining printf