-
Notifications
You must be signed in to change notification settings - Fork 44
/
Makefile.inc.in
191 lines (154 loc) · 5.14 KB
/
Makefile.inc.in
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
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
# === Port specific defines ===
ARCH = @ARCH@
PORT_LDFLAGS ?= @PORT_LDFLAGS@
PORT_CFLAGS ?= @PORT_CFLAGS@
PORT_SUBDIR = @PORT_SUBDIR@
# === used tools ===
CXX ?= g++
CXXLD ?= $(CXX)
CC ?= gcc
FLEX = flex
BISONPP = $(PREFIX)/bison++/bison++ -S $(PREFIX)/bison++/bison.cc -H $(PREFIX)/bison++/bison.h
# === compiler options ===
# C only flags
CFLAGS += -std=c99 $(CPPFLAGS)
# common flags
CPPFLAGS = -D$(ARCH) $(PORT_CFLAGS) $(XMLCFLAGS) -I $(INCDIR) $(DEBUGINFO) -Wall -funsigned-char @CPPFLAGS@
# C++ specific flags
CXXFLAGS = -ftemplate-depth-40 $(COPTS) $(CPPFLAGS)
# === linker options ===
LDFLAGS += $(XMLLIBS) $(EFENCE) $(PORT_LDFLAGS)
CLNT_LDFLAGS = $(LDFLAGS)
SRV_LDFLAGS = $(LDFLAGS)
REL_LDFLAGS = $(LDFLAGS)
LINKPRINT += @LINKPRINT@
# === debuging parameters ===
# DEBUGINFO is no longer used. Please call ./configure --enable-debug
PEDANTIC = -pedantic
# EFENCE is no longer used. Please call ./configure --enable-efence
# === modular features ===
# See Developer Guide, section named "Modular features" for
# detailed description of those parameters
MOD_CLNT_BIND_REUSE = y
#MOD_CLNT_EMBEDDED_CFG = y
#MOD_CLNT_DISABLE_DNSUPDATE = y
#MOD_SRV_DISABLE_DNSUPDATE = y
#MOD_DISABLE_AUTH = y
MOD_CLNT_CONFIRM = y
#MOD_REMOTE_AUTOCONF = y
#MOD_LIBXML2 = y
#MOD_DEBUG = y
# === libxml2 stuff ===
#XMLCFLAGS = `pkg-config libxml-2.0 --cflags` -DLIBXML2
#XMLLIBS = `pkg-config libxml-2.0 --libs`
# === do not modify anything below ===
SILENTMAKE = -s
MAKEFLAGS += $(SILENTMAKE)
VERSION = `$(TOPDIR)/test/xtract_version`
INST_WORKDIR = $(DESTDIR)'/var/lib/dibbler'
INST_MANDIR = $(DESTDIR)'/usr/local/man'
INST_DOCDIR = $(DESTDIR)'/usr/local/share/doc'
INST_BINDIR = $(DESTDIR)'/usr/local/sbin'
INST_CONFDIR = $(DESTDIR)'/etc/dibbler'
INSTALL = 'install'
MKDIR = mkdir -p
CP = cp
PREFIX = $(TOPDIR)
PORTDIR = $(PREFIX)/$(PORT_SUBDIR)
INCDIR = $(PREFIX)/include
ADDRMGR = $(PREFIX)/AddrMgr
CFGMGR = $(PREFIX)/CfgMgr
IFACEMGR = $(PREFIX)/IfaceMgr
MESSAGES = $(PREFIX)/Messages
OPTIONS = $(PREFIX)/Options
MISC = $(PREFIX)/Misc
CLNTIFACEMGR= $(PREFIX)/ClntIfaceMgr
CLNTTRANSMGR= $(PREFIX)/ClntTransMgr
CLNTADDRMGR = $(PREFIX)/ClntAddrMgr
CLNTCFGMGR = $(PREFIX)/ClntCfgMgr
CLNTPARSER = $(PREFIX)/ClntParser
CLNTMESSAGES= $(PREFIX)/ClntMessages
CLNTOPTIONS = $(PREFIX)/ClntOptions
SRVIFACEMGR = $(PREFIX)/SrvIfaceMgr
SRVTRANSMGR = $(PREFIX)/SrvTransMgr
SRVADDRMGR = $(PREFIX)/SrvAddrMgr
SRVCFGMGR = $(PREFIX)/SrvCfgMgr
SRVPARSER = $(PREFIX)/SrvParser
SRVMESSAGES = $(PREFIX)/SrvMessages
SRVOPTIONS = $(PREFIX)/SrvOptions
RELIFACEMGR = $(PREFIX)/RelIfaceMgr
RELTRANSMGR = $(PREFIX)/RelTransMgr
RELCFGMGR = $(PREFIX)/RelCfgMgr
RELMESSAGES = $(PREFIX)/RelMessages
RELOPTIONS = $(PREFIX)/RelOptions
POSLIB = $(PREFIX)/poslib/poslib/.libs
COMMONSUBDIRS= IfaceMgr AddrMgr CfgMgr Messages Options include Misc $(PORT_SUBDIR)
CLNTSUBDIRS = ClntOptions ClntIfaceMgr ClntAddrMgr ClntCfgMgr ClntTransMgr ClntMessages
SRVSUBDIRS = SrvOptions SrvIfaceMgr SrvAddrMgr SrvCfgMgr SrvTransMgr SrvMessages
RELSUBDIRS = RelTransMgr RelMessages RelOptions RelIfaceMgr RelCfgMgr
REQUESTORDIRS= Requestor Options Misc IfaceMgr Messages Port-linux
POSLIBDIRS = poslib poslib/poslib
SUBDIRS = $(COMMONSUBDIRS) $(CLNTSUBDIRS) $(SRVSUBDIRS) $(RELSUBDIRS) $(POSLIBDIRS)
LOWLEVEL = $(PREFIX)/$(PORTDIR)
CLIENTBIN = dibbler-client
SERVERBIN = dibbler-server
RELAYBIN = dibbler-relay
REQUESTORBIN = dibbler-requestor
CLIENT = $(PORTDIR)/$(CLIENTBIN).cpp
SERVER = $(PORTDIR)/$(SERVERBIN).cpp
RELAY = $(PORTDIR)/$(RELAYBIN).cpp
# === UNIVERSAL TARGETS ===
%.o: %.cpp %.h
@echo "[CXX ] $(SUBDIR)/$@"
$(CXX) $(CPPFLAGS) $(CXXFLAGS) -c -o $@ $<
%.a: objs
@echo "[LIB ] $(SUBDIR)/$@"
$(AR) cr $@ $(OBJECTS)
all: libs
objs: $(OBJECTS)
FINDOPTS = -path './poslib/*' -prune -o
clean:
@echo "[CLEAN ] $(SUBDIR)"
rm -f *~ *.o *.a $(CLIENTBIN) $(SERVERBIN) $(RELAYBIN) $(REQUESTORBIN) TAGS
rm -f $(TESTS) $(OBJECTS)
find . $(FINDOPTS) -type l -exec rm {} \;
find . $(FINDOPTS) -name *.a -exec rm {} \;
find . $(FINDOPTS) -name *~ -exec rm {} \;
find . $(FINDOPTS) -name *.o -exec rm {} \;
find . $(FINDOPTS) -name test? -exec rm {} \;
if [ -d bison++/.deps ]; then rm -rf bison++/.deps; fi
if [ -d doc ]; then make -C doc clean; fi
# === SUBDIR NAMES ===
SUBDIR=$(subst $(TOPDIR),,$(CURDIR))
ifndef TOPDIR
TOPDIR=$(CURDIR)
endif
# === translate Makefile defines into C/C++ defines ===
ifdef MOD_CLNT_EMBEDDED_CFG
COPTS += -DMOD_CLNT_EMBEDDED_CFG
endif
ifdef MOD_CLNT_DISABLE_DNSUPDATE
COPTS += -DMOD_CLNT_DISABLE_DNSUPDATE
endif
ifdef MOD_CLNT_BIND_REUSE
COPTS += -DMOD_CLNT_BIND_REUSE
endif
ifdef MOD_CLNT_CONFIRM
COPTS += -DMOD_CLNT_CONFIRM
endif
ifdef MOD_SRV_DISABLE_DNSUPDATE
COPTS += -DMOD_SRV_DISABLE_DNSUPDATE
endif
ifdef MOD_DISABLE_AUTH
COPTS += -DMOD_DISABLE_AUTH
endif
ifdef MOD_REMOTE_AUTOCONF
COPTS += -DMOD_REMOTE_AUTOCONF
endif
ifdef MOD_LIBXML2
COPTS += -DMOD_LIBXML2 -I/usr/include/libxml2
CLNT_LDFLAGS += -lxml2
endif
ifdef MOD_DEBUG
COPTS += -DDEBUG
endif