com php-src: Support run or test target invoked within debugger: win32/build/Makefile

[email protected] (Anatol Belski)
Newsgroups php.cvs
Message-ID <[email protected]>
Commit:    9450e23b3288100c07f2990cd0bce962ca56461b
Author:    Anatol Belski <[email protected]>         Fri, 24 Feb 2017 19:37:16 +0100
Parents:   ff8a6b1232b78abe0ad7de5a44af4be2b8839728
Branches:  PHP-7.0 PHP-7.1 master

Link:       http://git.php.net/?p=php-src.git;a=commitdiff;h=9450e23b3288100c07f2990cd0bce962ca56461b

Log:
Support run or test target invoked within debugger

Useful, as it gets all the environment produced by the makefile. For the
test target, it might make sense to have the child process debug plugin
for VS installed.

Changed paths:
  M  win32/build/Makefile


Diff:
diff --git a/win32/build/Makefile b/win32/build/Makefile
index 3293050..5389358 100644
--- a/win32/build/Makefile
+++ b/win32/build/Makefile
@@ -29,6 +29,14 @@ MCFILE=$(BUILD_DIR)\wsyslog.rc
 BUILD_DIR_DEV_NAME=php-$(PHP_VERSION_STRING)-devel-$(PHP_COMPILER_SHORT)-$(PHP_ARCHITECTURE)
 BUILD_DIR_DEV=$(BUILD_DIR)\$(BUILD_DIR_DEV_NAME)
 
+!if "$(DEBUGGER)" == "1"
+DEBUGGER_CMD=devenv
+DEBUGGER_ARGS=/debugexe
+!else
+DEBUGGER_CMD=
+DEBUGGER_ARGS=
+!endif
+
 all: generated_files $(EXT_TARGETS) $(PECL_TARGETS) $(SAPI_TARGETS)
 
 build_dirs: $(BUILD_DIR) $(BUILD_DIRS_SUB) $(BUILD_DIR_DEV)
@@ -151,18 +159,19 @@ clean-pgo: clean-all
 	-del /f /q $(BUILD_DIR)\pecl-$(PHP_VERSION_STRING)$(PHP_ZTS_ARCHIVE_POSTFIX)-Win32-$(PHP_COMPILER_SHORT)-$(PHP_ARCHITECTURE).zip
 	-del /f /q $(BUILD_DIR)\php-test-pack-$(PHP_VERSION_STRING).zip
 
+
 !if $(PHP_TEST_INI_PATH) == ""
 test: set-tmp-env
-	"$(BUILD_DIR)\php.exe" -d open_basedir= -d output_buffering=0 run-tests.php $(TESTS) -p "$(BUILD_DIR)\php.exe"
+	$(DEBUGGER_CMD) $(DEBUGGER_ARGS) "$(BUILD_DIR)\php.exe" -d open_basedir= -d output_buffering=0 run-tests.php $(TESTS) -p "$(BUILD_DIR)\php.exe"
 
 run: set-tmp-env
-	"$(BUILD_DIR)\php.exe" $(ARGS)
+	$(DEBUGGER_CMD) $(DEBUGGER_ARGS) "$(BUILD_DIR)\php.exe" $(ARGS)
 !else
 test: set-tmp-env
-	"$(BUILD_DIR)\php.exe" -n -c $(PHP_TEST_INI_PATH) -d open_basedir= -d output_buffering=0 -d memory_limit=-1 run-tests.php -p "$(BUILD_DIR)\php.exe" -n -c $(PHP_TEST_INI_PATH) $(TESTS)
+	$(DEBUGGER_CMD) $(DEBUGGER_ARGS) "$(BUILD_DIR)\php.exe" -n -c $(PHP_TEST_INI_PATH) -d open_basedir= -d output_buffering=0 -d memory_limit=-1 run-tests.php -p "$(BUILD_DIR)\php.exe" -n -c $(PHP_TEST_INI_PATH) $(TESTS)
 
 run: set-tmp-env
-	"$(BUILD_DIR)\php.exe" -n -c $(PHP_TEST_INI_PATH) $(ARGS)
+	$(DEBUGGER_CMD) $(DEBUGGER_ARGS) "$(BUILD_DIR)\php.exe" -n -c $(PHP_TEST_INI_PATH) $(ARGS)
 !endif
 
 build-snap: set-tmp-env generated_files
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.