# 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
PCRESRC = $(AP_WORK)/srclib/pcre
endif
# Setup build tools
AWK = awk
-SORT = sort
# Setup distribution tools
ZIP = zip -qr9
COPY = -cp -afv $1 $2
#COPYR = -cp -afr $1/* $2
COPYR = -rsync -aC $1/* $2
+TOUCH = -touch $1
ECHONL = echo ""
DL = '
CAT = cat
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
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
ifeq "$(OS)" "Windows_NT"
# MetroWerks Win32 build flags to create build tools
-MWCW_MSL = "$(METROWERKS)/MSL"
-MWCW_W32 = "$(METROWERKS)/Win32-x86 Support"
-HOST_CC = $(WIN_CC)
-HOST_CFLAGS = -O2 -gccinc -nodefaults -proc 586 -w off
-HOST_CFLAGS += -ir $(MWCW_MSL) -ir $(MWCW_W32) -lr $(MWCW_MSL) -lr $(MWCW_W32)
-HOST_CFLAGS += -lMSL_All_x86.lib -lkernel32.lib -luser32.lib
+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
-HOST_CC = gcc
-HOST_CFLAGS = -Wall -O2
+CC_FOR_BUILD = gcc
+CFLAGS_FOR_BUILD = -Wall -O2
endif
# Base compile flags
# 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
# 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
+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
-INSTALLBASE := $(INSTALL)/$(BASEDIR)
+INSTALLBASE = $(INSTALL)/$(BASEDIR)
-INSTDEVDIRS := \
- $(INSTDIRS) \
+INSTDEVDIRS = \
+ $(INSTALL) \
+ $(INSTALLBASE) \
+ $(INSTALLBASE)/build \
$(INSTALLBASE)/include \
$(INSTALLBASE)/lib \
+ $(EOLIST)
INSTDIRS += \
- $(INSTALL)/$(BASEDIR) \
+ $(INSTALLBASE) \
$(INSTALLBASE)/bin \
$(INSTALLBASE)/cgi-bin \
$(INSTALLBASE)/conf \
$(INSTALLBASE)/man \
$(INSTALLBASE)/manual \
$(INSTALLBASE)/modules \
+ $(EOLIST)
#
# Common directories
#
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
-APR = $(APR_WORK)
-APRUTIL = $(APU_WORK)
-APULDAP = $(APU_WORK)/ldap
-XML = $(APU_WORK)/xml
-APRTEST = $(APR_WORK)/test
+APULDAP = $(APRUTIL)/ldap
+XML = $(APRUTIL)/xml
+APRTEST = $(APR)/test
PCRE = $(PCRESRC)
-PREBUILD_INST = $(SRC)/nwprebuild
+
+PREBUILD_INST = $(SRC)/nwprebuild
#
# Internal Libraries