From 273bb7e9c0f8c303f102e763eb672267f23392d6 Mon Sep 17 00:00:00 2001 From: Anatol Belski Date: Mon, 29 Feb 2016 10:58:56 +0100 Subject: [PATCH] fix nmake clean in phpize mode --- win32/build/Makefile.phpize | 2 ++ win32/build/confutils.js | 21 ++++++++++++++++++--- 2 files changed, 20 insertions(+), 3 deletions(-) diff --git a/win32/build/Makefile.phpize b/win32/build/Makefile.phpize index 1f92f7716c..cd74336039 100644 --- a/win32/build/Makefile.phpize +++ b/win32/build/Makefile.phpize @@ -18,11 +18,13 @@ clean-pecl: clean-all: @echo Cleaning standard build dirs + cd $(BUILD_DIR) @for %D in (_x $(BUILD_DIRS_SUB)) do @if exist %D @rd /s /q %D -@del /f /q $(BUILD_DIR)\*.res $(BUILD_DIR)\*.manifest $(BUILD_DIR)\*.lib $(BUILD_DIR)\*.ilk $(BUILD_DIR)\*.pdb $(BUILD_DIR)\*.exp $(PHPDEF) $(BUILD_DIR)\*.rc $(BUILD_DIR)\*.dbg $(BUILD_DIR)\*.bin $(BUILD_DIR)\php*.dll $(BUILD_DIR)\php*.exe > NUL clean: clean-pecl @echo Cleaning distribution build dirs + cd $(BUILD_DIR) @for %D in (_x $(BUILD_DIRS_SUB)) do @if exist %D @del /F /Q %D\*.* > NUL -@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)-Win32.zip $(BUILD_DIR)\pecl-$(PHP_VERSION_STRING)-Win32.zip > NUL diff --git a/win32/build/confutils.js b/win32/build/confutils.js index c8e03a40dd..95f7985c3d 100644 --- a/win32/build/confutils.js +++ b/win32/build/confutils.js @@ -1472,10 +1472,16 @@ function ADD_SOURCES(dir, file_list, target, obj_dir) * is not a problem as buildconf only checks for pecl * as either a child or a sibling */ if (obj_dir == null) { - var build_dir = (dirname ? (dir + "\\" + dirname) : dir).replace(new RegExp("^..\\\\"), ""); + if (MODE_PHPIZE) { + /* In the phpize mode, the subdirs are always relative to BUID_DIR. + No need to differentiate by extension, only one gets built. */ + var build_dir = (dirname ? dirname : "").replace(new RegExp("^..\\\\"), ""); + } else { + var build_dir = (dirname ? (dir + "\\" + dirname) : dir).replace(new RegExp("^..\\\\"), ""); + } } else { - var build_dir = obj_dir.replace(new RegExp("^..\\\\"), ""); + var build_dir = (dirname ? obj_dir + "\\" + dirname : obj_dir).replace(new RegExp("^..\\\\"), ""); } obj = sub_build + build_dir + "\\" + filename.replace(re, ".obj"); @@ -2141,7 +2147,16 @@ function ADD_FLAG(name, flags, target) if (configure_subst.Exists(name)) { var curr_flags = configure_subst.Item(name); - if (curr_flags.indexOf(flags) >= 0) { + /* Prefix with a space, thus making sure the + current flag is not a substring of some + other. It's still not a complete check if + some flags with spaces got added. + + TODO rework to use an array, so direct + match can be done. This will also + help to normalize flags and to not + to insert duplicates. */ + if (curr_flags.indexOf(" " + flags) >= 0) { return; } -- 2.40.0