# Setup needed Tools and Libraries
#
-ifeq "$(wildcard $(AP_WORK)\NWGNUcustom.ini)" "$(AP_WORK)\NWGNUcustom.ini"
-include $(AP_WORK)\NWGNUcustom.ini
-CUSTOM_INI = $(AP_WORK)\NWGNUcustom.ini
+ifeq "$(wildcard $(AP_WORK)/NWGNUcustom.ini)" "$(AP_WORK)/NWGNUcustom.ini"
+include $(AP_WORK)/NWGNUcustom.ini
+CUSTOM_INI = $(AP_WORK)/NWGNUcustom.ini
endif
ifndef VERBOSE
$(error LDAPSDK does not point to a valid Novell CLDAP SDK)
endif
+ifdef WITH_HTTP2
+ifneq "$(wildcard $(NGH2SRC)/lib/nghttp2_hd.h)" "$(NGH2SRC)/lib/nghttp2_hd.h"
+$(error NGH2SRC does not point to a valid NGHTTP2 source tree)
+endif
+endif
+
ifndef PCRESRC
-ifeq "$(wildcard $(AP_WORK)/srclib/pcre/pcre.in)" "$(AP_WORK)/srclib/pcre/pcre.in"
PCRESRC = $(AP_WORK)/srclib/pcre
endif
-endif
-ifneq "$(wildcard $(PCRESRC)/pcre.in)" "$(PCRESRC)/pcre.in"
+ifneq "$(wildcard $(PCRESRC)/pcre-config.in)" "$(PCRESRC)/pcre-config.in"
$(error PCRESRC does not point to a valid PCRE source tree)
endif
# endif
ifndef METROWERKS
-METROWERKS = C:\Program Files\Metrowerks\CodeWarrior
+METROWERKS = $(ProgramFiles)\Metrowerks\CodeWarrior
endif
# If LM_LICENSE_FILE isn't defined, define a variable that can be used to
OBJDIR = obj_$(RELEASE)
+# Define minimum APR version to check for
+APR_WANTED = 1004000
+
#
# Setup compiler information
#
# Setup build tools
AWK = awk
-# Define minimum APR version to check for
-APR_WANTED = 1004000
+# Setup distribution tools
+ZIP = zip -qr9
+7ZA = 7za >NUL a
+
+#
+# Declare Command and tool macros here
+#
+
+ifeq ($(findstring /sh,$(SHELL)),/sh)
+DEL = rm -f $1
+RMDIR = rm -fr $1
+MKDIR = mkdir -p $1
+COPY = -cp -afv $1 $2
+#COPYR = -cp -afr $1/* $2
+COPYR = -rsync -aC $1/* $2
+TOUCH = -touch $1
+ECHONL = echo ""
+DL = '
+CAT = cat
+else
+ifeq "$(OS)" "Windows_NT"
+DEL = $(shell if exist $(subst /,\,$1) del /q /f 2>NUL $(subst /,\,$1))
+RMDIR = $(shell if exist $(subst /,\,$1)\NUL rd /q /s 2>NUL $(subst /,\,$1))
+else
+DEL = $(shell if exist $(subst /,\,$1) del 2>NUL $(subst /,\,$1))
+RMDIR = $(shell if exist $(subst /,\,$1)\NUL deltree /y 2>NUL $(subst /,\,$1))
+endif
+ECHONL = $(ComSpec) /c echo.
+MKDIR = $(shell if not exist $(subst /,\,$1)\NUL md 2>NUL $(subst /,\,$1))
+COPY = -copy /y 2>NUL $(subst /,\,$1) $(subst /,\,$2)
+COPYR = -xcopy /q /y /e 2>NUL $(subst /,\,$1) $(subst /,\,$2)
+TOUCH = -copy /b 2>&1>NUL $(subst /,\,$1) +,,
+CAT = type
+endif
ifdef IPV6
ifndef USE_STDSOCKETS
endif
endif
-NOVI = $(NOVELLLIBC)\imports
+NOVI = $(NOVELLLIBC)/imports
+PRELUDE = $(NOVI)/libcpre.o
-INCDIRS = $(NOVELLLIBC)\include;$(NOVELLLIBC)\include\nks;$(NOVELLLIBC)\include\winsock;
+INCDIRS = $(NOVELLLIBC)/include;
+ifndef USE_STDSOCKETS
+INCDIRS += $(NOVELLLIBC)/include/winsock;
+endif
ifneq "$(LDAPSDK)" ""
-INCDIRS := $(INCDIRS);$(LDAPSDK)/inc
+INCDIRS += $(LDAPSDK)/inc;
endif
ifneq "$(ZLIBSDK)" ""
-INCDIRS := $(INCDIRS);$(ZLIBSDK)
+INCDIRS += $(ZLIBSDK);
endif
ifneq "$(PCRESRC)" ""
-INCDIRS := $(INCDIRS);$(PCRESRC)
+INCDIRS += $(PCRESRC);
endif
DEFINES = -DNETWARE
endif
# MetroWerks static Libraries
-CLIB3S = $(METROWERKS)\Novell Support\Metrowerks Support\Libraries\Runtime\mwcrtl.lib
+CLIB3S = $(METROWERKS)/Novell Support/Metrowerks Support/Libraries/Runtime/mwcrtl.lib
MATH3S =
-PLIB3S = $(METROWERKS)\Novell Support\Metrowerks Support\Libraries\MSL C++\MWCPP.lib
+PLIB3S = $(METROWERKS)/Novell Support/Metrowerks Support/Libraries/MSL C++/MWCPP.lib
-# MetroWerks Win32 build flags to create build tool
-MWCW_MSL = "$(METROWERKS)/MSL"
-MWCW_W32 = "$(METROWERKS)/Win32-x86 Support"
-WIN_CFLAGS = -O2 -gccinc -nodefaults -proc 586 -w off
-WIN_CFLAGS += -ir $(MWCW_MSL) -ir $(MWCW_W32) -lr $(MWCW_MSL) -lr $(MWCW_W32)
-WIN_CFLAGS += -lMSL_All_x86.lib -lkernel32.lib -luser32.lib
+ifeq "$(OS)" "Windows_NT"
+# MetroWerks Win32 build flags to create build tools
+MWCW_MSL = "$(METROWERKS)/MSL"
+MWCW_W32 = "$(METROWERKS)/Win32-x86 Support"
+CC_FOR_BUILD = $(WIN_CC)
+CFLAGS_FOR_BUILD = -O2 -gccinc -nodefaults -proc 586 -w off
+CFLAGS_FOR_BUILD += -ir $(MWCW_MSL) -ir $(MWCW_W32) -lr $(MWCW_MSL) -lr $(MWCW_W32)
+CFLAGS_FOR_BUILD += -lMSL_All_x86.lib -lkernel32.lib -luser32.lib
+else
+# GNUC build flags to create build tools
+CC_FOR_BUILD = gcc
+CFLAGS_FOR_BUILD = -Wall -O2
+endif
# Base compile flags
# and prefix or precompiled header added here.
# The default flags are as follows:
#
# -c compile only, no link
-# -nosyspath treat #include <...> like #include "..."
+# -gccinc search directory of referencing file first for #includes
# -Cpp_exceptions off disable C++ exceptions
# -RTTI off disable C++ run-time typing information
# -align 4 align on 4 byte bounderies
# -proc PII generate code base on Pentium II instruction set
# -inst mmx use MMX extensions (Not used)
-CFLAGS = -c -nosyspath -Cpp_exceptions off -RTTI off -align 4 -w nocmdline -proc PII
+CFLAGS += -c -w nocmdline -gccinc -Cpp_exceptions off -RTTI off -align 4 -proc PII
+
+ifdef CC_MAX_ERRORS
+CFLAGS += -maxerrors $(CC_MAX_ERRORS)
+else
+CFLAGS += -maxerrors 1
+endif
+
+ifeq "$(REQUIRE_PROTOTYPES)" "1"
+CFLAGS += -r
+endif
# -g generate debugging information
# -O0 level 0 optimizations
-
ifeq "$(RELEASE)" "debug"
CFLAGS += -g -O0
endif
endif
# -prefix pre_nw.h #include pre_nw.h for all files
-
CFLAGS += -prefix pre_nw.h
+ifneq ($(findstring /sh,$(SHELL)),/sh)
PATH:=$(PATH);$(METROWERKS)\bin;$(METROWERKS)\Other Metrowerks Tools\Command Line Tools
+endif
#
# Declare major project deliverables output directories here
#
+ifndef PORT
+PORT = 80
+endif
+
+ifndef SSLPORT
+SSLPORT = 443
+endif
+
ifdef DEST
-INSTALL = $(DEST)
-ifeq (\, $(findstring \,$(INSTALL)))
-INSTDIRS = $(DEST)
+INSTALL = $(subst \,/,$(DEST))
+ifeq (/, $(findstring /,$(INSTALL)))
+INSTDIRS = $(INSTALL)
endif
endif
ifdef dest
-INSTALL = $(dest)
-ifeq (\, $(findstring \,$(INSTALL)))
-INSTDIRS = $(dest)
+INSTALL = $(subst \,/,$(dest))
+ifeq (/, $(findstring /,$(INSTALL)))
+INSTDIRS = $(INSTALL)
endif
endif
ifndef INSTALL
-INSTALL = $(AP_WORK)\Dist
-INSTDIRS = $(AP_WORK)\Dist
+INSTALL = $(AP_WORK)/Dist
+INSTDIRS = $(INSTALL)
endif
+ifeq ($(MAKECMDGOALS),installdev)
ifndef BASEDIR
-BASEDIR = Apache23
-export BASEDIR
+export BASEDIR = apache_$(VERSION_STR)-sdk
endif
-
-ifndef PORT
-PORT = 80
+else
+ifndef BASEDIR
+export BASEDIR = Apache$(VERSION_MAJMIN)
endif
-
-ifndef SSLPORT
-SSLPORT = 443
endif
# Add support for building IPV6 alongside
ifneq "$(IPV6)" ""
DEFINES += -DNW_BUILD_IPV6
-# INCDIRS := $(NOVELLLIBC)\include\winsock\IPV6;$(INCDIRS)
+# INCDIRS := $(NOVELLLIBC)/include/winsock/IPV6;$(INCDIRS)
ifneq "$(findstring IPV6,$(OBJDIR))" "IPV6"
OBJDIR := $(OBJDIR)_IPV6
endif
-INSTDEVDIRS := \
- $(INSTDIRS) \
- $(INSTALL)\$(BASEDIR)\include \
- $(INSTALL)\$(BASEDIR)\lib \
-
-INSTDIRS += \
- $(INSTALL)\$(BASEDIR) \
- $(INSTALL)\$(BASEDIR)\bin \
- $(INSTALL)\$(BASEDIR)\cgi-bin \
- $(INSTALL)\$(BASEDIR)\conf \
- $(INSTALL)\$(BASEDIR)\error \
- $(INSTALL)\$(BASEDIR)\htdocs \
- $(INSTALL)\$(BASEDIR)\icons \
- $(INSTALL)\$(BASEDIR)\logs \
- $(INSTALL)\$(BASEDIR)\man \
- $(INSTALL)\$(BASEDIR)\manual \
- $(INSTALL)\$(BASEDIR)\modules \
-
-#
-# Declare Command and tool macros here
-#
-
-# Os2LibPath is an extra check to see if we are on NT
-ifdef Os2LibPath
-OS = Windows_NT
-endif
-
-ifeq "$(OS)" "Windows_NT"
-CMD = cmd /C
-DEL = del /F
-DELTREE = rd /s/q
-WINNT = 1
-XCOPYSW = /E
-else
-CMD = command /C
-DEL = del
-DELTREE = deltree /y
-XCOPYSW = /E /Y
-endif
-
-CHK = $(CMD) if exist
-CHKNOT = $(CMD) if not exist
+INSTALLBASE = $(INSTALL)/$(BASEDIR)
+INSTDEVDIRS = \
+ $(INSTALL) \
+ $(INSTALLBASE) \
+ $(INSTALLBASE)/build \
+ $(INSTALLBASE)/include \
+ $(INSTALLBASE)/lib \
+ $(EOLIST)
-#
-# Setup base C compiler flags
-#
+INSTDIRS += \
+ $(INSTALLBASE) \
+ $(INSTALLBASE)/bin \
+ $(INSTALLBASE)/cgi-bin \
+ $(INSTALLBASE)/conf \
+ $(INSTALLBASE)/conf/extra \
+ $(INSTALLBASE)/error \
+ $(INSTALLBASE)/htdocs \
+ $(INSTALLBASE)/icons \
+ $(INSTALLBASE)/logs \
+ $(INSTALLBASE)/man \
+ $(INSTALLBASE)/manual \
+ $(INSTALLBASE)/modules \
+ $(EOLIST)
#
# Common directories
#
-STDMOD = $(AP_WORK)/modules
-NWOS = $(AP_WORK)/os/netware
-SERVER = $(AP_WORK)/server
-SRC = $(AP_WORK)
-APR = $(APR_WORK)
-APRUTIL = $(APU_WORK)
-APULDAP = $(APU_WORK)/ldap
-SUPMOD = $(AP_WORK)/support
+SRC = $(subst \,/,$(AP_WORK))
+APR = $(subst \,/,$(APR_WORK))
+APRUTIL = $(subst \,/,$(APU_WORK))
+APBUILD = $(SRC)/build
+STDMOD = $(SRC)/modules
+HTTPD = $(SRC)/modules/http
+DAV = $(SRC)/modules/dav
+NWOS = $(SRC)/os/netware
+SERVER = $(SRC)/server
+SUPMOD = $(SRC)/support
+APULDAP = $(APRUTIL)/ldap
+XML = $(APRUTIL)/xml
+APRTEST = $(APR)/test
PCRE = $(PCRESRC)
-APRTEST = $(APR_WORK)/test
-HTTPD = $(AP_WORK)/modules/http
-XML = $(APU_WORK)/xml
-PREBUILD_INST = $(AP_WORK)\nwprebuild
+
+PREBUILD_INST = $(SRC)/nwprebuild
#
# Internal Libraries
APRUTLIB = $(APRUTIL)/$(OBJDIR)/aprutil.lib
APULDAPLIB = $(APULDAP)/$(OBJDIR)/apuldap.lib
STMODLIB = $(STDMOD)/$(OBJDIR)/stdmod.lib
-PCRELIB = $(PCRE)/$(OBJDIR)/pcre.lib
+PCRELIB = $(SRC)/$(OBJDIR)/pcre.lib
NWOSLIB = $(NWOS)/$(OBJDIR)/netware.lib
SERVLIB = $(SERVER)/$(OBJDIR)/server.lib
HTTPDLIB = $(HTTPD)/$(OBJDIR)/httpd.lib