2006-09-06 14:20:12 +02:00
|
|
|
# $Id: Makefile.cooja,v 1.3 2006/09/06 12:20:12 fros4943 Exp $
|
2006-08-21 14:11:16 +02:00
|
|
|
|
2006-09-06 14:20:12 +02:00
|
|
|
## The COOJA Simulator Contiki platform Makefile
|
|
|
|
##
|
|
|
|
## This makefile should normally never be called directly, but
|
|
|
|
## rather from inside the COOJA simulator.
|
|
|
|
## The purpose of this file is to compile a shared library that
|
|
|
|
## can be loaded into the Java part of COOJA.
|
2006-08-21 14:11:16 +02:00
|
|
|
|
2006-09-06 14:20:12 +02:00
|
|
|
### Check input COOJA parameters
|
2006-08-21 14:11:16 +02:00
|
|
|
|
|
|
|
ifndef CONTIKI
|
|
|
|
$(error CONTIKI not defined!)
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifndef TYPEID
|
|
|
|
$(error TYPEID not defined!)
|
|
|
|
endif
|
|
|
|
|
|
|
|
OUTPUT_DIR = obj_cooja
|
|
|
|
LIBFILE = $(OUTPUT_DIR)/$(TYPEID).library
|
|
|
|
DEPFILE = $(OUTPUT_DIR)/$(TYPEID).a
|
|
|
|
MAPFILE = $(OUTPUT_DIR)/$(TYPEID).map
|
|
|
|
MAINFILE = $(OUTPUT_DIR)/$(TYPEID).co
|
|
|
|
|
2006-09-06 14:20:12 +02:00
|
|
|
### Define COOJA core interfaces
|
2006-08-21 14:11:16 +02:00
|
|
|
COOJA = $(CONTIKI)/platform/$(TARGET)
|
|
|
|
CONTIKI_TARGET_DIRS = . dev lib sys
|
|
|
|
|
2006-09-06 14:20:12 +02:00
|
|
|
COOJALIB = simEnvChange.c irq.c
|
2006-08-21 14:11:16 +02:00
|
|
|
|
2006-09-06 14:20:12 +02:00
|
|
|
COOJAINTFS = beep.c button-sensor.c ip.c leds-arch.c moteid.c \
|
|
|
|
pir-sensor.c radio-arch.c rs232.c vib-sensor.c simEnvChange.c \
|
|
|
|
clock.c log.c
|
2006-08-21 14:11:16 +02:00
|
|
|
|
|
|
|
CORE_FILES = random.c sensors.c leds.c serial.c
|
|
|
|
|
2006-09-06 14:20:12 +02:00
|
|
|
#COOJA_SYS = $(patsubst $(COOJA)/sys/%.c,%.c,$(wildcard $(COOJA)/sys/*.c))
|
|
|
|
#COOJA_DEV = $(patsubst $(COOJA)/dev/%.c,%.c,$(wildcard $(COOJA)/dev/*.c))
|
|
|
|
#COOJA_LIB = $(patsubst $(COOJA)/lib/%.c,%.c,$(wildcard $(COOJA)/lib/*.c))
|
|
|
|
#COOJA_LIB = simEnvChange.c
|
|
|
|
|
2006-08-21 14:11:16 +02:00
|
|
|
CONTIKI_TARGET_SOURCEFILES = \
|
2006-09-06 14:20:12 +02:00
|
|
|
$(COOJALIB) $(COOJAINTFS) $(CORE_FILES) $(PROJECT_SOURCEFILES)
|
2006-08-21 14:11:16 +02:00
|
|
|
|
|
|
|
CONTIKI_SOURCEFILES += $(CONTIKI_TARGET_SOURCEFILES)
|
|
|
|
|
|
|
|
.SUFFIXES:
|
|
|
|
|
|
|
|
### Define the CPU directory
|
|
|
|
CONTIKI_CPU=$(CONTIKI)/cpu/x86
|
|
|
|
|
2006-09-06 14:20:12 +02:00
|
|
|
### Compiler arguments
|
2006-08-21 14:11:16 +02:00
|
|
|
CFLAGSNO = -I. -I$(CONTIKI_CPU) \
|
|
|
|
$(EXTRA_CC_ARGS) \
|
|
|
|
-I$(COOJA) \
|
|
|
|
-I$(CONTIKI)/core \
|
|
|
|
-DWITH_UIP -DWITH_ASCII \
|
|
|
|
-Wall -g -I. -I/usr/local/include
|
|
|
|
CFLAGS = $(CFLAGSNO)
|
|
|
|
|
|
|
|
### Setup directory search path for source files
|
|
|
|
CONTIKI_TARGET_DIRS_CONCAT = ${addprefix $(COOJA)/, \
|
|
|
|
$(CONTIKI_TARGET_DIRS)}
|
|
|
|
|
|
|
|
vpath %.c $(PROJECTDIRS) \
|
|
|
|
$(CONTIKIDIRS) $(APPDIRS) $(CONTIKI_TARGET_DIRS_CONCAT) \
|
|
|
|
$(CONTIKI_CPU)
|
|
|
|
|
2006-09-06 14:20:12 +02:00
|
|
|
### Define custom targets
|
2006-08-21 14:11:16 +02:00
|
|
|
$(LIBFILE): $(MAINFILE) $(PROJECT_OBJECTFILES) $(DEPFILE)
|
|
|
|
$(LD) -Map=$(MAPFILE) -shared $(LD_ARGS_1) -o $@ $^ $(LD_ARGS_2)
|
|
|
|
|
|
|
|
$(DEPFILE): ${addprefix $(OBJECTDIR)/, $(CONTIKI_SOURCEFILES:.c=.o)}
|
|
|
|
$(AR) rcf $@ $^
|