[llvm-commits] CVS: llvm/test/Programs/Makefile Makefile.programs

Chris Lattner lattner at cs.uiuc.edu
Mon Aug 18 00:10:03 PDT 2003


Changes in directory llvm/test/Programs:

Makefile updated: 1.20 -> 1.21
Makefile.programs updated: 1.86 -> 1.87

---
Log message:

Move all of the report machinery OUT of Makefile, into Makefile.programs.

This has the following advantages:
  * Makefile is simple, as it should be
  * Makefile.programs is the _only_ place that defines the TEST machinery
  * There are now bugs fixed in it. :)
  * You can generate reports for subdirectories of programs!



---
Diffs of the changes:

Index: llvm/test/Programs/Makefile
diff -u llvm/test/Programs/Makefile:1.20 llvm/test/Programs/Makefile:1.21
--- llvm/test/Programs/Makefile:1.20	Sun Aug 17 23:46:26 2003
+++ llvm/test/Programs/Makefile	Mon Aug 18 00:08:59 2003
@@ -11,44 +11,3 @@
 
 include ${LEVEL}/test/Programs/Makefile.programs
 
-# Include all makefiles which define tests... These makefiles must define
-# test.<testname>.%  given input from Output/%.llvm.bc
-#
-ifdef TEST
-TestMakefile := $(wildcard $(LEVEL)/test/Programs/TEST.$(TEST).Makefile) \
-                $(wildcard $(LEVEL)/projects/*/test/TEST.$(TEST).Makefile)
-TestReport   := $(wildcard $(LEVEL)/test/Programs/TEST.$(TEST).report) \
-                $(wildcard $(LEVEL)/projects/*/test/TEST.$(TEST).report)
-ifneq ($(TestMakefile),)
--include $(TestMakefile)
-endif
-endif
-
-#
-# Rules for building a report from 'make report TEST=<x>'
-#
-
-report.$(TEST).raw.out: $(REPORT_DEPENDENCIES) $(TestMakefile)
-	gmake TEST=$(TEST) 2>&1 | tee $@
-
-ifneq ($(TestReport),)
-report.$(TEST).txt: report.$(TEST).raw.out $(TestReport) ./GenerateReport.pl
-	./GenerateReport.pl $(TestReport) < $< > $@
-
-report.$(TEST).html: report.$(TEST).raw.out $(TestReport) ./GenerateReport.pl
-	./GenerateReport.pl -html $(TestReport) < $< > $@
-
-report.$(TEST).tex: report.$(TEST).raw.out $(TestReport) ./GenerateReport.pl
-	./GenerateReport.pl -latex $(TestReport) < $< > $@
-
-report: report.$(TEST).txt
-	@cat $<
-
-report.html: report.$(TEST).html
-
-report.tex: report.$(TEST).tex
-	@cat $<
-endif
-
-clean::
-	rm -f report.*.raw.out report.*.txt


Index: llvm/test/Programs/Makefile.programs
diff -u llvm/test/Programs/Makefile.programs:1.86 llvm/test/Programs/Makefile.programs:1.87
--- llvm/test/Programs/Makefile.programs:1.86	Sun Aug 17 23:39:29 2003
+++ llvm/test/Programs/Makefile.programs	Mon Aug 18 00:08:59 2003
@@ -399,11 +399,13 @@
 
 # AVAILABLE_TESTS - Compute the set of tests available for user help
 #
-TEST_FILES = $(filter-out %~, $(wildcard $(PROGDIR)/TEST.*.Makefile))
-AVAILABLE_TESTS = $(TEST_FILES:$(PROGDIR)/TEST.%.Makefile=%)
+TEST_FILES = $(wildcard $(PROGDIR)/TEST.*.Makefile) \
+             $(wildcard $(LEVEL)/projects/*/test/TEST.*.Makefile)
+AVAILABLE_TESTS = $(patsubst TEST.%.Makefile,%,$(notdir $(TEST_FILES)))
 
 # If they just say 'make test' then we print out an error telling the user to
 # specify a TEST= option.
+$(PROGRAMS_TO_TEST:%=test..%): \
 test..%:
 	@echo
 	@echo "***************************************************************"
@@ -421,9 +423,12 @@
 ifdef TEST
 TestMakefile := $(wildcard $(LEVEL)/test/Programs/TEST.$(TEST).Makefile) \
                 $(wildcard $(LEVEL)/projects/*/test/TEST.$(TEST).Makefile)
-ifneq ($(TestMakefile),)
+TestReport   := $(wildcard $(LEVEL)/test/Programs/TEST.$(TEST).report) \
+                $(wildcard $(LEVEL)/projects/*/test/TEST.$(TEST).report)
+ifneq ($(strip $(TestMakefile)),)
 -include $(TestMakefile)
 else
+$(PROGRAMS_TO_TEST:%=test.$(TEST).%): \
 test.$(TEST).%:
 	@echo
 	@echo "***************************************************************"
@@ -434,3 +439,33 @@
 	@exit 1
 endif
 endif
+
+#
+# Rules for building a report from 'make report TEST=<x>'
+#
+GENERATEREPORT := $(LEVEL)/test/Programs/GenerateReport.pl
+
+report.$(TEST).raw.out: $(REPORT_DEPENDENCIES) $(TestMakefile)
+	gmake TEST=$(TEST) 2>&1 | tee $@
+
+ifneq ($(TestReport),)
+report.$(TEST).txt: report.$(TEST).raw.out $(TestReport) $(GENERATEREPORT)
+	$(GENERATEREPORT) $(TestReport) < $< > $@
+
+report.$(TEST).html: report.$(TEST).raw.out $(TestReport) $(GENERATEREPORT)
+	$(GENERATEREPORT) -html $(TestReport) < $< > $@
+
+report.$(TEST).tex: report.$(TEST).raw.out $(TestReport) $(GENERATEREPORT)
+	$(GENERATEREPORT)  -latex $(TestReport) < $< > $@
+
+report: report.$(TEST).txt
+	@cat $<
+
+report.html: report.$(TEST).html
+
+report.tex: report.$(TEST).tex
+	@cat $<
+endif
+
+clean::
+	rm -f report.*.raw.out report.*.txt





More information about the llvm-commits mailing list