From: Venkat Raghavan S Date: Tue, 28 May 2002 06:51:10 +0000 (+0000) Subject: Makefiles and batch file required to build Zend and TSRM X-Git-Tag: SAFEGUARD_3_0_BETA1_RC1_26062002~10 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=c223987fa2ebe0fdae56ad182aab5be1631ba049;p=php Makefiles and batch file required to build Zend and TSRM --- diff --git a/netware/build.bat b/netware/build.bat new file mode 100755 index 0000000000..593f50be21 --- /dev/null +++ b/netware/build.bat @@ -0,0 +1,20 @@ +@echo off + +cd ..\%1 + +if "%2" == "clean" make -f ..\netware\%1.mak clean +if "%2" == "/?" goto USAGE + +if "%1" == "zend" call ..\netware\BisonFlexZend + +REM Build command +make -f ..\netware\%1.mak +goto EXIT + +:USAGE + @echo on + @echo Usage: build moduleName [clean] + @echo clean - delete all object files and binaries before building + +:EXIT +cd ..\netware \ No newline at end of file diff --git a/netware/common.mif b/netware/common.mif new file mode 100644 index 0000000000..7c294b6dc2 --- /dev/null +++ b/netware/common.mif @@ -0,0 +1,73 @@ +# +# common include file for PHP build +# include this in every make file +# + +# Set following directories based on your setting + +# Path to CodeWarrior installation +CW_PATH = P:/APPS/SCRIPT/SW/CW71-4 + +# NWSDK directories +ifndef SDK_DIR +SDK_DIR = R:/script/common/libc-internal +endif + +# MPK related directory +ifndef MPK_DIR +MPK_DIR = p:/apps/script/mpk +endif + +#ifndef CLIB_DIR +#CLIB_DIR = p:/apps/ndk0601/nwsdk +#endif + +# Winsock stuff +WINSOCK_DIR = P:/APPS/script/sw/Winsock2 + +# LDAP stuff +LDAP_DIR = P:/APPS/script/sw/cldapsdk + +# Apache directory +ifndef APACHE_DIR +APACHE_DIR = $(PROJECT_ROOT)/netware/apache_1.3.22/src +endif + + +# CW includes, libraries and tools +export MWCIncludes=$(CW_PATH)/include +export MWLibraries=$(CW_PATH)/lib + +# Compiler and linker tools +CC = mwccnlm +LINK = mwldnlm + +# Build type defaults to 'release' +ifndef BUILD +BUILD = release +endif +#BUILD = debug + +OBJ_DIR = $(BUILD) +FINAL_DIR = $(BUILD) +MAP_FILE = $(FINAL_DIR)\$(MODULE_NAME).map + +ifndef STACK_SIZE +STACK_SIZE=65536 +endif + +ifndef COPYRIGHT +#COPYRIGHT = "Copyright (c) 1997-2002 The PHP Group. All Rights Reserved." +COPYRIGHT = "Copyright (c) 1999\, 2000 The PHP Group. All rights reserved." +endif + +# Link flags +LD_FLAGS = -stacksize $(STACK_SIZE) -type generic -zerobss +LD_FLAGS += -o $(BINARY) -map $(MAP_FILE) -nlmversion $(VMAJ),$(VMIN),$(VREV) + +# Module details +LD_FLAGS += -desc $(MODULE_DESC) +LD_FLAGS += -copy $(COPYRIGHT) +LD_FLAGS += -screenname Default +LD_FLAGS += -threadname $(MODULE_NAME)__p + diff --git a/netware/tsrm.mak b/netware/tsrm.mak new file mode 100644 index 0000000000..da7a1dd447 --- /dev/null +++ b/netware/tsrm.mak @@ -0,0 +1,124 @@ +# Temporarily here -- later may go into some batch file +# which will set this as an environment variable +PROJECT_ROOT = .. + +# Module details +MODULE_NAME = TSRM + +#MODULE_ROOT = $(PROJECT_ROOT)\\$(MODULE_NAME) + +#include the common settings +include $(PROJECT_ROOT)/netware/common.mif + +# Extensions of all input and output files +.SUFFIXES: +.SUFFIXES: .nlm .lib .obj .cpp .c .msg .mlc .mdb .xdc .d + +# Source files +CPP_SRC = +C_SRC = TSRM.c \ + tsrm_strtok_r.c \ + tsrm_virtual_cwd.c \ + tsrm_nw.c + +# Destination directories and files +OBJ_DIR = $(BUILD) +FINAL_DIR = $(BUILD) +OBJECTS = $(addprefix $(OBJ_DIR)/,$(CPP_SRC:.cpp=.obj) $(C_SRC:.c=.obj)) +DEPDS = $(addprefix $(OBJ_DIR)/,$(CPP_SRC:.cpp=.d) $(C_SRC:.c=.d)) + +# Binary file +ifndef BINARY + BINARY=$(FINAL_DIR)\$(MODULE_NAME).lib +endif + +# Compile flags +#C_FLAGS = -c -maxerrors 25 -processor Pentium -align packed +#C_FLAGS += -w on -cpp_exceptions on -wchar_t off -bool on +#C_FLAGS += -msgstyle gcc -ext obj -ARM on -msext off -ansi off -nostdinc +C_FLAGS = -c -maxerrors 25 -msgstyle gcc +C_FLAGS += -wchar_t on -bool on +C_FLAGS += -processor Pentium -align 1 +#C_FLAGS += -r +C_FLAGS += -nostdinc +#C_FLAGS += -ext obj +#C_FLAGS += -DNLM_PLATFORM -D__GNUC__ -DTSRM_EXPORTS -D_LIB +C_FLAGS += -DZTS -DNETWARE -DHAVE_DIRENT_H +C_FLAGS += -DNEW_LIBC +#C_FLAGS += -DUSE_PIPE_OPEN +C_FLAGS += -DUSE_MKFIFO +C_FLAGS += -DCLIB_STAT_PATCH -DUSE_MPK +#C_FLAGS += -I. -I- -I../netware -I$(SDK_DIR)/sdk # ../netware added for special SYS/STAT.H : Venkat(6/2/02) +C_FLAGS += -I. -I- -I../netware -I$(SDK_DIR)/include # ../netware added for special SYS/STAT.H : Venkat(6/2/02) +C_FLAGS += -I$(MPK_DIR)/include1 +C_FLAGS += -I$(MWCIncludes) + +# Link flags +LD_FLAGS = -type library +LD_FLAGS += -o $(BINARY) + +# Extra stuff based on debug / release builds +ifeq '$(BUILD)' 'debug' + C_FLAGS += -inline smart -sym on -sym codeview4 -sym internal -opt off -opt intrinsics -DTSRM_DEBUG=1 + LD_FLAGS += -sym codeview4 -sym internal + export MWLibraryFiles=$(SDK_DIR)/imports/libcpre.o;mwcrtld.lib +else + C_FLAGS += -opt speed -inline smart -inline auto -sym off -DTSRM_DEBUG=0 + LD_FLAGS += -sym off + export MWLibraryFiles=$(SDK_DIR)/imports/libcpre.o;mwcrtl.lib +endif + +# Virtual paths +vpath %.cpp . +vpath %.c . +vpath %.obj $(OBJ_DIR) + + +all: prebuild project + +.PHONY: all + +prebuild: + @if not exist $(OBJ_DIR) md $(OBJ_DIR) + +project: $(BINARY) $(MESSAGE) + @echo Build complete. + +$(OBJ_DIR)/%.d: %.c + @echo Building Dependencies for $(