2006-06-18 00:41:10 +02:00
|
|
|
ifndef CONTIKI
|
|
|
|
$(error CONTIKI not defined! You must specify where CONTIKI resides!)
|
|
|
|
endif
|
|
|
|
|
|
|
|
#contiki: contiki-$(TARGET).a
|
|
|
|
|
|
|
|
CONTIKI_TARGET_DIRS = . dev apps net
|
|
|
|
|
|
|
|
SENSORS = sensors.c beep.c button-sensor.c pir-sensor.c vib-sensor.c \
|
2006-10-06 10:25:30 +02:00
|
|
|
radio-sensor.c irq.c eeprom.c \
|
2006-06-18 00:41:10 +02:00
|
|
|
dummy-sensors.c leds.c leds-arch.c esb-sensors.c
|
2007-03-14 01:32:30 +01:00
|
|
|
NETSIM = ether.c ethernode.c ethernode-uip.c lpm.c \
|
2007-03-28 22:14:59 +02:00
|
|
|
tapdev-service.c tapdev.c rs232.c flash.c \
|
2006-06-18 00:41:10 +02:00
|
|
|
node.c nodes.c sensor.c display.c random.c radio.c \
|
2007-03-13 14:07:47 +01:00
|
|
|
dlloader.c main.c netsim-init.c contiki-main.c symtab.c symbols.c tr1001.c tr1001-drv.c \
|
|
|
|
ethernode-rime.c
|
2006-06-18 00:41:10 +02:00
|
|
|
|
|
|
|
CONTIKI_TARGET_SOURCEFILES = $(NETSIM) $(SENSORS)
|
|
|
|
|
|
|
|
CONTIKI_SOURCEFILES += $(CONTIKI_TARGET_SOURCEFILES)
|
|
|
|
|
|
|
|
.SUFFIXES:
|
|
|
|
|
|
|
|
### Define the CPU directory
|
2007-03-28 22:14:59 +02:00
|
|
|
CONTIKI_CPU=$(CONTIKI)/cpu/native
|
|
|
|
include $(CONTIKI)/cpu/native/Makefile.native
|
2006-06-18 00:41:10 +02:00
|
|
|
|
|
|
|
### Compiler definitions
|
|
|
|
CC = gcc
|
2007-03-13 14:07:47 +01:00
|
|
|
LD = gcc
|
2006-06-18 00:41:10 +02:00
|
|
|
AS = as
|
|
|
|
OBJCOPY = objcopy
|
|
|
|
STRIP = strip
|
|
|
|
CFLAGSNO = -I. -I$(CONTIKI)/core -I$(CONTIKI_CPU) \
|
|
|
|
-I$(CONTIKI)/platform/$(TARGET) \
|
|
|
|
${addprefix -I,$(APPDIRS)} \
|
|
|
|
-DWITH_UIP -DWITH_ASCII \
|
|
|
|
-Wall -g -I. -I/usr/local/include \
|
2006-10-06 10:25:30 +02:00
|
|
|
`gtk-config --cflags` -DNETSIM=1
|
2006-06-18 00:41:10 +02:00
|
|
|
CFLAGS += $(CFLAGSNO)
|
2007-03-23 13:23:38 +01:00
|
|
|
LDFLAGS = -Wl,-Map=contiki-$(TARGET).map,-export-dynamic
|
|
|
|
TARGET_LIBFILES = `gtk-config --libs`
|
2006-06-18 00:41:10 +02:00
|
|
|
|
|
|
|
### Setup directory search path for source files
|
|
|
|
|
|
|
|
CONTIKI_TARGET_DIRS_CONCAT = ${addprefix $(CONTIKI)/platform/$(TARGET)/, \
|
|
|
|
$(CONTIKI_TARGET_DIRS)}
|
|
|
|
vpath %.c $(PROJECTDIRS) \
|
|
|
|
$(CONTIKIDIRS) $(APPDIRS) $(CONTIKI_TARGET_DIRS_CONCAT) \
|
|
|
|
$(CONTIKI_CPU)
|
|
|
|
|
|
|
|
### Compilation rules
|
|
|
|
|
|
|
|
%.so: $(OBJECTDIR)/%.o
|
|
|
|
$(LD) -shared -o $@ $^
|