diff Makefile @ 529:924f45bc62e9

post DMD-0.123 review [1/n]
author thomask
date Thu, 12 May 2005 18:13:21 +0000
parents 3205f4fe859c
children 5ba9ff1b14c7
line wrap: on
line diff
--- a/Makefile	Thu May 12 11:13:04 2005 +0000
+++ b/Makefile	Thu May 12 18:13:21 2005 +0000
@@ -154,12 +154,14 @@
 #
 # target should fail to compile
 #
-nocompile : $(dstress__)
-	rm -f nocompile/*.o nocompile/*.$(ext_nocompile)
-	find nocompile -maxdepth 1 -name "?*.?*" | grep "." | sort --ignore-case | xargs -n 1 echo "$(dstress__) nocompile" > nocompile.sh
+nocompile : $(dstress__) nocompile_clean
+	find nocompile -type f | grep -v ".svn" | sort --ignore-case | xargs -n 1 echo "$(dstress__) nocompile" > nocompile.sh
 	chmod +x nocompile.sh
 	./nocompile.sh 2>> $(LOG)
 
+nocompile_clean :
+	$(eval z_rm = $(shell find nocompile -type f  -name "*\\.o" | grep -v ".svn"))
+
 # used in some complex test cases
 define analyse_nocompile
 	@if $(ifeq__) $(z_return) 0 ; then \
@@ -180,12 +182,14 @@
 #
 # target should compile (excludes linking)
 #
-compile : $(dstress__)
-	rm -f compile/*.o compile/*.$(ext_compile)
-	find compile -maxdepth 1 -name "?*.?*" | grep "." | sort --ignore-case | xargs -n 1 echo "$(dstress__) compile" > compile.sh
+compile : $(dstress__) compile_clean
+	find compile -type f | grep -v ".svn" | sort --ignore-case | xargs -n 1 echo "$(dstress__) compile" > compile.sh
 	chmod +x compile.sh
 	./compile.sh 2>> $(LOG)
 
+compile_clean :
+	$(eval z_rm = $(shell find compile -type f  -name "*\\.o" | grep -v ".svn"))
+
 # used in some complex test cases
 define analyse_compile
 	@if $(ifeq__) $(z_return) 0 ; then \
@@ -202,12 +206,15 @@
 # 
 # target should compile, link and run
 # 
-run : $(dstress__)
-	rm -f run/*.exe run/*.$(ext_run)
-	find run -maxdepth 1 -name "?*.?*" | grep "." | sort --ignore-case | xargs -n 1 echo "$(dstress__) run" > run.sh
+run : $(dstress__) run_clean
+	find run -type f | grep -v ".svn" | sort --ignore-case | xargs -n 1 echo "$(dstress__) run" > run.sh
 	chmod +x run.sh
 	./run.sh 2>> $(LOG)
 
+run_clean :
+	$(eval z_rm = $(shell find run -type f  -name "*\\.exe" | grep -v ".svn"))
+	$(RM) $(z_rm)
+
 # used in some complex testcases
 define analyse_run
 	@if $(ifeq__) $(z_return) 0 ; then \
@@ -267,12 +274,15 @@
 #
 # target should compile and link but fail to run
 # 
-norun : $(dstress__)
-	rm -f norun/*.exe norun/*.$(ext_norun)
-	find norun -maxdepth 1 -name "?*.?*" | grep "." | sort --ignore-case | xargs -n 1 echo "$(dstress__) norun" > norun.sh
+norun : $(dstress__) norun_clean
+	find norun -type f | grep -v ".svn" | sort --ignore-case | xargs -n 1 echo "$(dstress__) norun" > norun.sh
 	chmod +x norun.sh
 	./norun.sh 2>> $(LOG)
 
+norun_clean :
+	$(eval z_rm = $(shell find norun -type f  -name "*\\.exe" | grep -v ".svn"))
+	$(RM) $(z_rm)
+
 # used in some complex test cases
 define analyse_norun
 	@if $(ifeq__) $(z_return) 0; then \
@@ -311,9 +321,8 @@
 #
 # remove targets and all temp objects
 #
-clean : $(sort $(subst $(complex_todo),clean,$(complex_makefiles)))
-	$(RM) $(OBJ_DIR)/?*.?* nocompile/?*.$(ext_log)
-	$(RM) run/?*.$(ext_run) norun/?*.$(ext_norun) compile/?*.$(ext_compile) nocompile/?*.$(ext_nocompile)
+clean : $(sort $(subst $(complex_todo),clean,$(complex_makefiles))) nocompile_clean compile_clean norun_clean run_clean
+	$(RM) $(z_rm) $(OBJ_DIR)/?*\\..*
 	$(RM) run.sh norun.sh compile.sh nocompile.sh
 
 # the empty line above has to remain, otherwise some weired problems can arise