1 |
# |
2 |
# Setup needed Tools and Libraries |
3 |
# |
4 |
|
5 |
ifeq "$(wildcard $(APR_WORK)/build/NWGNUcustom.inc)" "$(APR_WORK)/build/NWGNUcustom.inc" |
6 |
include $(APR_WORK)/build/NWGNUcustom.inc |
7 |
CUSTOM_INI = $(AP_WORK)/NWGNUcustom.ini |
8 |
endif |
9 |
|
10 |
ifndef VERBOSE |
11 |
.SILENT: |
12 |
endif |
13 |
|
14 |
# |
15 |
# Treat like an include |
16 |
# |
17 |
ifndef EnvironmentDefined |
18 |
|
19 |
# |
20 |
# simple macros for parsing makefiles |
21 |
# |
22 |
EOLIST:= |
23 |
EMPTY := |
24 |
COMMA := , |
25 |
SPACE := $(EMPTY) $(EMPTY) |
26 |
|
27 |
# |
28 |
# Base environment |
29 |
# |
30 |
|
31 |
# Try and handle case issues |
32 |
ifndef NOVELLLIBC |
33 |
ifdef NovellLibC |
34 |
NOVELLLIBC = $(NovellLibC) |
35 |
endif |
36 |
endif |
37 |
|
38 |
ifndef NOVELLLIBC |
39 |
NOVELLLIBC = C:/novell/ndk/libc |
40 |
endif |
41 |
ifneq "$(wildcard $(NOVELLLIBC)/include/ndkvers.h)" "$(NOVELLLIBC)/include/ndkvers.h" |
42 |
$(error NOVELLLIBC does not point to a valid Novell LIBC SDK) |
43 |
endif |
44 |
|
45 |
ifndef LDAPSDK |
46 |
LDAPSDK = C:/novell/ndk/cldapsdk/NetWare/libc |
47 |
endif |
48 |
ifneq "$(wildcard $(LDAPSDK)/inc/ldap.h)" "$(LDAPSDK)/inc/ldap.h" |
49 |
$(error LDAPSDK does not point to a valid Novell CLDAP SDK) |
50 |
endif |
51 |
|
52 |
ifdef EXPATSDK |
53 |
ifeq "$(wildcard $(EXPATSDK)/include/expat.h)" "$(EXPATSDK)/include/expat.h" |
54 |
EXPAT_IMP = $(EXPATSDK)/imports/expatlbc.imp |
55 |
EXPAT_INC = $(EXPATSDK)/include |
56 |
EXPAT_LIB = $(EXPATSDK)/lib/expat.lib |
57 |
EXPAT_NLM = EXPATLBC |
58 |
else |
59 |
$(error EXPATSDK does not point to a valid EXPAT SDK) |
60 |
endif |
61 |
endif |
62 |
ifdef EXPATSRC |
63 |
ifeq "$(wildcard $(EXPATSRC)/lib/xmlparse.c)" "$(EXPATSRC)/lib/xmlparse.c" |
64 |
EXPAT_INC = $(EXPATSRC)/lib |
65 |
EXPAT_LIB = $(EXPATSRC)/lib/$(OBJDIR)/expat.lib |
66 |
else |
67 |
$(error EXPATSRC does not point to a valid EXPAT source tree) |
68 |
endif |
69 |
endif |
70 |
ifndef EXPAT_INC |
71 |
EXPATSRC = $(APUXML)/expat |
72 |
EXPAT_INC = $(EXPATSRC)/lib |
73 |
EXPAT_LIB = $(EXPATSRC)/lib/$(OBJDIR)/expat.lib |
74 |
endif |
75 |
|
76 |
ifndef METROWERKS |
77 |
METROWERKS = $(ProgramFiles)\Metrowerks\CodeWarrior |
78 |
endif |
79 |
|
80 |
# If LM_LICENSE_FILE isn't defined, define a variable that can be used to |
81 |
# restart make with it defined |
82 |
ifndef LM_LICENSE_FILE |
83 |
NO_LICENSE_FILE = NO_LICENSE_FILE |
84 |
endif |
85 |
|
86 |
# |
87 |
# Set the Release type that you want to build, possible values are: |
88 |
# |
89 |
# debug - full debug switches are set |
90 |
# noopt - normal switches are set |
91 |
# release - optimization switches are set (default) |
92 |
|
93 |
ifdef reltype |
94 |
RELEASE = $(reltype) |
95 |
endif |
96 |
|
97 |
ifdef RELTYPE |
98 |
RELEASE = $(RELTYPE) |
99 |
endif |
100 |
|
101 |
ifdef debug |
102 |
RELEASE = debug |
103 |
endif |
104 |
|
105 |
ifdef DEBUG |
106 |
RELEASE = debug |
107 |
endif |
108 |
|
109 |
ifdef noopt |
110 |
RELEASE = noopt |
111 |
endif |
112 |
|
113 |
ifdef NOOPT |
114 |
RELEASE = noopt |
115 |
endif |
116 |
|
117 |
ifdef optimized |
118 |
RELEASE = release |
119 |
endif |
120 |
|
121 |
ifdef OPTIMIZED |
122 |
RELEASE = release |
123 |
endif |
124 |
|
125 |
ifndef RELEASE |
126 |
RELEASE = release |
127 |
endif |
128 |
|
129 |
ifeq "$(strip $(RELEASE))" "optimized" |
130 |
RELEASE = release |
131 |
endif |
132 |
|
133 |
OBJDIR = obj_$(RELEASE) |
134 |
|
135 |
# |
136 |
# Setup compiler information |
137 |
# |
138 |
|
139 |
# MetroWerks NLM tools |
140 |
CC = mwccnlm |
141 |
CPP = mwccnlm |
142 |
LINK = mwldnlm |
143 |
LIB = mwldnlm -type library -w nocmdline |
144 |
|
145 |
# Setup build tools |
146 |
AWK = awk |
147 |
|
148 |
# |
149 |
# Declare Command and tool macros here |
150 |
# |
151 |
|
152 |
ifeq ($(findstring /sh,$(SHELL)),/sh) |
153 |
DEL = rm -f $1 |
154 |
RMDIR = rm -rf $1 |
155 |
MKDIR = mkdir -p $1 |
156 |
COPY = cp -av $1 $2 |
157 |
COPYR = cp -ar $1 $2 |
158 |
ECHONL = echo "" |
159 |
DL = ' |
160 |
CAT = cat |
161 |
else |
162 |
ifeq "$(OS)" "Windows_NT" |
163 |
DEL = $(shell if exist $(subst /,\,$1) del /q /f 2>NUL $(subst /,\,$1)) |
164 |
RMDIR = $(shell if exist $(subst /,\,$1)\NUL rd /q /s 2>NUL $(subst /,\,$1)) |
165 |
else |
166 |
DEL = $(shell if exist $(subst /,\,$1) del 2>NUL $(subst /,\,$1)) |
167 |
RMDIR = $(shell if exist $(subst /,\,$1)\NUL deltree /y 2>NUL $(subst /,\,$1)) |
168 |
endif |
169 |
ECHONL = $(ComSpec) /c echo. |
170 |
MKDIR = $(shell if not exist $(subst /,\,$1)\NUL md 2>NUL $(subst /,\,$1)) |
171 |
COPY = copy /y 2>NUL $(subst /,\,$1) $(subst /,\,$2) |
172 |
COPYR = xcopy /y /e 2>NUL $(subst /,\,$1) $(subst /,\,$2) |
173 |
CAT = type |
174 |
endif |
175 |
|
176 |
ifdef IPV6 |
177 |
ifndef USE_STDSOCKETS |
178 |
USE_STDSOCKETS=1 |
179 |
endif |
180 |
endif |
181 |
|
182 |
NOVI = $(NOVELLLIBC)/imports |
183 |
PRELUDE = $(NOVI)/libcpre.o |
184 |
|
185 |
INCDIRS = $(NOVELLLIBC)/include; |
186 |
|
187 |
DEFINES = -DNETWARE |
188 |
ifdef USE_STDSOCKETS |
189 |
DEFINES += -DUSE_BSD_SOCKETS |
190 |
else |
191 |
DEFINES += -DUSE_WINSOCK |
192 |
INCDIRS += $(NOVELLLIBC)/include/winsock; |
193 |
endif |
194 |
ifndef DEBUG |
195 |
DEFINES += -DNDEBUG |
196 |
endif |
197 |
|
198 |
ifdef USE_STDSOCKETS |
199 |
VERSION_SKT = (BSDSOCK) |
200 |
else |
201 |
VERSION_SKT = (WINSOCK) |
202 |
endif |
203 |
|
204 |
# MetroWerks static Libraries |
205 |
CLIB3S = $(METROWERKS)/Novell Support/Metrowerks Support/Libraries/Runtime/mwcrtl.lib |
206 |
MATH3S = |
207 |
PLIB3S = $(METROWERKS)/Novell Support/Metrowerks Support/Libraries/MSL C++/MWCPP.lib |
208 |
|
209 |
# Base compile flags |
210 |
# and prefix or precompiled header added here. |
211 |
|
212 |
# The default flags are as follows: |
213 |
# |
214 |
# -c compile only, no link |
215 |
# -gccinc search directory of referencing file first for #includes |
216 |
# -Cpp_exceptions off disable C++ exceptions |
217 |
# -RTTI off disable C++ run-time typing information |
218 |
# -align 4 align on 4 byte bounderies |
219 |
# -w nocmdline disable command-line driver/parser warnings |
220 |
# -proc PII generate code base on Pentium II instruction set |
221 |
# -inst mmx use MMX extensions (not used) |
222 |
|
223 |
CFLAGS = -c -w nocmdline -gccinc -Cpp_exceptions off -RTTI off -align 4 -proc PII |
224 |
|
225 |
ifeq "$(REQUIRE_PROTOTYPES)" "1" |
226 |
CFLAGS += -r |
227 |
endif |
228 |
|
229 |
# -g generate debugging information |
230 |
# -O0 level 0 optimizations |
231 |
ifeq "$(RELEASE)" "debug" |
232 |
CFLAGS += -g -O0 |
233 |
endif |
234 |
|
235 |
# -O4,p level 4 optimizations, optimize for speed |
236 |
ifeq "$(RELEASE)" "release" |
237 |
CFLAGS += -O4,p |
238 |
endif |
239 |
|
240 |
# -prefix apr_arch_pre_nw.h #include pre_nw.h for all files |
241 |
CFLAGS += -prefix apr_arch_pre_nw.h |
242 |
|
243 |
|
244 |
ifneq ($(findstring /sh,$(SHELL)),/sh) |
245 |
PATH:=$(PATH);$(METROWERKS)\bin;$(METROWERKS)\Other Metrowerks Tools\Command Line Tools |
246 |
endif |
247 |
|
248 |
# |
249 |
# Declare major project deliverables output directories here |
250 |
# |
251 |
|
252 |
ifdef DEST |
253 |
INSTALL = $(DEST) |
254 |
ifeq (\, $(findstring \,$(INSTALL))) |
255 |
INSTDIRS = $(DEST) |
256 |
endif |
257 |
endif |
258 |
|
259 |
ifdef dest |
260 |
INSTALL = $(dest) |
261 |
ifeq (\, $(findstring \,$(INSTALL))) |
262 |
INSTDIRS = $(dest) |
263 |
endif |
264 |
endif |
265 |
|
266 |
ifndef INSTALL |
267 |
INSTALL = $(APR_WORK)/Dist |
268 |
INSTDIRS = $(APR_WORK)/Dist |
269 |
BASEDIR = Apr |
270 |
endif |
271 |
|
272 |
# Add support for building IPV6 alongside |
273 |
ifneq "$(IPV6)" "" |
274 |
DEFINES += -DNW_BUILD_IPV6 |
275 |
# INCDIRS := $(NOVELLLIBC)/include/winsock/IPV6;$(INCDIRS) |
276 |
|
277 |
ifneq "$(findstring IPV6,$(OBJDIR))" "IPV6" |
278 |
OBJDIR := $(OBJDIR)_IPV6 |
279 |
endif |
280 |
|
281 |
ifneq "$(findstring IPV6,$(INSTALL))" "IPV6" |
282 |
INSTALL := $(INSTALL)_IPV6 |
283 |
endif |
284 |
|
285 |
ifneq "$(findstring IPV6,$(INSTDIRS))" "IPV6" |
286 |
INSTDIRS := $(INSTDIRS)_IPV6 |
287 |
endif |
288 |
|
289 |
endif |
290 |
|
291 |
ifdef DEST |
292 |
|
293 |
ifndef BASEDIR |
294 |
BASEDIR = Apache2 |
295 |
endif |
296 |
|
297 |
endif |
298 |
|
299 |
INSTALLBASE := $(INSTALL)/$(BASEDIR) |
300 |
|
301 |
INSTDEVDIRS := \ |
302 |
$(INSTDIRS) \ |
303 |
$(INSTALLBASE) \ |
304 |
$(INSTALLBASE)/include \ |
305 |
$(INSTALLBASE)/lib \ |
306 |
$(INSTALLBASE)/bin |
307 |
|
308 |
INSTDIRS += \ |
309 |
$(INSTALLBASE) |
310 |
|
311 |
# |
312 |
# Common directories |
313 |
# |
314 |
|
315 |
APR = $(subst \,/,$(APR_WORK)) |
316 |
APU = $(subst \,/,$(APU_WORK)) |
317 |
APRBUILD = $(APR)/build |
318 |
APULDAP = $(APU)/ldap |
319 |
APUXML = $(APU)/xml |
320 |
APRTEST = $(APR)/test |
321 |
APUTEST = $(APU)/test |
322 |
|
323 |
# |
324 |
# Internal Libraries |
325 |
# |
326 |
|
327 |
APRLIB = $(APR)/$(OBJDIR)/aprlib.lib |
328 |
APULIB = $(APU)/$(OBJDIR)/apulib.lib |
329 |
APULDAPLIB = $(APULDAP)/$(OBJDIR)/apuldap.lib |
330 |
APUXMLLIB = $(APUXML)/$(OBJDIR)/apuxml.lib |
331 |
|
332 |
# |
333 |
# Additional general defines |
334 |
# |
335 |
|
336 |
EnvironmentDefined = 1 |
337 |
endif # ifndef EnvironmentDefined |
338 |
|
339 |
# This is always set so that it will show up in lower directories |
340 |
|
341 |
ifdef Path |
342 |
Path = $(PATH) |
343 |
endif |
344 |
|