00001 # 00002 # Setup needed Tools and Libraries 00003 # 00004 00005 ifeq "$(wildcard $(AP_WORK)\NWGNUcustom.ini)" "$(AP_WORK)\NWGNUcustom.ini" 00006 include $(AP_WORK)\NWGNUcustom.ini 00007 CUSTOM_INI = $(AP_WORK)\NWGNUcustom.ini 00008 endif 00009 00010 ifndef VERBOSE 00011 .SILENT: 00012 endif 00013 00014 # 00015 # Treat like an include 00016 # 00017 ifndef EnvironmentDefined 00018 00019 # 00020 # simple macros for parsing makefiles 00021 # 00022 EOLIST:= 00023 EMPTY := 00024 COMMA := , 00025 SPACE := $(EMPTY) $(EMPTY) 00026 00027 # 00028 # Base environment 00029 # 00030 00031 # Try and handle case issues 00032 ifndef NOVELLLIBC 00033 ifdef NovellLibC 00034 NOVELLLIBC = $(NovellLibC) 00035 endif 00036 endif 00037 00038 ifndef NOVELLLIBC 00039 NOVELLLIBC = C:/novell/ndk/libc 00040 endif 00041 00042 # This is a placeholder 00043 # ifndef LDAPSDK 00044 # LDAPSDK = C:/novell/ndk/cldapsdk 00045 # endif 00046 00047 # This is a placeholder 00048 # ifndef ZLIBSDK 00049 # ZLIBSDK = C:/novell/ndk/zlibsdk 00050 # endif 00051 00052 ifndef METROWERKS 00053 METROWERKS = C:\Program Files\Metrowerks\CodeWarrior 00054 endif 00055 00056 # If LM_LICENSE_FILE isn't defined, define a variable that can be used to 00057 # restart make with it defined 00058 ifndef LM_LICENSE_FILE 00059 NO_LICENSE_FILE = NO_LICENSE_FILE 00060 endif 00061 00062 # 00063 # Set the Release type that you want to build, possible values are: 00064 # 00065 # debug - full debug switches are set 00066 # noopt - normal switches are set (default) 00067 # optimized - optimization switches are set 00068 00069 ifdef reltype 00070 RELEASE=$(reltype) 00071 endif 00072 00073 ifdef RELTYPE 00074 RELEASE=$(RELTYPE) 00075 endif 00076 00077 ifdef debug 00078 RELEASE=debug 00079 endif 00080 00081 ifdef DEBUG 00082 RELEASE=debug 00083 endif 00084 00085 ifdef optimized 00086 RELEASE=optimized 00087 endif 00088 00089 ifdef OPTIMIZED 00090 RELEASE=optimized 00091 endif 00092 00093 ifndef RELEASE 00094 RELEASE = optimized 00095 endif 00096 00097 ifeq "$(RELEASE)" "debug" 00098 OBJDIR = Debug.o 00099 endif 00100 00101 ifeq "$(RELEASE)" "noopt" 00102 OBJDIR = Noopt 00103 endif 00104 00105 ifeq "$(RELEASE)" "optimized" 00106 OBJDIR = Release.o 00107 endif 00108 00109 # 00110 # Setup compiler information 00111 # 00112 00113 # MetroWerks NLM tools 00114 CC = mwccnlm 00115 CPP = mwccnlm 00116 LINK = mwldnlm 00117 LIB = mwldnlm -type library -w nocmdline 00118 00119 # Setup build tools 00120 AWK = awk 00121 00122 ifdef IPV6 00123 ifndef USE_STDSOCKETS 00124 USE_STDSOCKETS=1 00125 endif 00126 endif 00127 00128 NOVI = $(NOVELLLIBC)\imports 00129 00130 INCDIRS = $(NOVELLLIBC)\include;$(NOVELLLIBC)\include\nks;$(NOVELLLIBC)\include\winsock; 00131 ifneq "$(LDAPSDK)" "" 00132 INCDIRS := $(INCDIRS);$(LDAPSDK)/inc 00133 endif 00134 ifneq "$(ZLIBSDK)" "" 00135 INCDIRS := $(INCDIRS);$(ZLIBSDK) 00136 endif 00137 00138 DEFINES = -DNETWARE 00139 ifndef USE_STDSOCKETS 00140 DEFINES += -DUSE_WINSOCK 00141 endif 00142 ifndef DEBUG 00143 DEFINES += -DNDEBUG 00144 endif 00145 00146 ifdef USE_STDSOCKETS 00147 VERSION_SKT = (BSDSOCK) 00148 else 00149 VERSION_SKT = (WINSOCK) 00150 endif 00151 00152 # 00153 # MetroWerks static Libraries 00154 00155 CLIB3S = $(METROWERKS)\Novell Support\Metrowerks Support\Libraries\Runtime\mwcrtl.lib 00156 MATH3S = 00157 PLIB3S = $(METROWERKS)\Novell Support\Metrowerks Support\Libraries\MSL C++\MWCPP.lib 00158 00159 # Base compile flags 00160 # and prefix or precompiled header added here. 00161 00162 # The default flags are as follows: 00163 # 00164 # -c compile only, no link 00165 # -nosyspath treat #include <...> like #include "..." 00166 # -Cpp_exceptions off disable C++ exceptions 00167 # -RTTI off disable C++ run-time typing information 00168 # -align 4 align on 4 byte bounderies 00169 # -w nocmdline disable command-line driver/parser warnings 00170 # -proc PII generate code base on Pentium II instruction set 00171 # -inst mmx use MMX extensions (Not used) 00172 00173 CFLAGS = -c -nosyspath -Cpp_exceptions off -RTTI off -align 4 -w nocmdline -proc PII 00174 00175 # -g generate debugging information 00176 # -O0 level 0 optimizations 00177 00178 ifeq "$(RELEASE)" "debug" 00179 CFLAGS += -g -O0 00180 endif 00181 00182 # -O4,p level 4 optimizations, optimize for speed 00183 ifeq "$(RELEASE)" "optimized" 00184 CFLAGS += -O4,p 00185 endif 00186 00187 # -prefix pre_nw.h #include pre_nw.h for all files 00188 00189 CFLAGS += -prefix pre_nw.h 00190 00191 00192 PATH:=$(PATH);$(METROWERKS)\bin;$(METROWERKS)\Other Metrowerks Tools\Command Line Tools 00193 00194 # 00195 # Declare major project deliverables output directories here 00196 # 00197 00198 ifdef DEST 00199 INSTALL = $(DEST) 00200 ifeq (\, $(findstring \,$(INSTALL))) 00201 INSTDIRS = $(DEST) 00202 endif 00203 endif 00204 00205 ifdef dest 00206 INSTALL = $(dest) 00207 ifeq (\, $(findstring \,$(INSTALL))) 00208 INSTDIRS = $(dest) 00209 endif 00210 endif 00211 00212 ifndef INSTALL 00213 INSTALL = $(AP_WORK)\Dist 00214 INSTDIRS = $(AP_WORK)\Dist 00215 endif 00216 00217 ifndef BASEDIR 00218 BASEDIR = Apache22 00219 export BASEDIR 00220 endif 00221 00222 ifndef PORT 00223 PORT = 80 00224 endif 00225 00226 ifndef SSLPORT 00227 SSLPORT = 443 00228 endif 00229 00230 # Add support for building IPV6 alongside 00231 ifneq "$(IPV6)" "" 00232 DEFINES += -DNW_BUILD_IPV6 00233 INCDIRS := $(NOVELLLIBC)\include\winsock\IPV6;$(INCDIRS) 00234 00235 ifneq "$(findstring IPV6,$(OBJDIR))" "IPV6" 00236 OBJDIR := $(OBJDIR)_IPV6 00237 endif 00238 00239 ifneq "$(findstring IPV6,$(INSTALL))" "IPV6" 00240 INSTALL := $(INSTALL)_IPV6 00241 endif 00242 00243 ifneq "$(findstring IPV6,$(INSTDIRS))" "IPV6" 00244 INSTDIRS := $(INSTDIRS)_IPV6 00245 endif 00246 00247 endif 00248 00249 INSTDEVDIRS := \ 00250 $(INSTDIRS) \ 00251 $(INSTALL)\$(BASEDIR)\include \ 00252 $(INSTALL)\$(BASEDIR)\lib \ 00253 00254 INSTDIRS += \ 00255 $(INSTALL)\$(BASEDIR) \ 00256 $(INSTALL)\$(BASEDIR)\bin \ 00257 $(INSTALL)\$(BASEDIR)\cgi-bin \ 00258 $(INSTALL)\$(BASEDIR)\conf \ 00259 $(INSTALL)\$(BASEDIR)\error \ 00260 $(INSTALL)\$(BASEDIR)\htdocs \ 00261 $(INSTALL)\$(BASEDIR)\icons \ 00262 $(INSTALL)\$(BASEDIR)\logs \ 00263 $(INSTALL)\$(BASEDIR)\man \ 00264 $(INSTALL)\$(BASEDIR)\manual \ 00265 $(INSTALL)\$(BASEDIR)\modules \ 00266 00267 # 00268 # Declare Command and tool macros here 00269 # 00270 00271 # Os2LibPath is an extra check to see if we are on NT 00272 ifdef Os2LibPath 00273 OS = Windows_NT 00274 endif 00275 00276 ifeq "$(OS)" "Windows_NT" 00277 CMD = cmd /C 00278 DEL = del /F 00279 DELTREE = rd /s/q 00280 WINNT = 1 00281 XCOPYSW = /E 00282 else 00283 CMD = command /C 00284 DEL = del 00285 DELTREE = deltree /y 00286 XCOPYSW = /E /Y 00287 endif 00288 00289 CHK = $(CMD) if exist 00290 CHKNOT = $(CMD) if not exist 00291 00292 00293 # 00294 # Setup base C compiler flags 00295 # 00296 00297 # 00298 # Common directories 00299 # 00300 00301 STDMOD = $(AP_WORK)/modules 00302 NWOS = $(AP_WORK)/os/netware 00303 SERVER = $(AP_WORK)/server 00304 SRC = $(AP_WORK) 00305 APR = $(APR_WORK) 00306 APRUTIL = $(APU_WORK) 00307 APULDAP = $(APU_WORK)/ldap 00308 SUPMOD = $(AP_WORK)/support 00309 PCRE = $(AP_WORK)/srclib/pcre 00310 APRTEST = $(APR_WORK)/test 00311 HTTPD = $(AP_WORK)/modules/http 00312 XML = $(APU_WORK)/xml 00313 PREBUILD_INST = $(AP_WORK)\nwprebuild 00314 00315 # 00316 # Internal Libraries 00317 # 00318 00319 APRLIB = $(APR)/$(OBJDIR)/aprlib.lib 00320 APRUTLIB = $(APRUTIL)/$(OBJDIR)/aprutil.lib 00321 APULDAPLIB = $(APULDAP)/$(OBJDIR)/apuldap.lib 00322 STMODLIB = $(STDMOD)/$(OBJDIR)/stdmod.lib 00323 PCRELIB = $(PCRE)/$(OBJDIR)/pcre.lib 00324 NWOSLIB = $(NWOS)/$(OBJDIR)/netware.lib 00325 SERVLIB = $(SERVER)/$(OBJDIR)/server.lib 00326 HTTPDLIB = $(HTTPD)/$(OBJDIR)/httpd.lib 00327 XMLLIB = $(XML)/$(OBJDIR)/xmllib.lib 00328 00329 # 00330 # Additional general defines 00331 # 00332 00333 EnvironmentDefined = 1 00334 endif # ifndef EnvironmentDefined 00335 00336 # This is always set so that it will show up in lower directories 00337 00338 ifdef Path 00339 Path = $(PATH) 00340 endif 00341