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.in)" "$(AP_WORK)/srclib/pcre/pcre.in"
54 PCRESRC = $(AP_WORK)/srclib/pcre
57 ifneq "$(wildcard $(PCRESRC)/pcre.in)" "$(PCRESRC)/pcre.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 (default)
81 # optimized - optimization switches are set
111 ifeq "$(RELEASE)" "debug"
115 ifeq "$(RELEASE)" "noopt"
119 ifeq "$(RELEASE)" "optimized"
124 # Setup compiler information
127 # MetroWerks NLM tools
131 LIB = mwldnlm -type library -w nocmdline
137 # Define minimum APR version to check for
141 ifndef USE_STDSOCKETS
146 NOVI = $(NOVELLLIBC)\imports
148 INCDIRS = $(NOVELLLIBC)\include;$(NOVELLLIBC)\include\nks;$(NOVELLLIBC)\include\winsock;
149 ifneq "$(LDAPSDK)" ""
150 INCDIRS := $(INCDIRS);$(LDAPSDK)/inc
152 ifneq "$(ZLIBSDK)" ""
153 INCDIRS := $(INCDIRS);$(ZLIBSDK)
155 ifneq "$(PCRESRC)" ""
156 INCDIRS := $(INCDIRS);$(PCRESRC)
160 ifndef USE_STDSOCKETS
161 DEFINES += -DUSE_WINSOCK
168 VERSION_SKT = (BSDSOCK)
170 VERSION_SKT = (WINSOCK)
173 # MetroWerks static Libraries
174 CLIB3S = $(METROWERKS)\Novell Support\Metrowerks Support\Libraries\Runtime\mwcrtl.lib
176 PLIB3S = $(METROWERKS)\Novell Support\Metrowerks Support\Libraries\MSL C++\MWCPP.lib
178 # MetroWerks Win32 build flags to create build tool
179 MWCW_MSL = "$(METROWERKS)/MSL"
180 MWCW_W32 = "$(METROWERKS)/Win32-x86 Support"
181 WIN_CFLAGS = -O2 -gccinc -nodefaults -proc 586 -w off
182 WIN_CFLAGS += -ir $(MWCW_MSL) -ir $(MWCW_W32) -lr $(MWCW_MSL) -lr $(MWCW_W32)
183 WIN_CFLAGS += -lMSL_All_x86.lib -lkernel32.lib -luser32.lib
186 # and prefix or precompiled header added here.
188 # The default flags are as follows:
190 # -c compile only, no link
191 # -nosyspath treat #include <...> like #include "..."
192 # -Cpp_exceptions off disable C++ exceptions
193 # -RTTI off disable C++ run-time typing information
194 # -align 4 align on 4 byte bounderies
195 # -w nocmdline disable command-line driver/parser warnings
196 # -proc PII generate code base on Pentium II instruction set
197 # -inst mmx use MMX extensions (Not used)
199 CFLAGS = -c -nosyspath -Cpp_exceptions off -RTTI off -align 4 -w nocmdline -proc PII
201 # -g generate debugging information
202 # -O0 level 0 optimizations
204 ifeq "$(RELEASE)" "debug"
208 # -O4,p level 4 optimizations, optimize for speed
209 ifeq "$(RELEASE)" "optimized"
213 # -prefix pre_nw.h #include pre_nw.h for all files
215 CFLAGS += -prefix pre_nw.h
218 PATH:=$(PATH);$(METROWERKS)\bin;$(METROWERKS)\Other Metrowerks Tools\Command Line Tools
221 # Declare major project deliverables output directories here
226 ifeq (\, $(findstring \,$(INSTALL)))
233 ifeq (\, $(findstring \,$(INSTALL)))
239 INSTALL = $(AP_WORK)\Dist
240 INSTDIRS = $(AP_WORK)\Dist
256 # Add support for building IPV6 alongside
258 DEFINES += -DNW_BUILD_IPV6
259 # INCDIRS := $(NOVELLLIBC)\include\winsock\IPV6;$(INCDIRS)
261 ifneq "$(findstring IPV6,$(OBJDIR))" "IPV6"
262 OBJDIR := $(OBJDIR)_IPV6
265 ifneq "$(findstring IPV6,$(INSTALL))" "IPV6"
266 INSTALL := $(INSTALL)_IPV6
269 ifneq "$(findstring IPV6,$(INSTDIRS))" "IPV6"
270 INSTDIRS := $(INSTDIRS)_IPV6
277 $(INSTALL)\$(BASEDIR)\include \
278 $(INSTALL)\$(BASEDIR)\lib \
281 $(INSTALL)\$(BASEDIR) \
282 $(INSTALL)\$(BASEDIR)\bin \
283 $(INSTALL)\$(BASEDIR)\cgi-bin \
284 $(INSTALL)\$(BASEDIR)\conf \
285 $(INSTALL)\$(BASEDIR)\error \
286 $(INSTALL)\$(BASEDIR)\htdocs \
287 $(INSTALL)\$(BASEDIR)\icons \
288 $(INSTALL)\$(BASEDIR)\logs \
289 $(INSTALL)\$(BASEDIR)\man \
290 $(INSTALL)\$(BASEDIR)\manual \
291 $(INSTALL)\$(BASEDIR)\modules \
294 # Declare Command and tool macros here
297 # Os2LibPath is an extra check to see if we are on NT
302 ifeq "$(OS)" "Windows_NT"
315 CHK = $(CMD) if exist
316 CHKNOT = $(CMD) if not exist
320 # Setup base C compiler flags
327 STDMOD = $(AP_WORK)/modules
328 NWOS = $(AP_WORK)/os/netware
329 SERVER = $(AP_WORK)/server
332 APRUTIL = $(APU_WORK)
333 APULDAP = $(APU_WORK)/ldap
334 SUPMOD = $(AP_WORK)/support
336 APRTEST = $(APR_WORK)/test
337 HTTPD = $(AP_WORK)/modules/http
338 XML = $(APU_WORK)/xml
339 PREBUILD_INST = $(AP_WORK)\nwprebuild
345 APRLIB = $(APR)/$(OBJDIR)/aprlib.lib
346 APRUTLIB = $(APRUTIL)/$(OBJDIR)/aprutil.lib
347 APULDAPLIB = $(APULDAP)/$(OBJDIR)/apuldap.lib
348 STMODLIB = $(STDMOD)/$(OBJDIR)/stdmod.lib
349 PCRELIB = $(PCRE)/$(OBJDIR)/pcre.lib
350 NWOSLIB = $(NWOS)/$(OBJDIR)/netware.lib
351 SERVLIB = $(SERVER)/$(OBJDIR)/server.lib
352 HTTPDLIB = $(HTTPD)/$(OBJDIR)/httpd.lib
353 XMLLIB = $(XML)/$(OBJDIR)/xmllib.lib
356 # Additional general defines
359 EnvironmentDefined = 1
360 endif # ifndef EnvironmentDefined
362 # This is always set so that it will show up in lower directories