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
81 # release - optimization switches are set (default)
119 OBJDIR = obj_$(RELEASE)
122 # Setup compiler information
125 # MetroWerks NLM tools
129 LIB = mwldnlm -type library -w nocmdline
135 # Define minimum APR version to check for
139 ifndef USE_STDSOCKETS
144 NOVI = $(NOVELLLIBC)\imports
146 INCDIRS = $(NOVELLLIBC)\include;$(NOVELLLIBC)\include\nks;$(NOVELLLIBC)\include\winsock;
147 ifneq "$(LDAPSDK)" ""
148 INCDIRS := $(INCDIRS);$(LDAPSDK)/inc
150 ifneq "$(ZLIBSDK)" ""
151 INCDIRS := $(INCDIRS);$(ZLIBSDK)
153 ifneq "$(PCRESRC)" ""
154 INCDIRS := $(INCDIRS);$(PCRESRC)
158 ifndef USE_STDSOCKETS
159 DEFINES += -DUSE_WINSOCK
166 VERSION_SKT = (BSDSOCK)
168 VERSION_SKT = (WINSOCK)
171 # MetroWerks static Libraries
172 CLIB3S = $(METROWERKS)\Novell Support\Metrowerks Support\Libraries\Runtime\mwcrtl.lib
174 PLIB3S = $(METROWERKS)\Novell Support\Metrowerks Support\Libraries\MSL C++\MWCPP.lib
176 # MetroWerks Win32 build flags to create build tool
177 MWCW_MSL = "$(METROWERKS)/MSL"
178 MWCW_W32 = "$(METROWERKS)/Win32-x86 Support"
179 WIN_CFLAGS = -O2 -gccinc -nodefaults -proc 586 -w off
180 WIN_CFLAGS += -ir $(MWCW_MSL) -ir $(MWCW_W32) -lr $(MWCW_MSL) -lr $(MWCW_W32)
181 WIN_CFLAGS += -lMSL_All_x86.lib -lkernel32.lib -luser32.lib
184 # and prefix or precompiled header added here.
186 # The default flags are as follows:
188 # -c compile only, no link
189 # -nosyspath treat #include <...> like #include "..."
190 # -Cpp_exceptions off disable C++ exceptions
191 # -RTTI off disable C++ run-time typing information
192 # -align 4 align on 4 byte bounderies
193 # -w nocmdline disable command-line driver/parser warnings
194 # -proc PII generate code base on Pentium II instruction set
195 # -inst mmx use MMX extensions (Not used)
197 CFLAGS = -c -nosyspath -Cpp_exceptions off -RTTI off -align 4 -w nocmdline -proc PII
199 # -g generate debugging information
200 # -O0 level 0 optimizations
202 ifeq "$(RELEASE)" "debug"
206 # -O4,p level 4 optimizations, optimize for speed
207 ifeq "$(RELEASE)" "release"
211 # -prefix pre_nw.h #include pre_nw.h for all files
213 CFLAGS += -prefix pre_nw.h
216 PATH:=$(PATH);$(METROWERKS)\bin;$(METROWERKS)\Other Metrowerks Tools\Command Line Tools
219 # Declare major project deliverables output directories here
224 ifeq (\, $(findstring \,$(INSTALL)))
231 ifeq (\, $(findstring \,$(INSTALL)))
237 INSTALL = $(AP_WORK)\Dist
238 INSTDIRS = $(AP_WORK)\Dist
254 # Add support for building IPV6 alongside
256 DEFINES += -DNW_BUILD_IPV6
257 # INCDIRS := $(NOVELLLIBC)\include\winsock\IPV6;$(INCDIRS)
259 ifneq "$(findstring IPV6,$(OBJDIR))" "IPV6"
260 OBJDIR := $(OBJDIR)_IPV6
263 ifneq "$(findstring IPV6,$(INSTALL))" "IPV6"
264 INSTALL := $(INSTALL)_IPV6
267 ifneq "$(findstring IPV6,$(INSTDIRS))" "IPV6"
268 INSTDIRS := $(INSTDIRS)_IPV6
275 $(INSTALL)\$(BASEDIR)\include \
276 $(INSTALL)\$(BASEDIR)\lib \
279 $(INSTALL)\$(BASEDIR) \
280 $(INSTALL)\$(BASEDIR)\bin \
281 $(INSTALL)\$(BASEDIR)\cgi-bin \
282 $(INSTALL)\$(BASEDIR)\conf \
283 $(INSTALL)\$(BASEDIR)\error \
284 $(INSTALL)\$(BASEDIR)\htdocs \
285 $(INSTALL)\$(BASEDIR)\icons \
286 $(INSTALL)\$(BASEDIR)\logs \
287 $(INSTALL)\$(BASEDIR)\man \
288 $(INSTALL)\$(BASEDIR)\manual \
289 $(INSTALL)\$(BASEDIR)\modules \
292 # Declare Command and tool macros here
295 # Os2LibPath is an extra check to see if we are on NT
300 ifeq "$(OS)" "Windows_NT"
313 CHK = $(CMD) if exist
314 CHKNOT = $(CMD) if not exist
318 # Setup base C compiler flags
325 STDMOD = $(AP_WORK)/modules
326 NWOS = $(AP_WORK)/os/netware
327 SERVER = $(AP_WORK)/server
330 APRUTIL = $(APU_WORK)
331 APULDAP = $(APU_WORK)/ldap
332 SUPMOD = $(AP_WORK)/support
334 APRTEST = $(APR_WORK)/test
335 HTTPD = $(AP_WORK)/modules/http
336 XML = $(APU_WORK)/xml
337 PREBUILD_INST = $(AP_WORK)/nwprebuild
343 APRLIB = $(APR)/$(OBJDIR)/aprlib.lib
344 APRUTLIB = $(APRUTIL)/$(OBJDIR)/aprutil.lib
345 APULDAPLIB = $(APULDAP)/$(OBJDIR)/apuldap.lib
346 STMODLIB = $(STDMOD)/$(OBJDIR)/stdmod.lib
347 PCRELIB = $(PCRE)/$(OBJDIR)/pcre.lib
348 NWOSLIB = $(NWOS)/$(OBJDIR)/netware.lib
349 SERVLIB = $(SERVER)/$(OBJDIR)/server.lib
350 HTTPDLIB = $(HTTPD)/$(OBJDIR)/httpd.lib
351 XMLLIB = $(XML)/$(OBJDIR)/xmllib.lib
354 # Additional general defines
357 EnvironmentDefined = 1
358 endif # ifndef EnvironmentDefined
360 # This is always set so that it will show up in lower directories