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
137 # Setup distribution tools
142 # Declare Command and tool macros here
145 ifeq ($(findstring /sh,$(SHELL)),/sh)
149 COPY = -cp -afv $1 $2
150 #COPYR = -cp -afr $1/* $2
151 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)
171 ifndef USE_STDSOCKETS
176 NOVI = $(NOVELLLIBC)/imports
177 PRELUDE = $(NOVI)/libcpre.o
179 INCDIRS = $(NOVELLLIBC)/include;
180 ifndef USE_STDSOCKETS
181 INCDIRS += $(NOVELLLIBC)/include/winsock;
183 ifneq "$(LDAPSDK)" ""
184 #INCDIRS := $(INCDIRS);$(LDAPSDK)/inc
185 INCDIRS += $(LDAPSDK)/inc;
187 ifneq "$(ZLIBSDK)" ""
188 #INCDIRS := $(INCDIRS);$(ZLIBSDK)
189 INCDIRS += $(ZLIBSDK);
191 ifneq "$(PCRESRC)" ""
192 #INCDIRS := $(INCDIRS);$(PCRESRC)
193 INCDIRS += $(PCRESRC);
197 ifndef USE_STDSOCKETS
198 DEFINES += -DUSE_WINSOCK
205 VERSION_SKT = (BSDSOCK)
207 VERSION_SKT = (WINSOCK)
210 # MetroWerks static Libraries
211 CLIB3S = $(METROWERKS)/Novell Support/Metrowerks Support/Libraries/Runtime/mwcrtl.lib
213 PLIB3S = $(METROWERKS)/Novell Support/Metrowerks Support/Libraries/MSL C++/MWCPP.lib
215 ifeq "$(OS)" "Windows_NT"
216 # MetroWerks Win32 build flags to create build tools
217 MWCW_MSL = "$(METROWERKS)/MSL"
218 MWCW_W32 = "$(METROWERKS)/Win32-x86 Support"
220 HOST_CFLAGS = -O2 -gccinc -nodefaults -proc 586 -w off
221 HOST_CFLAGS += -ir $(MWCW_MSL) -ir $(MWCW_W32) -lr $(MWCW_MSL) -lr $(MWCW_W32)
222 HOST_CFLAGS += -lMSL_All_x86.lib -lkernel32.lib -luser32.lib
224 # GNUC build flags to create build tools
226 HOST_CFLAGS = -Wall -O2
230 # and prefix or precompiled header added here.
232 # The default flags are as follows:
234 # -c compile only, no link
235 # -nosyspath treat #include <...> like #include "..."
236 # -Cpp_exceptions off disable C++ exceptions
237 # -RTTI off disable C++ run-time typing information
238 # -align 4 align on 4 byte bounderies
239 # -w nocmdline disable command-line driver/parser warnings
240 # -proc PII generate code base on Pentium II instruction set
241 # -inst mmx use MMX extensions (Not used)
243 CFLAGS = -c -nosyspath -Cpp_exceptions off -RTTI off -align 4 -w nocmdline -proc PII
245 ifeq "$(REQUIRE_PROTOTYPES)" "1"
249 # -g generate debugging information
250 # -O0 level 0 optimizations
251 ifeq "$(RELEASE)" "debug"
255 # -O4,p level 4 optimizations, optimize for speed
256 ifeq "$(RELEASE)" "release"
260 # -prefix pre_nw.h #include pre_nw.h for all files
261 CFLAGS += -prefix pre_nw.h
264 ifneq ($(findstring /sh,$(SHELL)),/sh)
265 PATH:=$(PATH);$(METROWERKS)\bin;$(METROWERKS)\Other Metrowerks Tools\Command Line Tools
269 # Declare major project deliverables output directories here
274 ifeq (\, $(findstring \,$(INSTALL)))
281 ifeq (\, $(findstring \,$(INSTALL)))
287 INSTALL = $(AP_WORK)/Dist
288 INSTDIRS = $(AP_WORK)/Dist
304 # Add support for building IPV6 alongside
306 DEFINES += -DNW_BUILD_IPV6
307 # INCDIRS := $(NOVELLLIBC)\include\winsock\IPV6;$(INCDIRS)
309 ifneq "$(findstring IPV6,$(OBJDIR))" "IPV6"
310 OBJDIR := $(OBJDIR)_IPV6
313 ifneq "$(findstring IPV6,$(INSTALL))" "IPV6"
314 INSTALL := $(INSTALL)_IPV6
317 ifneq "$(findstring IPV6,$(INSTDIRS))" "IPV6"
318 INSTDIRS := $(INSTDIRS)_IPV6
323 INSTALLBASE := $(INSTALL)/$(BASEDIR)
327 $(INSTALLBASE)/include \
331 $(INSTALL)/$(BASEDIR) \
333 $(INSTALLBASE)/cgi-bin \
334 $(INSTALLBASE)/conf \
335 $(INSTALLBASE)/conf/extra \
336 $(INSTALLBASE)/error \
337 $(INSTALLBASE)/htdocs \
338 $(INSTALLBASE)/icons \
339 $(INSTALLBASE)/logs \
341 $(INSTALLBASE)/manual \
342 $(INSTALLBASE)/modules \
348 SRC = $(subst \,/,$(AP_WORK))
349 APBUILD = $(SRC)/build
350 STDMOD = $(SRC)/modules
351 HTTPD = $(SRC)/modules/http
352 NWOS = $(SRC)/os/netware
353 SERVER = $(SRC)/server
354 SUPMOD = $(SRC)/support
356 APRUTIL = $(APU_WORK)
357 APULDAP = $(APU_WORK)/ldap
358 XML = $(APU_WORK)/xml
359 APRTEST = $(APR_WORK)/test
361 PREBUILD_INST = $(SRC)/nwprebuild
367 APRLIB = $(APR)/$(OBJDIR)/aprlib.lib
368 APRUTLIB = $(APRUTIL)/$(OBJDIR)/aprutil.lib
369 APULDAPLIB = $(APULDAP)/$(OBJDIR)/apuldap.lib
370 STMODLIB = $(STDMOD)/$(OBJDIR)/stdmod.lib
371 PCRELIB = $(SRC)/$(OBJDIR)/pcre.lib
372 NWOSLIB = $(NWOS)/$(OBJDIR)/netware.lib
373 SERVLIB = $(SERVER)/$(OBJDIR)/server.lib
374 HTTPDLIB = $(HTTPD)/$(OBJDIR)/httpd.lib
375 XMLLIB = $(XML)/$(OBJDIR)/xmllib.lib
378 # Additional general defines
381 EnvironmentDefined = 1
382 endif # ifndef EnvironmentDefined
384 # This is always set so that it will show up in lower directories