2010-11-10 13:11:43 +00:00
|
|
|
# $Id: Makefile.cooja,v 1.42 2010/11/10 13:11:43 fros4943 Exp $
|
2006-08-21 12:11:16 +00:00
|
|
|
|
2006-09-06 12:20:12 +00: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 12:11:16 +00:00
|
|
|
|
2009-03-10 21:23:38 +00:00
|
|
|
ifndef CONTIKI
|
|
|
|
$(error CONTIKI not defined!)
|
|
|
|
endif
|
|
|
|
|
|
|
|
### Assuming simulator quickstart if no JNI library name set from Cooja
|
|
|
|
ifndef LIBNAME
|
2007-04-02 10:28:52 +00:00
|
|
|
QUICKSTART=1
|
|
|
|
endif
|
|
|
|
|
2007-03-25 18:22:41 +00:00
|
|
|
### Quickstart simulator
|
2007-04-02 10:28:52 +00:00
|
|
|
ifdef QUICKSTART
|
|
|
|
|
|
|
|
# Create COOJA JAR rule
|
2007-04-02 09:07:30 +00:00
|
|
|
$(CONTIKI)/tools/cooja/dist/cooja.jar:
|
2007-04-02 10:28:52 +00:00
|
|
|
@echo "Creating COOJA Java archive..."
|
2007-04-02 09:07:30 +00:00
|
|
|
(cd $(CONTIKI)/tools/cooja && ant jar)
|
2007-04-02 10:28:52 +00:00
|
|
|
|
|
|
|
# Quickstart rule
|
2011-10-24 15:04:45 +00:00
|
|
|
ifneq ($(MAKECMDGOALS),clean)
|
2009-03-12 17:48:23 +00:00
|
|
|
.PHONY: $(MAKECMDGOALS)
|
2009-03-12 15:12:50 +00:00
|
|
|
.PRECIOUS: $(MAKECMDGOALS)
|
2007-04-02 10:28:52 +00:00
|
|
|
$(MAKECMDGOALS): $(CONTIKI)/tools/cooja/dist/cooja.jar
|
2009-10-28 13:39:15 +00:00
|
|
|
java -mx512m -jar $< -quickstart='$(firstword $(MAKECMDGOALS))' -contiki='$(CONTIKI)'
|
2011-10-24 15:04:45 +00:00
|
|
|
endif
|
2007-04-02 10:28:52 +00:00
|
|
|
|
|
|
|
endif ## QUICKSTART
|
2006-08-21 12:11:16 +00:00
|
|
|
|
2010-06-11 15:17:26 +00:00
|
|
|
#MAIN_SRC = $(OBJECTDIR)/$(LIBNAME).c
|
|
|
|
MAIN_OBJ = $(OBJECTDIR)/$(LIBNAME).o
|
|
|
|
ARCHIVE = $(OBJECTDIR)/$(LIBNAME).a
|
2015-03-24 13:42:49 +00:00
|
|
|
JNILIB = $(OBJECTDIR)/$(LIBNAME).$(TARGET)
|
2009-03-11 08:40:37 +00:00
|
|
|
CONTIKI_APP_OBJ = $(CONTIKI_APP).co
|
2006-08-21 12:11:16 +00:00
|
|
|
|
2009-03-10 21:23:38 +00:00
|
|
|
### COOJA platform sources
|
2017-05-15 14:58:13 +00:00
|
|
|
COOJA = $(CONTIKI)/drivers/platform/$(TARGET)
|
2007-05-18 13:51:04 +00:00
|
|
|
CONTIKI_TARGET_DIRS = . dev lib sys cfs net
|
2006-08-21 12:11:16 +00:00
|
|
|
|
2010-11-10 13:11:43 +00:00
|
|
|
# (COOJA_SOURCEDIRS contains additional sources dirs set from simulator)
|
|
|
|
vpath %.c $(COOJA_SOURCEDIRS)
|
|
|
|
|
2017-05-13 11:09:58 +00:00
|
|
|
COOJA_BASE = simEnvChange.c cooja_mt.c cooja_mtarch.c rtimer-arch.c slip.c watchdog.c
|
2006-08-21 12:11:16 +00:00
|
|
|
|
2006-09-29 14:32:15 +00:00
|
|
|
COOJA_INTFS = beep.c button-sensor.c ip.c leds-arch.c moteid.c \
|
2007-05-18 13:51:04 +00:00
|
|
|
pir-sensor.c rs232.c vib-sensor.c \
|
2014-05-08 20:29:10 +00:00
|
|
|
clock.c log.c cfs-cooja.c cooja-radio.c \
|
2014-11-03 22:58:00 +00:00
|
|
|
eeprom.c slip-arch.c
|
2006-08-21 12:11:16 +00:00
|
|
|
|
2017-05-13 11:09:58 +00:00
|
|
|
COOJA_CORE = random.c sensors.c leds.c
|
2006-09-06 12:20:12 +00:00
|
|
|
|
2010-03-10 12:15:52 +00:00
|
|
|
COOJA_NET = uip-driver.c
|
|
|
|
|
2009-03-10 21:23:38 +00:00
|
|
|
# (COOJA_SOURCEFILES contains additional sources set from simulator)
|
2006-08-21 12:11:16 +00:00
|
|
|
CONTIKI_TARGET_SOURCEFILES = \
|
2010-03-10 12:15:52 +00:00
|
|
|
$(COOJA_BASE) $(COOJA_INTFS) $(COOJA_CORE) $(COOJA_NET) $(COOJA_SOURCEFILES)
|
2013-12-09 13:56:45 +00:00
|
|
|
|
2006-08-21 12:11:16 +00:00
|
|
|
CONTIKI_SOURCEFILES += $(CONTIKI_TARGET_SOURCEFILES)
|
|
|
|
|
|
|
|
.SUFFIXES:
|
|
|
|
|
|
|
|
### Define the CPU directory
|
2017-05-15 14:58:13 +00:00
|
|
|
CONTIKI_CPU=$(CONTIKI)/drivers/cpu/x86
|
2006-08-21 12:11:16 +00:00
|
|
|
|
2006-09-06 12:20:12 +00:00
|
|
|
### Compiler arguments
|
2010-06-11 15:17:26 +00:00
|
|
|
#CC = gcc
|
2010-03-15 11:03:17 +00:00
|
|
|
CFLAGSNO = $(EXTRA_CC_ARGS) -Wall -g -I/usr/local/include -DCLASSNAME=$(CLASSNAME)
|
2012-12-09 20:24:03 +00:00
|
|
|
CFLAGS += $(CFLAGSNO)
|
2006-08-21 12:11:16 +00:00
|
|
|
|
2017-05-16 16:20:34 +00:00
|
|
|
MODULES += core/net core/net/mac core/net/mac/framer core/net/ip64-addr
|
2014-11-12 09:18:29 +00:00
|
|
|
|
|
|
|
## Copied from Makefile.include, since Cooja overrides CFLAGS et al
|
|
|
|
HAS_STACK = 0
|
|
|
|
ifeq ($(CONTIKI_WITH_IPV4),1)
|
|
|
|
HAS_STACK = 1
|
2014-12-01 20:02:57 +00:00
|
|
|
CFLAGS += -DNETSTACK_CONF_WITH_IPV4=1
|
2010-03-10 12:15:52 +00:00
|
|
|
endif
|
2014-11-12 09:18:29 +00:00
|
|
|
|
|
|
|
ifeq ($(CONTIKI_WITH_RIME),1)
|
|
|
|
HAS_STACK = 1
|
2017-05-13 11:09:58 +00:00
|
|
|
CFLAGS += -DNETSTACK_CONF_WITH_RIME=1
|
2010-03-10 12:15:52 +00:00
|
|
|
endif
|
|
|
|
|
2014-11-12 09:18:29 +00:00
|
|
|
# Make IPv6 the default stack
|
|
|
|
ifeq ($(HAS_STACK),0)
|
|
|
|
CONTIKI_WITH_IPV6 = 1
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifeq ($(CONTIKI_WITH_IPV6),1)
|
2014-12-01 20:02:57 +00:00
|
|
|
CFLAGS += -DNETSTACK_CONF_WITH_IPV6=1
|
2014-11-12 09:18:29 +00:00
|
|
|
ifneq ($(CONTIKI_WITH_RPL),0)
|
2012-01-31 13:53:52 +00:00
|
|
|
CFLAGS += -DUIP_CONF_IPV6_RPL=1
|
2014-12-02 10:29:49 +00:00
|
|
|
endif
|
2014-11-12 09:18:29 +00:00
|
|
|
endif
|