Skip to content

Commit 9ccf3a0

Browse files
committed
fix nmake clean in phpize mode
1 parent b79b036 commit 9ccf3a0

File tree

2 files changed

+20
-3
lines changed

2 files changed

+20
-3
lines changed

win32/build/Makefile.phpize

+2
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,13 @@ clean-pecl:
1818

1919
clean-all:
2020
@echo Cleaning standard build dirs
21+
cd $(BUILD_DIR)
2122
@for %D in (_x $(BUILD_DIRS_SUB)) do @if exist %D @rd /s /q %D
2223
-@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
2324

2425
clean: clean-pecl
2526
@echo Cleaning distribution build dirs
27+
cd $(BUILD_DIR)
2628
@for %D in (_x $(BUILD_DIRS_SUB)) do @if exist %D @del /F /Q %D\*.* > NUL
2729
-@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
2830

win32/build/confutils.js

+18-3
Original file line numberDiff line numberDiff line change
@@ -1472,10 +1472,16 @@ function ADD_SOURCES(dir, file_list, target, obj_dir)
14721472
* is not a problem as buildconf only checks for pecl
14731473
* as either a child or a sibling */
14741474
if (obj_dir == null) {
1475-
var build_dir = (dirname ? (dir + "\\" + dirname) : dir).replace(new RegExp("^..\\\\"), "");
1475+
if (MODE_PHPIZE) {
1476+
/* In the phpize mode, the subdirs are always relative to BUID_DIR.
1477+
No need to differentiate by extension, only one gets built. */
1478+
var build_dir = (dirname ? dirname : "").replace(new RegExp("^..\\\\"), "");
1479+
} else {
1480+
var build_dir = (dirname ? (dir + "\\" + dirname) : dir).replace(new RegExp("^..\\\\"), "");
1481+
}
14761482
}
14771483
else {
1478-
var build_dir = obj_dir.replace(new RegExp("^..\\\\"), "");
1484+
var build_dir = (dirname ? obj_dir + "\\" + dirname : obj_dir).replace(new RegExp("^..\\\\"), "");
14791485
}
14801486

14811487
obj = sub_build + build_dir + "\\" + filename.replace(re, ".obj");
@@ -2141,7 +2147,16 @@ function ADD_FLAG(name, flags, target)
21412147
if (configure_subst.Exists(name)) {
21422148
var curr_flags = configure_subst.Item(name);
21432149

2144-
if (curr_flags.indexOf(flags) >= 0) {
2150+
/* Prefix with a space, thus making sure the
2151+
current flag is not a substring of some
2152+
other. It's still not a complete check if
2153+
some flags with spaces got added.
2154+
2155+
TODO rework to use an array, so direct
2156+
match can be done. This will also
2157+
help to normalize flags and to not
2158+
to insert duplicates. */
2159+
if (curr_flags.indexOf(" " + flags) >= 0) {
21452160
return;
21462161
}
21472162

0 commit comments

Comments
 (0)