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 ifneq "$(wildcard $(NGH2SRC)/lib/nghttp2_hd.h)" "$(NGH2SRC)/lib/nghttp2_hd.h"
54 $(error NGH2SRC does not point to a valid NGHTTP2 source tree)
59 PCRESRC = $(AP_WORK)/srclib/pcre
61 ifneq "$(wildcard $(PCRESRC)/pcre-config.in)" "$(PCRESRC)/pcre-config.in"
62 $(error PCRESRC does not point to a valid PCRE source tree)
65 # This is a placeholder
67 # ZLIBSDK = C:/novell/ndk/zlibsdk
71 METROWERKS = $(ProgramFiles)\Metrowerks\CodeWarrior
74 # If LM_LICENSE_FILE isn't defined, define a variable that can be used to
75 # restart make with it defined
76 ifndef LM_LICENSE_FILE
77 NO_LICENSE_FILE = NO_LICENSE_FILE
81 # Set the Release type that you want to build, possible values are:
83 # debug - full debug switches are set
84 # noopt - normal switches are set
85 # release - optimization switches are set (default)
123 OBJDIR = obj_$(RELEASE)
125 # Define minimum APR version to check for
129 # Setup compiler information
132 # MetroWerks NLM tools
136 LIB = mwldnlm -type library -w nocmdline
142 # Setup distribution tools
147 # Declare Command and tool macros here
150 ifeq ($(findstring /sh,$(SHELL)),/sh)
154 COPY = -cp -afv $1 $2
155 #COPYR = -cp -afr $1/* $2
156 COPYR = -rsync -aC $1/* $2
162 ifeq "$(OS)" "Windows_NT"
163 DEL = $(shell if exist $(subst /,\,$1) del /q /f 2>NUL $(subst /,\,$1))
164 RMDIR = $(shell if exist $(subst /,\,$1)\NUL rd /q /s 2>NUL $(subst /,\,$1))
166 DEL = $(shell if exist $(subst /,\,$1) del 2>NUL $(subst /,\,$1))
167 RMDIR = $(shell if exist $(subst /,\,$1)\NUL deltree /y 2>NUL $(subst /,\,$1))
169 ECHONL = $(ComSpec) /c echo.
170 MKDIR = $(shell if not exist $(subst /,\,$1)\NUL md 2>NUL $(subst /,\,$1))
171 COPY = -copy /y 2>NUL $(subst /,\,$1) $(subst /,\,$2)
172 COPYR = -xcopy /q /y /e 2>NUL $(subst /,\,$1) $(subst /,\,$2)
173 TOUCH = -copy /b 2>&1>NUL $(subst /,\,$1) +,,
178 ifndef USE_STDSOCKETS
183 NOVI = $(NOVELLLIBC)/imports
184 PRELUDE = $(NOVI)/libcpre.o
186 INCDIRS = $(NOVELLLIBC)/include;
187 ifndef USE_STDSOCKETS
188 INCDIRS += $(NOVELLLIBC)/include/winsock;
190 ifneq "$(LDAPSDK)" ""
191 INCDIRS += $(LDAPSDK)/inc;
193 ifneq "$(ZLIBSDK)" ""
194 INCDIRS += $(ZLIBSDK);
196 ifneq "$(PCRESRC)" ""
197 INCDIRS += $(PCRESRC);
201 ifndef USE_STDSOCKETS
202 DEFINES += -DUSE_WINSOCK
209 VERSION_SKT = (BSDSOCK)
211 VERSION_SKT = (WINSOCK)
214 # MetroWerks static Libraries
215 CLIB3S = $(METROWERKS)/Novell Support/Metrowerks Support/Libraries/Runtime/mwcrtl.lib
217 PLIB3S = $(METROWERKS)/Novell Support/Metrowerks Support/Libraries/MSL C++/MWCPP.lib
219 ifeq "$(OS)" "Windows_NT"
220 # MetroWerks Win32 build flags to create build tools
221 MWCW_MSL = "$(METROWERKS)/MSL"
222 MWCW_W32 = "$(METROWERKS)/Win32-x86 Support"
223 CC_FOR_BUILD = $(WIN_CC)
224 CFLAGS_FOR_BUILD = -O2 -gccinc -nodefaults -proc 586 -w off
225 CFLAGS_FOR_BUILD += -ir $(MWCW_MSL) -ir $(MWCW_W32) -lr $(MWCW_MSL) -lr $(MWCW_W32)
226 CFLAGS_FOR_BUILD += -lMSL_All_x86.lib -lkernel32.lib -luser32.lib
228 # GNUC build flags to create build tools
230 CFLAGS_FOR_BUILD = -Wall -O2
234 # and prefix or precompiled header added here.
236 # The default flags are as follows:
238 # -c compile only, no link
239 # -gccinc search directory of referencing file first for #includes
240 # -Cpp_exceptions off disable C++ exceptions
241 # -RTTI off disable C++ run-time typing information
242 # -align 4 align on 4 byte bounderies
243 # -w nocmdline disable command-line driver/parser warnings
244 # -proc PII generate code base on Pentium II instruction set
245 # -inst mmx use MMX extensions (Not used)
247 CFLAGS += -c -w nocmdline -gccinc -Cpp_exceptions off -RTTI off -align 4 -proc PII
250 CFLAGS += -maxerrors $(CC_MAX_ERRORS)
252 CFLAGS += -maxerrors 1
255 ifeq "$(REQUIRE_PROTOTYPES)" "1"
259 # -g generate debugging information
260 # -O0 level 0 optimizations
261 ifeq "$(RELEASE)" "debug"
265 # -O4,p level 4 optimizations, optimize for speed
266 ifeq "$(RELEASE)" "release"
270 # -prefix pre_nw.h #include pre_nw.h for all files
271 CFLAGS += -prefix pre_nw.h
274 ifneq ($(findstring /sh,$(SHELL)),/sh)
275 PATH:=$(PATH);$(METROWERKS)\bin;$(METROWERKS)\Other Metrowerks Tools\Command Line Tools
279 # Declare major project deliverables output directories here
291 INSTALL = $(subst \,/,$(DEST))
292 ifeq (/, $(findstring /,$(INSTALL)))
293 INSTDIRS = $(INSTALL)
298 INSTALL = $(subst \,/,$(dest))
299 ifeq (/, $(findstring /,$(INSTALL)))
300 INSTDIRS = $(INSTALL)
305 INSTALL = $(AP_WORK)/Dist
306 INSTDIRS = $(INSTALL)
309 ifeq ($(MAKECMDGOALS),installdev)
311 export BASEDIR = apache_$(VERSION_STR)-sdk
315 export BASEDIR = Apache$(VERSION_MAJMIN)
319 # Add support for building IPV6 alongside
321 DEFINES += -DNW_BUILD_IPV6
322 # INCDIRS := $(NOVELLLIBC)/include/winsock/IPV6;$(INCDIRS)
324 ifneq "$(findstring IPV6,$(OBJDIR))" "IPV6"
325 OBJDIR := $(OBJDIR)_IPV6
328 ifneq "$(findstring IPV6,$(INSTALL))" "IPV6"
329 INSTALL := $(INSTALL)_IPV6
332 ifneq "$(findstring IPV6,$(INSTDIRS))" "IPV6"
333 INSTDIRS := $(INSTDIRS)_IPV6
338 INSTALLBASE = $(INSTALL)/$(BASEDIR)
343 $(INSTALLBASE)/build \
344 $(INSTALLBASE)/include \
351 $(INSTALLBASE)/cgi-bin \
352 $(INSTALLBASE)/conf \
353 $(INSTALLBASE)/conf/extra \
354 $(INSTALLBASE)/error \
355 $(INSTALLBASE)/htdocs \
356 $(INSTALLBASE)/icons \
357 $(INSTALLBASE)/logs \
359 $(INSTALLBASE)/manual \
360 $(INSTALLBASE)/modules \
367 SRC = $(subst \,/,$(AP_WORK))
368 APR = $(subst \,/,$(APR_WORK))
369 APRUTIL = $(subst \,/,$(APU_WORK))
370 APBUILD = $(SRC)/build
371 STDMOD = $(SRC)/modules
372 HTTPD = $(SRC)/modules/http
373 DAV = $(SRC)/modules/dav
374 NWOS = $(SRC)/os/netware
375 SERVER = $(SRC)/server
376 SUPMOD = $(SRC)/support
377 APULDAP = $(APRUTIL)/ldap
379 APRTEST = $(APR)/test
382 PREBUILD_INST = $(SRC)/nwprebuild
388 APRLIB = $(APR)/$(OBJDIR)/aprlib.lib
389 APRUTLIB = $(APRUTIL)/$(OBJDIR)/aprutil.lib
390 APULDAPLIB = $(APULDAP)/$(OBJDIR)/apuldap.lib
391 STMODLIB = $(STDMOD)/$(OBJDIR)/stdmod.lib
392 PCRELIB = $(SRC)/$(OBJDIR)/pcre.lib
393 NWOSLIB = $(NWOS)/$(OBJDIR)/netware.lib
394 SERVLIB = $(SERVER)/$(OBJDIR)/server.lib
395 HTTPDLIB = $(HTTPD)/$(OBJDIR)/httpd.lib
396 XMLLIB = $(XML)/$(OBJDIR)/xmllib.lib
399 # Additional general defines
402 EnvironmentDefined = 1
403 endif # ifndef EnvironmentDefined
405 # This is always set so that it will show up in lower directories