2 # Setup needed Tools and Libraries
5 ifeq "$(wildcard $(AP_WORK)/NWGNUcustom.ini)" "$(AP_WORK)/NWGNUcustom.ini"
6 include $(AP_WORK)/NWGNUcustom.ini
7 CUSTOM_INI = $(AP_WORK)/NWGNUcustom.ini
15 # Treat like an include
17 ifndef EnvironmentDefined
20 # simple macros for parsing makefiles
25 SPACE := $(EMPTY) $(EMPTY)
31 # Try and handle case issues
34 NOVELLLIBC = $(NovellLibC)
39 NOVELLLIBC = C:/novell/ndk/libc
41 ifneq "$(wildcard $(NOVELLLIBC)/include/ndkvers.h)" "$(NOVELLLIBC)/include/ndkvers.h"
42 $(error NOVELLLIBC does not point to a valid Novell LIBC SDK)
46 LDAPSDK = C:/novell/ndk/cldapsdk/NetWare/libc
48 ifneq "$(wildcard $(LDAPSDK)/inc/ldap.h)" "$(LDAPSDK)/inc/ldap.h"
49 $(error LDAPSDK does not point to a valid Novell CLDAP SDK)
53 PCRESRC = $(AP_WORK)/srclib/pcre
55 ifneq "$(wildcard $(PCRESRC)/pcre-config.in)" "$(PCRESRC)/pcre-config.in"
56 $(error PCRESRC does not point to a valid PCRE source tree)
59 # This is a placeholder
61 # ZLIBSDK = C:/novell/ndk/zlibsdk
65 METROWERKS = $(ProgramFiles)\Metrowerks\CodeWarrior
68 # If LM_LICENSE_FILE isn't defined, define a variable that can be used to
69 # restart make with it defined
70 ifndef LM_LICENSE_FILE
71 NO_LICENSE_FILE = NO_LICENSE_FILE
75 # Set the Release type that you want to build, possible values are:
77 # debug - full debug switches are set
78 # noopt - normal switches are set
79 # release - optimization switches are set (default)
117 OBJDIR = obj_$(RELEASE)
119 # Define minimum APR version to check for
123 # Setup compiler information
126 # MetroWerks NLM tools
130 LIB = mwldnlm -type library -w nocmdline
136 # Setup distribution tools
141 # Declare Command and tool macros here
144 ifeq ($(findstring /sh,$(SHELL)),/sh)
148 COPY = -cp -afv $1 $2
149 #COPYR = -cp -afr $1/* $2
150 COPYR = -rsync -aC $1/* $2
156 ifeq "$(OS)" "Windows_NT"
157 DEL = $(shell if exist $(subst /,\,$1) del /q /f 2>NUL $(subst /,\,$1))
158 RMDIR = $(shell if exist $(subst /,\,$1)\NUL rd /q /s 2>NUL $(subst /,\,$1))
160 DEL = $(shell if exist $(subst /,\,$1) del 2>NUL $(subst /,\,$1))
161 RMDIR = $(shell if exist $(subst /,\,$1)\NUL deltree /y 2>NUL $(subst /,\,$1))
163 ECHONL = $(ComSpec) /c echo.
164 MKDIR = $(shell if not exist $(subst /,\,$1)\NUL md 2>NUL $(subst /,\,$1))
165 COPY = -copy /y 2>NUL $(subst /,\,$1) $(subst /,\,$2)
166 COPYR = -xcopy /q /y /e 2>NUL $(subst /,\,$1) $(subst /,\,$2)
167 TOUCH = -copy /b 2>&1>NUL $(subst /,\,$1) +,,
172 ifndef USE_STDSOCKETS
177 NOVI = $(NOVELLLIBC)/imports
178 PRELUDE = $(NOVI)/libcpre.o
180 INCDIRS = $(NOVELLLIBC)/include;
181 ifndef USE_STDSOCKETS
182 INCDIRS += $(NOVELLLIBC)/include/winsock;
184 ifneq "$(LDAPSDK)" ""
185 INCDIRS += $(LDAPSDK)/inc;
187 ifneq "$(ZLIBSDK)" ""
188 INCDIRS += $(ZLIBSDK);
190 ifneq "$(PCRESRC)" ""
191 INCDIRS += $(PCRESRC);
195 ifndef USE_STDSOCKETS
196 DEFINES += -DUSE_WINSOCK
203 VERSION_SKT = (BSDSOCK)
205 VERSION_SKT = (WINSOCK)
208 # MetroWerks static Libraries
209 CLIB3S = $(METROWERKS)/Novell Support/Metrowerks Support/Libraries/Runtime/mwcrtl.lib
211 PLIB3S = $(METROWERKS)/Novell Support/Metrowerks Support/Libraries/MSL C++/MWCPP.lib
213 ifeq "$(OS)" "Windows_NT"
214 # MetroWerks Win32 build flags to create build tools
215 MWCW_MSL = "$(METROWERKS)/MSL"
216 MWCW_W32 = "$(METROWERKS)/Win32-x86 Support"
217 CC_FOR_BUILD = $(WIN_CC)
218 CFLAGS_FOR_BUILD = -O2 -gccinc -nodefaults -proc 586 -w off
219 CFLAGS_FOR_BUILD += -ir $(MWCW_MSL) -ir $(MWCW_W32) -lr $(MWCW_MSL) -lr $(MWCW_W32)
220 CFLAGS_FOR_BUILD += -lMSL_All_x86.lib -lkernel32.lib -luser32.lib
222 # GNUC build flags to create build tools
224 CFLAGS_FOR_BUILD = -Wall -O2
228 # and prefix or precompiled header added here.
230 # The default flags are as follows:
232 # -c compile only, no link
233 # -gccinc search directory of referencing file first for #includes
234 # -Cpp_exceptions off disable C++ exceptions
235 # -RTTI off disable C++ run-time typing information
236 # -align 4 align on 4 byte bounderies
237 # -w nocmdline disable command-line driver/parser warnings
238 # -proc PII generate code base on Pentium II instruction set
239 # -inst mmx use MMX extensions (Not used)
241 CFLAGS += -c -w nocmdline -gccinc -Cpp_exceptions off -RTTI off -align 4 -proc PII
244 CFLAGS += -maxerrors $(CC_MAX_ERRORS)
246 CFLAGS += -maxerrors 1
249 ifeq "$(REQUIRE_PROTOTYPES)" "1"
253 # -g generate debugging information
254 # -O0 level 0 optimizations
255 ifeq "$(RELEASE)" "debug"
259 # -O4,p level 4 optimizations, optimize for speed
260 ifeq "$(RELEASE)" "release"
264 # -prefix pre_nw.h #include pre_nw.h for all files
265 CFLAGS += -prefix pre_nw.h
268 ifneq ($(findstring /sh,$(SHELL)),/sh)
269 PATH:=$(PATH);$(METROWERKS)\bin;$(METROWERKS)\Other Metrowerks Tools\Command Line Tools
273 # Declare major project deliverables output directories here
285 INSTALL = $(subst \,/,$(DEST))
286 ifeq (/, $(findstring /,$(INSTALL)))
287 INSTDIRS = $(INSTALL)
292 INSTALL = $(subst \,/,$(dest))
293 ifeq (/, $(findstring /,$(INSTALL)))
294 INSTDIRS = $(INSTALL)
299 INSTALL = $(AP_WORK)/Dist
300 INSTDIRS = $(INSTALL)
303 ifeq ($(MAKECMDGOALS),installdev)
305 export BASEDIR = apache_$(VERSION_STR)-sdk
309 export BASEDIR = Apache$(VERSION_MAJMIN)
313 # Add support for building IPV6 alongside
315 DEFINES += -DNW_BUILD_IPV6
316 # INCDIRS := $(NOVELLLIBC)/include/winsock/IPV6;$(INCDIRS)
318 ifneq "$(findstring IPV6,$(OBJDIR))" "IPV6"
319 OBJDIR := $(OBJDIR)_IPV6
322 ifneq "$(findstring IPV6,$(INSTALL))" "IPV6"
323 INSTALL := $(INSTALL)_IPV6
326 ifneq "$(findstring IPV6,$(INSTDIRS))" "IPV6"
327 INSTDIRS := $(INSTDIRS)_IPV6
332 INSTALLBASE = $(INSTALL)/$(BASEDIR)
337 $(INSTALLBASE)/build \
338 $(INSTALLBASE)/include \
345 $(INSTALLBASE)/cgi-bin \
346 $(INSTALLBASE)/conf \
347 $(INSTALLBASE)/conf/extra \
348 $(INSTALLBASE)/error \
349 $(INSTALLBASE)/htdocs \
350 $(INSTALLBASE)/icons \
351 $(INSTALLBASE)/logs \
353 $(INSTALLBASE)/manual \
354 $(INSTALLBASE)/modules \
361 SRC = $(subst \,/,$(AP_WORK))
362 APR = $(subst \,/,$(APR_WORK))
363 APRUTIL = $(subst \,/,$(APU_WORK))
364 APBUILD = $(SRC)/build
365 STDMOD = $(SRC)/modules
366 HTTPD = $(SRC)/modules/http
367 DAV = $(SRC)/modules/dav
368 NWOS = $(SRC)/os/netware
369 SERVER = $(SRC)/server
370 SUPMOD = $(SRC)/support
371 APULDAP = $(APRUTIL)/ldap
373 APRTEST = $(APR)/test
376 PREBUILD_INST = $(SRC)/nwprebuild
382 APRLIB = $(APR)/$(OBJDIR)/aprlib.lib
383 APRUTLIB = $(APRUTIL)/$(OBJDIR)/aprutil.lib
384 APULDAPLIB = $(APULDAP)/$(OBJDIR)/apuldap.lib
385 STMODLIB = $(STDMOD)/$(OBJDIR)/stdmod.lib
386 PCRELIB = $(SRC)/$(OBJDIR)/pcre.lib
387 NWOSLIB = $(NWOS)/$(OBJDIR)/netware.lib
388 SERVLIB = $(SERVER)/$(OBJDIR)/server.lib
389 HTTPDLIB = $(HTTPD)/$(OBJDIR)/httpd.lib
390 XMLLIB = $(XML)/$(OBJDIR)/xmllib.lib
393 # Additional general defines
396 EnvironmentDefined = 1
397 endif # ifndef EnvironmentDefined
399 # This is always set so that it will show up in lower directories