forked from stargieg/bacnet-stack
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
127 lines (97 loc) · 2.92 KB
/
Makefile
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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
# Main Makefile for BACnet-stack project with GCC
# tools - only if you need them.
# Most platforms have this already defined
# CC = gcc
# AR = ar
# MAKE = make
# SIZE = size
#
# Assumes rm and cp are available
# configuration
# If BACNET_DEFINES has not already been set, configure to your needs here
MY_BACNET_DEFINES = -DPRINT_ENABLED=1
MY_BACNET_DEFINES += -DBACAPP_ALL
MY_BACNET_DEFINES += -DBACFILE
MY_BACNET_DEFINES += -DINTRINSIC_REPORTING
MY_BACNET_DEFINES += -DBACNET_TIME_MASTER
MY_BACNET_DEFINES += -DBACNET_PROPERTY_LISTS=1
BACNET_DEFINES ?= $(MY_BACNET_DEFINES)
# un-comment the next line to build in uci integration
#BACNET_DEFINES += -DBAC_UCI
#UCI_LIB_DIR ?= /usr/local/lib
#UCI_INCLUDE_DIR ?= /usr/local/include
#BACDL_DEFINE=-DBACDL_ETHERNET=1
#BACDL_DEFINE=-DBACDL_ARCNET=1
#BACDL_DEFINE=-DBACDL_MSTP=1
BACDL_DEFINE?=-DBACDL_BIP=1
# Declare your level of BBMD support
BBMD_DEFINE ?=-DBBMD_ENABLED=1
#BBMD_DEFINE ?= -DBBMD_ENABLED=0
#BBMD_DEFINE ?= -DBBMD_CLIENT_ENABLED
# Passing parameters via command line
MAKE_DEFINE ?=
# Define WEAK_FUNC for [...somebody help here; I can't find any uses of it]
DEFINES = $(BACNET_DEFINES) $(BACDL_DEFINE) $(BBMD_DEFINE) -DWEAK_FUNC=
DEFINES += $(MAKE_DEFINE)
# BACnet Ports Directory
BACNET_PORT ?= linux
# Default compiler settings
OPTIMIZATION = -O0
DEBUGGING =
WARNINGS = -Wall -Wmissing-prototypes
ifeq (${BUILD},debug)
OPTIMIZATION = -O0
DEBUGGING = -g -DDEBUG_ENABLED=1
ifeq (${BACDL_DEFINE},-DBACDL_BIP=1)
DEFINES += -DBIP_DEBUG
endif
endif
CFLAGS = $(WARNINGS) $(DEBUGGING) $(OPTIMIZATION) $(STANDARDS) $(INCLUDES) $(DEFINES)
# Export the variables defined here to all subprocesses
# (see http://www.gnu.org/software/automake/manual/make/Special-Targets.html)
.EXPORT_ALL_VARIABLES:
all: library demos gateway router-ipv6 ${DEMO_LINUX}
.PHONY : all library demos router gateway router-ipv6 clean
library:
$(MAKE) -s -C lib all
demos:
$(MAKE) -C demo all
gateway:
$(MAKE) -B -s -C demo gateway
server:
$(MAKE) -B -C demo server
mstpcap:
$(MAKE) -B -C demo mstpcap
mstpcrc: library
$(MAKE) -B -C demo mstpcrc
iam:
$(MAKE) -B -C demo iam
uevent:
$(MAKE) -B -C demo uevent
writepropm:
$(MAKE) -s -B -C demo writepropm
abort:
$(MAKE) -B -C demo abort
error:
$(MAKE) -B -C demo error
router: library
$(MAKE) -s -C demo router
router-ipv6:
$(MAKE) -B -s -C demo router-ipv6
# Add "ports" to the build, if desired
ports: atmega168 bdk-atxx4-mstp at91sam7s
@echo "Built the ARM7 and AVR ports"
atmega168: ports/atmega168/Makefile
$(MAKE) -s -C ports/atmega168 clean all
at91sam7s: ports/at91sam7s/makefile
$(MAKE) -s -C ports/at91sam7s clean all
mstpsnap: ports/linux/mstpsnap.mak
$(MAKE) -s -C ports/linux -f mstpsnap.mak clean all
bdk-atxx4-mstp: ports/bdk-atxx4-mstp/Makefile
$(MAKE) -s -C ports/bdk-atxx4-mstp clean all
clean:
$(MAKE) -s -C lib clean
$(MAKE) -s -C demo clean
$(MAKE) -s -C demo/router clean
$(MAKE) -s -C demo/router-ipv6 clean
$(MAKE) -s -C demo/gateway clean