changeset 108:aa6478748245

added makefile diagnostics
author thomask
date Sat, 06 Nov 2004 00:29:33 +0000
parents 23f362b08087
children 0e5c059a7658
files Makefile makefile_porting.txt
diffstat 2 files changed, 51 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/Makefile	Thu Nov 04 13:49:58 2004 +0000
+++ b/Makefile	Sat Nov 06 00:29:33 2004 +0000
@@ -215,6 +215,34 @@
 	$(analyse_run)
 
 #
+# target should compile, link and run
+# (used for Makefile diagnosis)
+#
+%.diagnose.$(ext_run) : %.$(ext_source) basic_tools
+	# destination: $@
+	# source: $<
+	$(eval z_name = $(subst .diagnose.$(ext_run),,$@))
+	# name: $(z_name)
+	# extract__: $(extract__)
+	# extract__.cmd: $(extract__) $(flag_pattern) < $<
+	$(extract_z_flags)
+	# extract__.result: $(z_flags)
+	# ifeq__: $(ifeq__)
+	# continue if ifeq__ works
+	$(ifeq__) someString someString
+	# return__: $(return__)
+	# dmd: $(DMD)
+	$(eval y_tmp = $(shell $(return__) "$(ifeq__) 1 1"))
+	# return__.return_code_0: $(y_tmp) (expect=0)
+	$(eval y_tmp = $(shell $(return__) "$(DMD) > /dev/null"))
+	# return__.return_code_1: $(y_tmp) (expect=256)
+	# dmd.cmd: $(DMD) $(DFLAGS) $(z_flags) -od$(OBJ_DIR) -of$@ $< $(to_log)
+	$(eval z_return = $(shell $(return__) "$(DMD) $(DFLAGS) $(z_flags) -od$(OBJ_DIR) -of$@ $< $(to_log)"))
+	# dmd.return: $(z_return)
+	# for analyse_run diagnosis: '@if' -> 'if' in 'define analyse_run' (line 185)
+	$(analyse_run)
+	
+#
 # target should compile and link but fail to run
 # 
 norun : Makefile $(sort $(subst .$(ext_source),.$(ext_norun),$(shell $(FIND) norun -regex ".*\\.$(ext_source)" ) ) $(subst .$(ext_source_html),.$(ext_norun),$(shell $(FIND) norun -regex ".*\\.$(ext_source_html)" ) ) )
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/makefile_porting.txt	Sat Nov 06 00:29:33 2004 +0000
@@ -0,0 +1,23 @@
+make run/command_line_debug_01.diagnose.exe
+
+= = = = = stdout = = = = =
+# destination: run/command_line_debug_01.diagnose.exe
+# source: run/command_line_debug_01.d
+# name: run/command_line_debug_01
+# extract__: ./extract__
+# extract__.cmd: ./extract__ __DSTRESS_DFLAGS__ < run/command_line_debug_01.d
+# extract__.result: -debug
+# ifeq__: ./ifeq__
+# continue if ifeq__ works
+./ifeq__ someString someString
+# return__: ./return__
+# dmd: dmd
+# return__.return_code_0: 0 (expect=0)
+# return__.return_code_1: 256 (expect=256)
+# dmd.cmd: dmd  -debug -odobj -ofrun/command_line_debug_01.diagnose.exe run/command_line_debug_01.d >> /tmp/dstress/log.txt 2>&1
+# dmd.return: 0
+# for analyse_run diagnosis: '@if' -> 'if' in 'define analyse_run' (line 185)
+PASS:  run/command_line_debug_01
+ 
+= = = = =  log.txt = = = = =
+gcc obj/command_line_debug_01.o -o run/command_line_debug_01.diagnose.exe -lphobos -lpthread -lm