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 ifeq "$(wildcard $(AP_WORK)/srclib/pcre/pcre-config.in)" "$(AP_WORK)/srclib/pcre/pcre-config.in"
54 PCRESRC = $(AP_WORK)/srclib/pcre
57 ifneq "$(wildcard $(PCRESRC)/pcre-config.in)" "$(PCRESRC)/pcre-config.in"
58 $(error PCRESRC does not point to a valid PCRE source tree)
61 # This is a placeholder
63 # ZLIBSDK = C:/novell/ndk/zlibsdk
67 METROWERKS = C:\Program Files\Metrowerks\CodeWarrior
70 # If LM_LICENSE_FILE isn't defined, define a variable that can be used to
71 # restart make with it defined
72 ifndef LM_LICENSE_FILE
73 NO_LICENSE_FILE = NO_LICENSE_FILE
77 # Set the Release type that you want to build, possible values are:
79 # debug - full debug switches are set
80 # noopt - normal switches are set
81 # release - optimization switches are set (default)
119 OBJDIR = obj_$(RELEASE)
121 # Define minimum APR version to check for
125 # Setup compiler information
128 # MetroWerks NLM tools
132 LIB = mwldnlm -type library -w nocmdline
140 # Declare Command and tool macros here
143 ifeq ($(findstring /sh,$(SHELL)),/sh)
153 ifeq "$(OS)" "Windows_NT"
154 DEL = $(shell if exist $(subst /,\,$1) del /q /f 2>NUL $(subst /,\,$1))
155 RMDIR = $(shell if exist $(subst /,\,$1)\NUL rd /q /s 2>NUL $(subst /,\,$1))
156 ECHONL = cmd /c echo.
158 DEL = $(shell if exist $(subst /,\,$1) del 2>NUL $(subst /,\,$1))
159 RMDIR = $(shell if exist $(subst /,\,$1)\NUL deltree /y 2>NUL $(subst /,\,$1))
160 ECHONL = command /c echo.
162 MKDIR = $(shell if not exist $(subst /,\,$1)\NUL md 2>NUL $(subst /,\,$1))
163 COPY = copy /y 2>NUL $(subst /,\,$1) $(subst /,\,$2)
164 COPYR = xcopy /y /e 2>NUL $(subst /,\,$1) $(subst /,\,$2)
169 ifndef USE_STDSOCKETS
174 NOVI = $(NOVELLLIBC)/imports
176 INCDIRS = $(NOVELLLIBC)/include;
177 ifndef USE_STDSOCKETS
178 INCDIRS += $(NOVELLLIBC)/include/winsock;
180 ifneq "$(LDAPSDK)" ""
181 #INCDIRS := $(INCDIRS);$(LDAPSDK)/inc
182 INCDIRS += $(LDAPSDK)/inc;
184 ifneq "$(ZLIBSDK)" ""
185 #INCDIRS := $(INCDIRS);$(ZLIBSDK)
186 INCDIRS += $(ZLIBSDK);
188 ifneq "$(PCRESRC)" ""
189 #INCDIRS := $(INCDIRS);$(PCRESRC)
190 INCDIRS += $(PCRESRC);
194 ifndef USE_STDSOCKETS
195 DEFINES += -DUSE_WINSOCK
202 VERSION_SKT = (BSDSOCK)
204 VERSION_SKT = (WINSOCK)
207 # MetroWerks static Libraries
208 CLIB3S = $(METROWERKS)/Novell Support/Metrowerks Support/Libraries/Runtime/mwcrtl.lib
210 PLIB3S = $(METROWERKS)/Novell Support/Metrowerks Support/Libraries/MSL C++/MWCPP.lib
212 # MetroWerks Win32 build flags to create build tool
213 MWCW_MSL = "$(METROWERKS)/MSL"
214 MWCW_W32 = "$(METROWERKS)/Win32-x86 Support"
215 WIN_CFLAGS = -O2 -gccinc -nodefaults -proc 586 -w off
216 WIN_CFLAGS += -ir $(MWCW_MSL) -ir $(MWCW_W32) -lr $(MWCW_MSL) -lr $(MWCW_W32)
217 WIN_CFLAGS += -lMSL_All_x86.lib -lkernel32.lib -luser32.lib
220 # and prefix or precompiled header added here.
222 # The default flags are as follows:
224 # -c compile only, no link
225 # -nosyspath treat #include <...> like #include "..."
226 # -Cpp_exceptions off disable C++ exceptions
227 # -RTTI off disable C++ run-time typing information
228 # -align 4 align on 4 byte bounderies
229 # -w nocmdline disable command-line driver/parser warnings
230 # -proc PII generate code base on Pentium II instruction set
231 # -inst mmx use MMX extensions (Not used)
233 CFLAGS = -c -nosyspath -Cpp_exceptions off -RTTI off -align 4 -w nocmdline -proc PII
235 ifeq "$(REQUIRE_PROTOTYPES)" "1"
239 # -g generate debugging information
240 # -O0 level 0 optimizations
242 ifeq "$(RELEASE)" "debug"
246 # -O4,p level 4 optimizations, optimize for speed
247 ifeq "$(RELEASE)" "release"
251 # -prefix pre_nw.h #include pre_nw.h for all files
253 CFLAGS += -prefix pre_nw.h
256 ifneq ($(findstring /sh,$(SHELL)),/sh)
257 PATH:=$(PATH);$(METROWERKS)\bin;$(METROWERKS)\Other Metrowerks Tools\Command Line Tools
261 # Declare major project deliverables output directories here
266 ifeq (\, $(findstring \,$(INSTALL)))
273 ifeq (\, $(findstring \,$(INSTALL)))
279 INSTALL = $(AP_WORK)/Dist
280 INSTDIRS = $(AP_WORK)/Dist
296 # Add support for building IPV6 alongside
298 DEFINES += -DNW_BUILD_IPV6
299 # INCDIRS := $(NOVELLLIBC)\include\winsock\IPV6;$(INCDIRS)
301 ifneq "$(findstring IPV6,$(OBJDIR))" "IPV6"
302 OBJDIR := $(OBJDIR)_IPV6
305 ifneq "$(findstring IPV6,$(INSTALL))" "IPV6"
306 INSTALL := $(INSTALL)_IPV6
309 ifneq "$(findstring IPV6,$(INSTDIRS))" "IPV6"
310 INSTDIRS := $(INSTDIRS)_IPV6
317 $(INSTALL)/$(BASEDIR)/include \
318 $(INSTALL)/$(BASEDIR)/lib \
321 $(INSTALL)/$(BASEDIR) \
322 $(INSTALL)/$(BASEDIR)/bin \
323 $(INSTALL)/$(BASEDIR)/cgi-bin \
324 $(INSTALL)/$(BASEDIR)/conf \
325 $(INSTALL)/$(BASEDIR)/error \
326 $(INSTALL)/$(BASEDIR)/htdocs \
327 $(INSTALL)/$(BASEDIR)/icons \
328 $(INSTALL)/$(BASEDIR)/logs \
329 $(INSTALL)/$(BASEDIR)/man \
330 $(INSTALL)/$(BASEDIR)/manual \
331 $(INSTALL)/$(BASEDIR)/modules \
337 SRC = $(subst \,/,$(AP_WORK))
338 APBUILD = $(SRC)/build
339 STDMOD = $(SRC)/modules
340 HTTPD = $(SRC)/modules/http
341 NWOS = $(SRC)/os/netware
342 SERVER = $(SRC)/server
343 SUPMOD = $(SRC)/support
345 APRUTIL = $(APU_WORK)
346 APULDAP = $(APU_WORK)/ldap
347 XML = $(APU_WORK)/xml
348 APRTEST = $(APR_WORK)/test
350 PREBUILD_INST = $(SRC)/nwprebuild
356 APRLIB = $(APR)/$(OBJDIR)/aprlib.lib
357 APRUTLIB = $(APRUTIL)/$(OBJDIR)/aprutil.lib
358 APULDAPLIB = $(APULDAP)/$(OBJDIR)/apuldap.lib
359 STMODLIB = $(STDMOD)/$(OBJDIR)/stdmod.lib
360 PCRELIB = $(SRC)/$(OBJDIR)/pcre.lib
361 NWOSLIB = $(NWOS)/$(OBJDIR)/netware.lib
362 SERVLIB = $(SERVER)/$(OBJDIR)/server.lib
363 HTTPDLIB = $(HTTPD)/$(OBJDIR)/httpd.lib
364 XMLLIB = $(XML)/$(OBJDIR)/xmllib.lib
367 # Additional general defines
370 EnvironmentDefined = 1
371 endif # ifndef EnvironmentDefined
373 # This is always set so that it will show up in lower directories