Makefile organization

Just checked in a patch to make the CSS2.1 TS Makefile a little
more organized. There are now targets for e.g. generating the 'dist'
files without rebuilding everything from scratch. I also added some
support for having different rules for "official" (i.e. intended for
www.w3.org's conformance test pages) and non-official builds of the
test suite. The default is non-official. Patch attached.
Index: Makefile
===================================================================
RCS file: /sources/public/CSS/CSS2.1-test-suite/Makefile,v
retrieving revision 1.14
diff -u -r1.14 Makefile
--- Makefile	27 Nov 2007 00:43:24 -0000	1.14
+++ Makefile	11 Apr 2008 20:28:22 -0000
@@ -1,4 +1,9 @@
-all:
+OFFICIAL =
+# Set to true to build for w3.org's official copy
+
+all: stage process generate clean
+
+stage:
 	#
 	# empty staging area
 	#
@@ -15,10 +20,14 @@
 	#
 	rm -rf tests/support/.unused
 	find tests -type d -name CVS | xargs rm -rf
+
+process:
 	#
 	# preprocess tests as necessary
 	#
 	egrep -l '&\w+;' tests/*.xht | xargs perl -pi -e 'use HTML::Entities::Numbered;' -e '$$_ = name2decimal_xml($$_)'
+
+generate:
 	#
 	# empty distribution area
 	#
@@ -35,6 +44,11 @@
 	cp data/index.xht dist/index.xht
 	cp data/index.html dist/index.html
 	cp data/htaccess dist/.htaccess
+ifdef OFFICIAL
+	cp data/LICENSE-W3CD dist/LICENSE-W3CD
+else
+	cp data/LICENSE-BSD dist/LICENSE-BSD
+endif
 	#
 	# generate the tests in all supported formats, along with support files
 	#
@@ -49,10 +63,20 @@
 	find dist/xhtml1print/support -iname '*.png' | xargs rm -rf
 	find dist/xhtml1print -iname '*.xht' -o -iname '*.css' | xargs perl -pi -e 's/\.png/\.jpg/g'
 	#
-	# empty staging area again
-	#
-	rm -rf tests/
-	#
 	# report number of tests now included (XHTML1.1 variants only)
 	#
 	ls dist/xhtml1/*.xht | wc -l
+ifdef OFFICIAL
+	@echo "Built as official copy"
+endif
+
+
+clean:
+	#
+	# empty staging area again
+	#
+	rm -rf tests/
+
+official:
+	# For lazy typists
+	make OFFICIAL=true

Received on Friday, 11 April 2008 20:32:47 UTC