-
Notifications
You must be signed in to change notification settings - Fork 0
/
common.mk
67 lines (55 loc) · 1.72 KB
/
common.mk
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
57
58
59
60
61
62
63
64
65
66
#set BTOLDCFG to -DBTOLDCONFIG for RIC,MIT,Ualberta,BPW
#ex: #export BTOLDCFG=-DBTOLDCONFIG
CFLAGS += ${BTOLDCFG}
CC = gcc
# Compiler flags common to every system
CFLAGS += -g -I./include -I../../include -I/usr/include
LDFLAGS += -L/usr/lib -L/usr/local/lib -L../../lib
LDFLAGS += -lpthread -lncurses -lbtwam -lbtsystem -lm
LDFLAGS += -Wl,-Map=$(TARG).map,--cref
# Choose the correct CAN library
ifeq ($(CAN_HARDWARE),esd)
LDFLAGS += -lntcan
CFLAGS += -DESD_CAN
endif
ifeq ($(CAN_HARDWARE),peak)
LDFLAGS += -lpcan
CFLAGS += -DPEAK_CAN
endif
ifeq ($(CAN_HARDWARE),socket)
LDFLAGS += -lrtdm
CFLAGS += -DSOCKET_CAN
endif
ifeq ($(CAN_TYPE),isa)
CFLAGS += -DISA_CAN
endif
ifeq ($(CAN_TYPE),pci)
CFLAGS += -DPCI_CAN
endif
# Choose the correct operating system flags
ifeq ($(TARGET_OS),rtai)
CFLAGS += -DRTAI
CFLAGS += -I/usr/realtime/include
LDFLAGS += -L/usr/realtime/lib -llxrt
endif
ifeq ($(TARGET_OS),xenomai)
CFLAGS += -DXENOMAI
CFLAGS += -I/usr/xenomai/include
LDFLAGS += -L/usr/xenomai/lib -rdynamic -lnative
SKIN = native
### Xenomai directory, xeno-config and library directory ###########
XENO_DIR ?= /usr/xenomai
XENO_CONFIG ?= $(XENO_DIR)/bin/xeno-config
XENO_LIB_DIR ?= $(shell $(XENO_CONFIG) --library-dir) -Wl,-rpath $(shell $(XENO_CONFIG) --library-dir)
XENO_VERSION ?= $(shell $(XENO_CONFIG) --version)
ifeq ($(XENO_VERSION),2.6.1)
CFLAGS += -Dxeno_conform
endif
### User space application compile options #########################
USERAPP_LIBS ?= -lnative
USERAPP_LDFLAGS ?= $(shell $(XENO_CONFIG) --skin=$(SKIN) --ldflags) -L$(XENO_LIB_DIR)
USERAPP_CFLAGS ?= $(shell $(XENO_CONFIG) --skin=$(SKIN) --cflags)
CFLAGS += ${USERAPP_CFLAGS}
LDFLAGS += ${USERAPP_LDFLAGS} ${USERAPP_LIBS}
endif
export