1#
2# Setup needed Tools and Libraries
3#
4
5ifeq "$(wildcard $(APR_WORK)\build\NWGNUcustom.inc)" "$(APR_WORK)\build\NWGNUcustom.inc"
6include $(APR_WORK)\build\NWGNUcustom.inc
7CUSTOM_INI = $(AP_WORK)\NWGNUcustom.ini
8endif
9
10ifndef VERBOSE
11.SILENT:
12endif
13
14#
15# Treat like an include
16#
17ifndef EnvironmentDefined
18
19#
20# simple macros for parsing makefiles
21#
22EOLIST:=
23EMPTY :=
24COMMA := ,
25SPACE := $(EMPTY) $(EMPTY)
26
27#
28# Base environment
29#
30
31# Try and handle case issues
32ifndef NOVELLLIBC
33ifdef NovellLibC
34NOVELLLIBC = $(NovellLibC)
35endif
36endif
37
38ifndef NOVELLLIBC
39NOVELLLIBC = C:/novell/ndk/libc
40endif
41
42# This is a placeholder
43# ifndef LDAPSDK
44# LDAPSDK = C:/novell/ndk/cldapsdk
45# endif
46
47ifndef METROWERKS
48METROWERKS = C:\Program Files\Metrowerks\CodeWarrior
49endif
50
51# If LM_LICENSE_FILE isn't defined, define a variable that can be used to
52# restart make with it defined
53ifndef LM_LICENSE_FILE
54NO_LICENSE_FILE = NO_LICENSE_FILE
55endif
56
57#
58# Set the Release type that you want to build, possible values are:
59#
60#  debug		- full debug switches are set
61#  noopt		- normal switches are set (default)
62#  optimized	- optimization switches are set
63
64ifdef reltype
65RELEASE=$(reltype)
66endif
67
68ifdef RELTYPE
69RELEASE=$(RELTYPE)
70endif
71
72ifdef debug
73RELEASE=debug
74endif
75
76ifdef DEBUG
77RELEASE=debug
78endif
79
80ifdef optimized
81RELEASE=optimized
82endif
83
84ifdef OPTIMIZED
85RELEASE=optimized
86endif
87
88ifndef RELEASE
89RELEASE = optimized
90endif
91
92ifeq "$(RELEASE)" "debug"
93OBJDIR = Debug
94endif
95
96ifeq "$(RELEASE)" "noopt"
97OBJDIR = Noopt
98endif
99
100ifeq "$(RELEASE)" "optimized"
101OBJDIR = Release
102endif
103
104#
105# Setup compiler information
106#
107
108# MetroWerks NLM tools
109CC		= mwccnlm
110CPP		= mwccnlm
111LINK	= mwldnlm
112LIB		= mwldnlm -type library -w nocmdline
113
114ifdef IPV6
115ifndef USE_STDSOCKETS
116USE_STDSOCKETS=1
117endif
118endif
119
120NOVI	= $(NOVELLLIBC)\imports
121
122INCDIRS 	= $(NOVELLLIBC)\include;$(NOVELLLIBC)\include\nks;$(NOVELLLIBC)\include\winsock;
123
124DEFINES		= -DNETWARE
125ifndef USE_STDSOCKETS
126DEFINES += -DUSE_WINSOCK
127endif
128ifndef DEBUG
129DEFINES += -DNDEBUG
130endif
131
132#
133# MetroWerks static Libraries
134
135CLIB3S	= $(METROWERKS)\Novell Support\Metrowerks Support\Libraries\Runtime\mwcrtl.lib
136MATH3S	=
137PLIB3S	= $(METROWERKS)\Novell Support\Metrowerks Support\Libraries\MSL C++\MWCPP.lib
138
139# Base compile flags
140# and prefix or precompiled header added here.
141
142# The default flags are as follows:
143#
144# -c                    compile only, no link
145# -nosyspath            treat #include <...> like #include "..."
146# -Cpp_exceptions off   disable C++ exceptions
147# -RTTI off             disable C++ run-time typing information
148# -align 4              align on 4 byte bounderies
149# -w nocmdline          disable command-line driver/parser warnings
150# -proc PII             generate code base on Pentium II instruction set
151# -inst mmx             use MMX extensions (not used)
152
153CFLAGS = -c -nosyspath -Cpp_exceptions off -RTTI off -align 4 -w nocmdline -proc PII
154
155# -g                    generate debugging information
156# -O0                   level 0 optimizations
157
158ifeq "$(RELEASE)" "debug"
159CFLAGS += -g -O0
160endif
161
162# -O4,p                 level 4 optimizations, optimize for speed
163ifeq "$(RELEASE)" "optimized"
164CFLAGS += -O4,p
165endif
166
167# -prefix apr_arch_pre_nw.h      #include pre_nw.h for all files
168
169CFLAGS += -prefix apr_arch_pre_nw.h
170
171
172PATH:=$(PATH);$(METROWERKS)\bin;$(METROWERKS)\Other Metrowerks Tools\Command Line Tools
173
174#
175# Declare major project deliverables output directories here
176#
177
178ifdef DEST
179INSTALL = $(DEST)
180ifeq (\, $(findstring \,$(INSTALL)))
181INSTDIRS = $(DEST)
182endif
183endif
184
185ifdef dest
186INSTALL = $(dest)
187ifeq (\, $(findstring \,$(INSTALL)))
188INSTDIRS = $(dest)
189endif
190endif
191
192ifndef INSTALL
193INSTALL = $(APR_WORK)\Dist
194INSTDIRS = $(APR_WORK)\Dist
195endif
196
197# Add support for building IPV6 alongside
198ifneq "$(IPV6)" ""
199DEFINES += -DNW_BUILD_IPV6
200INCDIRS := $(NOVELLLIBC)\include\winsock\IPV6;$(INCDIRS)
201
202ifneq "$(findstring IPV6,$(OBJDIR))" "IPV6"
203OBJDIR := $(OBJDIR)_IPV6
204endif
205
206ifneq "$(findstring IPV6,$(INSTALL))" "IPV6"
207INSTALL := $(INSTALL)_IPV6
208endif
209
210ifneq "$(findstring IPV6,$(INSTDIRS))" "IPV6"
211INSTDIRS := $(INSTDIRS)_IPV6
212endif
213
214endif
215
216ifdef DEST
217INSTALLBASE := $(INSTALL)\Apache2
218
219INSTDEVDIRS := \
220    $(INSTDIRS) \
221	$(INSTALLBASE) \
222	$(INSTALLBASE)\include \
223	$(INSTALLBASE)\lib \
224
225INSTDIRS += \
226	$(INSTALLBASE) \
227
228else
229INSTALLBASE := $(INSTALL)\apr
230
231INSTDEVDIRS := \
232    $(INSTDIRS) \
233	$(INSTALLBASE) \
234	$(INSTALLBASE)\include \
235	$(INSTALLBASE)\lib \
236
237INSTDIRS += \
238	$(INSTALLBASE) \
239
240endif
241
242#
243# Declare Command and tool macros here
244#
245
246# Os2LibPath is an extra check to see if we are on NT
247ifdef Os2LibPath
248OS = Windows_NT
249endif
250
251ifeq "$(OS)" "Windows_NT"
252CMD=cmd /C
253CHK=cmd /C if exist
254CHKNOT=cmd /C if not exist
255DEL = del /F
256DELTREE = cmd /C rd /s/q
257WINNT=1
258XCOPYSW = /E
259else
260CMD=command /C
261CHK=command /C if exist
262CHKNOT=command /C if not exist
263DEL = del
264DELTREE = deltree /y
265XCOPYSW = /E /Y
266endif
267
268
269#
270# Setup base C compiler flags
271#
272
273#
274# Common directories
275#
276
277APR		= $(APR_WORK)
278APRTEST		= $(APR_WORK)/test
279APRUTIL		= $(APU_WORK)
280APULDAP		= $(APU_WORK)/ldap
281XML		= $(APRUTIL)/xml
282
283#
284# Internal Libraries
285#
286
287APRLIB		= $(APR)/$(OBJDIR)/aprlib.lib
288APRUTLIB	= $(APRUTIL)/$(OBJDIR)/aprutil.lib
289APULDAPLIB	= $(APULDAP)/$(OBJDIR)/apuldap.lib
290XMLLIB		= $(XML)/$(OBJDIR)/xmllib.lib
291
292#
293# Additional general defines
294#
295
296EnvironmentDefined = 1
297endif # ifndef EnvironmentDefined
298
299# This is always set so that it will show up in lower directories
300
301ifdef Path
302Path = $(PATH)
303endif
304
305