2003-12-03 07:17:04 +08:00
|
|
|
# +----------------------------------------------------------------------+
|
|
|
|
# | PHP Version 5 |
|
|
|
|
# +----------------------------------------------------------------------+
|
2004-01-09 01:33:29 +08:00
|
|
|
# | Copyright (c) 1997-2004 The PHP Group |
|
2003-12-03 07:17:04 +08:00
|
|
|
# +----------------------------------------------------------------------+
|
|
|
|
# | This source file is subject to version 3.0 of the PHP license, |
|
|
|
|
# | that is bundled with this package in the file LICENSE, and is |
|
|
|
|
# | available through the world-wide-web at the following url: |
|
|
|
|
# | http://www.php.net/license/3_0.txt. |
|
|
|
|
# | If you did not receive a copy of the PHP license and are unable to |
|
|
|
|
# | obtain it through the world-wide-web, please send a note to |
|
|
|
|
# | license@php.net so we can mail you a copy immediately. |
|
|
|
|
# +----------------------------------------------------------------------+
|
|
|
|
# | Author: Wez Furlong <wez@thebrainroom.com> |
|
|
|
|
# +----------------------------------------------------------------------+
|
|
|
|
#
|
|
|
|
# $Id$
|
|
|
|
# This is the makefile template for the win32 build
|
|
|
|
|
|
|
|
CC="$(CL)"
|
|
|
|
LD="$(LINK)"
|
2004-08-01 07:59:46 +08:00
|
|
|
MC="$(MC)"
|
2003-12-03 07:17:04 +08:00
|
|
|
|
2004-01-09 21:17:58 +08:00
|
|
|
all: $(BUILD_DIR) $(BUILD_DIRS_SUB) generated_files $(EXT_TARGETS) $(PECL_TARGETS) $(SAPI_TARGETS)
|
2003-12-03 07:17:04 +08:00
|
|
|
|
|
|
|
generated_files: Zend\zend_ini_parser.c \
|
|
|
|
Zend\zend_language_parser.c Zend\zend_ini_scanner.c \
|
|
|
|
Zend\zend_language_scanner.c \
|
2003-12-19 20:50:11 +08:00
|
|
|
ext\standard\parsedate.c \
|
2003-12-03 07:17:04 +08:00
|
|
|
$(PHPDEF)
|
|
|
|
|
2003-12-19 20:50:11 +08:00
|
|
|
$(BUILD_DIR)\$(PHPDLL).def: $(PHP_DLL_DEF_SOURCES)
|
|
|
|
type $(PHP_DLL_DEF_SOURCES) > $(BUILD_DIR)\$(PHPDLL).def
|
2003-12-03 07:17:04 +08:00
|
|
|
|
|
|
|
Zend\zend_ini_parser.c Zend\zend_ini_parser.h: Zend\zend_ini_parser.y
|
2003-12-19 20:50:11 +08:00
|
|
|
$(BISON) --output=Zend/zend_ini_parser.c -v -d -p ini_ Zend/zend_ini_parser.y
|
2003-12-03 07:17:04 +08:00
|
|
|
|
|
|
|
Zend\zend_language_parser.c Zend\zend_language_parser.h: Zend\zend_language_parser.y
|
2003-12-19 20:50:11 +08:00
|
|
|
$(BISON) --output=Zend/zend_language_parser.c -v -d -p zend Zend/zend_language_parser.y
|
2003-12-03 07:17:04 +08:00
|
|
|
|
|
|
|
Zend\zend_ini_scanner.c: Zend\flex.skl Zend\zend_ini_scanner.l
|
2003-12-19 20:50:11 +08:00
|
|
|
$(FLEX) -B -i -SZend/flex.skl -Pini_ -oZend/zend_ini_scanner.c Zend/zend_ini_scanner.l
|
2003-12-03 07:17:04 +08:00
|
|
|
|
|
|
|
Zend\zend_language_scanner.c: Zend\flex.skl Zend\zend_language_scanner.l
|
2003-12-19 20:50:11 +08:00
|
|
|
$(FLEX) -i -SZend/flex.skl -Pzend -oZend/zend_language_scanner.c Zend/zend_language_scanner.l
|
2003-12-03 07:17:04 +08:00
|
|
|
|
2003-12-04 00:51:23 +08:00
|
|
|
ext\standard\parsedate.c ext\standard\parsedate.h: ext\standard\parsedate.y
|
2003-12-19 20:50:11 +08:00
|
|
|
$(BISON) --output=ext/standard/parsedate.c -v -d ext/standard/parsedate.y
|
2003-12-04 00:51:23 +08:00
|
|
|
|
2003-12-04 09:37:52 +08:00
|
|
|
PHPDLL_RES=$(BUILD_DIR)\$(PHPDLL).res
|
2003-12-04 00:51:23 +08:00
|
|
|
|
2004-08-01 07:59:46 +08:00
|
|
|
MCFILE=$(BUILD_DIR)\wsyslog.res
|
|
|
|
|
|
|
|
$(MCFILE): win32\build\wsyslog.mc
|
|
|
|
$(MC) -h win32\ -r $(BUILD_DIR)\ -x $(BUILD_DIR)\ win32\build\wsyslog.mc
|
|
|
|
$(RC) /fo $(MCFILE) $(BUILD_DIR)\wsyslog.rc
|
|
|
|
|
2003-12-04 09:37:52 +08:00
|
|
|
$(PHPDLL_RES): win32\build\template.rc
|
|
|
|
$(RC) /fo $(PHPDLL_RES) /d FILE_DESCRIPTION="\"PHP Script Interpreter\"" \
|
|
|
|
/d FILE_NAME="\"$(PHPDLL)\"" /d PRODUCT_NAME="\"PHP Script Interpreter\"" \
|
2004-08-01 07:59:46 +08:00
|
|
|
win32\build\template.rc
|
2003-12-04 09:37:52 +08:00
|
|
|
|
2004-08-01 07:59:46 +08:00
|
|
|
$(BUILD_DIR)\$(PHPDLL): $(PHPDEF) $(PHP_GLOBAL_OBJS) $(STATIC_EXT_OBJS) $(PHPDLL_RES) $(MCFILE)
|
|
|
|
$(LD) /out:$(BUILD_DIR)\$(PHPDLL) $(PHP_LDFLAGS) $(LDFLAGS) $(STATIC_EXT_LDFLAGS) $(PHP_GLOBAL_OBJS) $(STATIC_EXT_OBJS) $(STATIC_EXT_LIBS) $(LIBS) $(PHPDLL_RES) $(MCFILE)
|
2003-12-03 07:17:04 +08:00
|
|
|
|
|
|
|
$(BUILD_DIR)\$(PHPLIB): $(BUILD_DIR)\$(PHPDLL)
|
|
|
|
|
2003-12-19 20:50:11 +08:00
|
|
|
$(BUILD_DIR) $(BUILD_DIRS_SUB):
|
|
|
|
@echo Recreating build dirs
|
|
|
|
@if not exist $(BUILD_DIR) mkdir $(BUILD_DIR)
|
|
|
|
@for %D in ($(BUILD_DIRS_SUB)) do @if not exist %D @mkdir %D > NUL
|
2003-12-03 07:17:04 +08:00
|
|
|
|
2003-12-05 01:28:08 +08:00
|
|
|
clean-sapi:
|
2003-12-19 20:50:11 +08:00
|
|
|
@echo Cleaning SAPI
|
2004-02-12 20:30:41 +08:00
|
|
|
@for %D in (_x $(EXT_TARGETS)) do @if exist $(BUILD_DIR)\%D @del /F /Q $(BUILD_DIR)\%D > NUL
|
|
|
|
@for %D in (_x $(PECL_TARGETS)) do @if exist $(BUILD_DIR)\%D @del /F /Q $(BUILD_DIR)\%D > NUL
|
|
|
|
@for %D in (_x $(SAPI_TARGETS)) do @if exist $(BUILD_DIR)\%D @del /F /Q $(BUILD_DIR)\%D > NUL
|
|
|
|
-@del /F /Q $(BUILD_DIR)\$(PHPDLL)
|
2003-12-05 01:28:08 +08:00
|
|
|
|
|
|
|
clean: clean-sapi
|
2004-02-12 20:30:41 +08:00
|
|
|
@echo Cleaning build dirs
|
2004-05-19 05:07:01 +08:00
|
|
|
@for %D in (_x $(BUILD_DIRS_SUB)) do @if exist %D @del /F /Q %D\*.* > NUL
|
2004-02-12 20:30:41 +08:00
|
|
|
-@del /F /Q $(BUILD_DIR)\*.res $(BUILD_DIR)\*.lib $(BUILD_DIR)\*.ilk $(BUILD_DIR)\*.pdb $(BUILD_DIR)\*.exp $(PHPDEF) $(BUILD_DIR)\php-$(PHP_VERSION_STRING).zip > NUL
|
2003-12-19 20:50:11 +08:00
|
|
|
-rmdir /s /q $(BUILD_DIR)\php-$(PHP_VERSION_STRING)
|
2003-12-03 07:17:04 +08:00
|
|
|
|
2004-05-25 20:57:45 +08:00
|
|
|
clean-pecl:
|
|
|
|
@echo Cleaning PECL targets only
|
|
|
|
-rmdir /s /q $(BUILD_DIR)\pecl
|
|
|
|
|
2003-12-03 07:17:04 +08:00
|
|
|
test:
|
2003-12-04 02:31:04 +08:00
|
|
|
<<test_suite_uses_lame_env_vars.bat
|
2003-12-07 00:14:03 +08:00
|
|
|
set TEST_PHP_EXECUTABLE=$(BUILD_DIR)\php.exe
|
|
|
|
$(BUILD_DIR)\php.exe -d open_basedir= -d safe_mode=0 -d output_buffering=0 run-tests.php $(TESTS)
|
2003-12-03 07:17:04 +08:00
|
|
|
<<NOKEEP
|
2003-12-07 00:14:03 +08:00
|
|
|
|
2003-12-22 21:13:39 +08:00
|
|
|
build-snap:
|
|
|
|
@$(MAKE) "$(BUILD_DIR)\$(PHPDLL)"
|
2004-02-12 20:30:41 +08:00
|
|
|
-for %T in ($(SAPI_TARGETS)) do $(MAKE) /I /nologo "%T"
|
|
|
|
-for %T in ($(EXT_TARGETS)) do $(MAKE) /I /nologo "%T"
|
|
|
|
-for %T in ($(PECL_TARGETS)) do $(MAKE) /I /nologo "%T"
|
2003-12-22 21:13:39 +08:00
|
|
|
|
2003-12-23 23:33:13 +08:00
|
|
|
build-dist: $(BUILD_DIR)\deplister.exe
|
2003-12-19 20:50:11 +08:00
|
|
|
-rmdir /s /q $(BUILD_DIR)\php-$(PHP_VERSION_STRING)
|
2004-02-13 01:58:52 +08:00
|
|
|
-rmdir /s /q $(BUILD_DIR)\pecl-$(PHP_VERSION_STRING)
|
2003-12-19 20:50:11 +08:00
|
|
|
-del /f /q $(BUILD_DIR)\php-$(PHP_VERSION_STRING).zip
|
2004-01-09 21:17:58 +08:00
|
|
|
$(BUILD_DIR)\php.exe -n win32/build/mkdist.php "$(BUILD_DIR)" "$(PHPDLL)" "$(SAPI_TARGETS)" "$(EXT_TARGETS)" "$(PECL_TARGETS)" "$(SNAPSHOT_TEMPLATE)"
|
2003-12-19 20:50:11 +08:00
|
|
|
cd $(BUILD_DIR)\php-$(PHP_VERSION_STRING)
|
|
|
|
-$(ZIP) -9 -r ..\php-$(PHP_VERSION_STRING).zip .
|
|
|
|
cd ..\..
|
2004-02-13 01:58:52 +08:00
|
|
|
cd $(BUILD_DIR)\pecl-$(PHP_VERSION_STRING)
|
|
|
|
-$(ZIP) -9 -r ..\pecl-$(PHP_VERSION_STRING).zip .
|
2004-01-09 21:17:58 +08:00
|
|
|
cd ..\..
|
2003-12-19 20:50:11 +08:00
|
|
|
|
2003-12-22 21:13:39 +08:00
|
|
|
dist: all build-dist
|
|
|
|
snap: build-snap build-dist
|
|
|
|
|
2003-12-23 23:33:13 +08:00
|
|
|
$(BUILD_DIR)\deplister.exe: win32\build\deplister.c
|
|
|
|
$(CL) /Fo$(BUILD_DIR)\ /Fd$(BUILD_DIR)\ /Fp$(BUILD_DIR)\ /FR$(BUILD_DIR) -o$(BUILD_DIR)\deplister.exe win32\build\deplister.c imagehlp.lib
|
|
|
|
|
2003-12-19 20:50:11 +08:00
|
|
|
msi-installer: dist
|
2004-01-09 21:17:58 +08:00
|
|
|
$(BUILD_DIR)\php.exe ..\php-installer\build-installer.php "$(BUILD_DIR)" "$(PHPDLL)" "$(SAPI_TARGETS)" "$(EXT_TARGETS)" "$(PECL_TARGETS)"
|
2003-12-07 00:14:03 +08:00
|
|
|
|
2004-08-01 07:59:46 +08:00
|
|
|
# need to redirect, since INSTALL is a file in the root...
|
|
|
|
install: really-install
|
|
|
|
|
|
|
|
really-install:
|
2004-02-12 21:01:14 +08:00
|
|
|
@if not exist $(PHP_PREFIX) mkdir $(PHP_PREFIX)
|
2003-12-23 23:33:13 +08:00
|
|
|
@copy $(BUILD_DIR)\*.exe $(PHP_PREFIX) /y >nul
|
|
|
|
@copy $(BUILD_DIR)\*.dll $(PHP_PREFIX) /y >nul
|
2004-08-01 07:59:46 +08:00
|
|
|
$(PHP_PREFIX)\php.exe -n -dextension_dir=$(PHP_PREFIX) win32/build/registersyslog.php $(PHP_PREFIX)\$(PHPDLL)
|
|
|
|
|
|
|
|
|