[go: up one dir, main page]

File: Makefile.inc

package info (click to toggle)
dibbler 0.7.3-1.3
  • links: PTS
  • area: main
  • in suites: squeeze
  • size: 11,148 kB
  • ctags: 8,720
  • sloc: cpp: 54,863; sh: 9,389; ansic: 8,659; yacc: 2,570; makefile: 1,061; lex: 842; perl: 49; xml: 6
file content (187 lines) | stat: -rw-r--r-- 5,126 bytes parent folder | download
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
# === 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 ===
COPTS        = -D$(ARCH) $(PORT_CFLAGS) $(XMLCFLAGS) -I $(INCDIR) $(DEBUGINFO) -Wall -funsigned-char -O0 $(PEDANTIC)
OPTS         = -ftemplate-depth-40 $(COPTS) $(CFLAGS) $(CXXFLAGS)

# === linker options ===
LDFLAGS      += $(XMLLIBS) $(EFENCE) $(PORT_LDFLAGS)
CLNT_LDFLAGS = $(LDFLAGS)
SRV_LDFLAGS  = $(LDFLAGS)
REL_LDFLAGS  = $(LDFLAGS)

# === debuging parameters ===
PEDANTIC     = -pedantic
DEBUGINFO    = -g
#EFENCE       = -lefence

# === 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_LIBXML2 = y
#MOD_DEBUG = y

# === Portability section ===
# Make sure that you have uncommented only one section

# === Port: Linux ===
ARCH         = LINUX
PORT_LDFLAGS ?=
PORT_CFLAGS  ?= 
PORT_SUBDIR  = Port-linux

# === Port: Mac OS ===
#ARCH          = MACOS
#PORT_LDFLAGS ?=
#PORT_LDFLAGS ?=
#PORT_SUBDIR   = Port-macos

# === Port: Win2k (mingw) ===
#ARCH         = WIN2K
#PORT_LDFLAGS = -lws2_32
#PORT_CFLAGS  = -DMINGWBUILD
#PORT_SUBDIR  = Port-win2k

# === 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       = ..
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) $(OPTS) -c -o $@ $<

%.a: objs
	@echo "[LIB    ] $(SUBDIR)/$@"	
	$(AR) cr $@ $(OBJECTS)

all: libs

FINDOPTS = -path './poslib/*' -prune -o

clean:
	@echo "[CLEAN  ] $(SUBDIR)"
	rm -f *~ *.o *.a test? $(CLIENTBIN) $(SERVERBIN) $(RELAYBIN) $(REQUESTORBIN) TAGS
	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_SRV_DISABLE_DNSUPDATE
COPTS += -DMOD_SRV_DISABLE_DNSUPDATE
endif

ifdef MOD_DISABLE_AUTH
COPTS += -DMOD_DISABLE_AUTH
endif

ifdef MOD_LIBXML2
COPTS += -DMOD_LIBXML2 -I/usr/include/libxml2
CLNT_LDFLAGS += -lxml2
endif

ifdef MOD_DEBUG
COPTS += -DDEBUG
endif