-
Notifications
You must be signed in to change notification settings - Fork 10
/
Makefile.omnetpp
56 lines (44 loc) · 1.57 KB
/
Makefile.omnetpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
ifndef CONTIKI
$(error CONTIKI not defined! You must specify where CONTIKI resides!)
endif
ifdef UIP_CONF_IPV6
CFLAGS += -DWITH_UIP6=1
endif
CONTIKI_TARGET_DIRS = . dev
CONTIKI_TARGET_MAIN = ${addprefix $(OBJECTDIR)/,contiki-main.o}
CONTIKI_TARGET_SOURCEFILES = contiki-main.c clock.c leds.c leds-arch.c checkpoint-arch.c cfs-posix.c
CONTIKI_SOURCEFILES += $(CONTIKI_TARGET_SOURCEFILES)
.SUFFIXES:
### Define the CPU directory
### --> normally a separate directory, we simply copy necessary Makefile commands and files from cpu/native
### and implement our own net driver (located under platform/omnetpp/net)
CONTIKI_CPU=$(CONTIKI)/platform/omnetpp
CONTIKI_CPU_DIRS = . net
CONTIKI_SOURCEFILES += mtarch.c rtimer-arch.c elfloader-stub.c symtab.c announcement.c watchdog.c contract.c
### Compiler definitions
CC = gcc
LD = gcc
AS = as
NM = nm
OBJCOPY = objcopy
STRIP = strip
ifdef WERROR
CFLAGSWERROR=-Werror -pedantic -std=c99 -Werror
endif
### Enable -fPIC to support 64Bit OMNeT++ / INET versions
CFLAGSNO = -Wall -g -I/usr/local/include $(CFLAGSWERROR) -fPIC
CFLAGS += $(CFLAGSNO) -O
LDFLAGS = -Wl,-Map=contiki-$(TARGET).map,-export-dynamic
### Compilation rules
%.so: $(OBJECTDIR)/%.o
$(LD) -shared -o $@ $^
ifdef CORE
.PHONY: symbols.c symbols.h
symbols.c symbols.h:
$(NM) -C $(CORE) | grep -v @ | grep -v dll_crt0 | awk -f $(CONTIKI)/tools/mknmlist > symbols.c
else
symbols.c symbols.h:
cp ${CONTIKI}/tools/empty-symbols.c symbols.c
cp ${CONTIKI}/tools/empty-symbols.h symbols.h
endif
contiki-$(TARGET).a: ${addprefix $(OBJECTDIR)/,symbols.o}