[LON-CAPA-cvs] cvs: nsdl /build Makefile

harris41 lon-capa-cvs@mail.lon-capa.org
Sun, 13 Oct 2002 06:25:16 -0000


harris41		Sun Oct 13 02:25:16 2002 EDT

  Modified files:              
    /nsdl/build	Makefile 
  Log:
  BUG 348 FIXED; a distributable tarball of the NSDL-LONCAPA Gateway Software
  can now be generated with "make tardist"
  
  
Index: nsdl/build/Makefile
diff -u nsdl/build/Makefile:1.7 nsdl/build/Makefile:1.8
--- nsdl/build/Makefile:1.7	Sat Oct 12 12:48:37 2002
+++ nsdl/build/Makefile	Sun Oct 13 02:25:16 2002
@@ -1,7 +1,7 @@
 # The NSDL to LON-CAPA Gateway Server
 
 # Scott Harrison
-# $Id: Makefile,v 1.7 2002/10/12 16:48:37 harris41 Exp $
+# $Id: Makefile,v 1.8 2002/10/13 06:25:16 harris41 Exp $
 
 # Quick usage:
 # Either type "make all" (compiles and installs code onto your system), or
@@ -21,6 +21,7 @@
 METAMTARGET=""
 MTARGET=""
 VERSION=0.1
+DIRTARGET=nsdl
 
 help:
 	@echo "*** You need to specify a valid target ***"
@@ -110,9 +111,11 @@
 
 TEST_system_dependencies:
 	@echo "TESTING WEB LAYER"
+	@echo "not yet implemented"
 
 TEST_weblayer:
 	@echo "TESTING SYSTEM DEPENDENCIES"
+	@echo "not yet implemented"
 
 HTML:
 	install -d HTML
@@ -133,21 +136,61 @@
 tardist:
 	@echo "Not yet fully implemented"
 	make MANIFEST_all
+	make vanillatar
+	@cd $(SOURCE); \
+	if (test -h $(DIRTARGET)); then \
+		echo "$(DIRTARGET) link already defined; assume okay"; \
+	else \
+		ln -s . $(DIRTARGET); \
+	fi
+	cd $(SOURCE); \
+	tar --no-recursion --numeric-owner --files-from MANIFEST \
+	-h -czf $(DIRTARGET).tar.gz 2>tar_WARNINGS || [ "0" == "0" ]
+	cat $(SOURCE)/tar_WARNINGS | \
+	xargs --replace=XXX echo '**** WARNING **** XXX' > WARNINGS
+	rm -f $(SOURCE)/tar_WARNINGS
+	make warningnote
+
+# ------------------------------------ Top-level files such as UPDATE and TEST.
+vanillatar:
+	# --------------------------- Point UPDATE to the internal make process
+	echo '#!/bin/sh' > $(SOURCE)/UPDATE
+	echo 'touch build/WARNINGS' >> $(SOURCE)/UPDATE;
+	echo 'ln -s build/WARNINGS WARNINGS' >> $(SOURCE)/UPDATE;
+	echo 'cd build; make build' >> $(SOURCE)/UPDATE
+	echo 'make install' >> $(SOURCE)/UPDATE
+	echo 'make warningnote' >> $(SOURCE)/UPDATE
+	# ----------------------------- Point TEST to the internal make process
+	echo '#!/bin/sh' > $(SOURCE)/TEST
+	echo 'cd build; make test' >> $(SOURCE)/TEST
+	# ----------------------- vanilla executables must indeed be executable
+	chmod a+rx $(SOURCE)/UPDATE
+	chmod a+rx $(SOURCE)/TEST
 
 MANIFEST_all:
 	rm -f $(SOURCE)/MANIFEST
 	make MANIFEST_lpml
+	make MANIFEST_vanillatar
 
 MANIFEST_lpml:
-#	cat $(SOURCE)/buildfiles.lpml | \
-#	perl lpml_parse.pl MANIFEST development default \
-#	'$(SOURCE)' '$(TARGET)' | grep '[[:alnum:]]' >> $(SOURCE)/MANIFEST
-#	cat $(SOURCE)/testfiles.lpml | \
-#	perl lpml_parse.pl MANIFEST development default \
-#	'$(SOURCE)' '$(TARGET)' | grep '[[:alnum:]]' >> $(SOURCE)/MANIFEST
+	cat $(SOURCE)/build/buildfiles.lpml | \
+	perl lpml_parse.pl MANIFEST development default \
+	'$(SOURCE)' '$(TARGET)' | grep '[[:alnum:]]' | \
+	perl -nle 'print "$(DIRTARGET)/$$_"' >> $(SOURCE)/MANIFEST
+	cat $(SOURCE)/build/testfiles.lpml | \
+	perl lpml_parse.pl MANIFEST development default \
+	'$(SOURCE)' '$(TARGET)' | grep '[[:alnum:]]' | \
+	perl -nle 'print "$(DIRTARGET)/$$_"' >> $(SOURCE)/MANIFEST
 	cat $(SOURCE)/build/gatewayfiles.lpml | \
 	perl lpml_parse.pl MANIFEST development default \
-	'$(SOURCE)' '$(TARGET)' | grep '[[:alnum:]]' >> $(SOURCE)/MANIFEST
+	'$(SOURCE)' '$(TARGET)' | grep '[[:alnum:]]' | \
+	perl -nle 'print "$(DIRTARGET)/$$_"' >> $(SOURCE)/MANIFEST
+
+# ------------ Files for top-level (the vanilla layer that the user first sees)
+MANIFEST_vanillatar:
+	echo '$(DIRTARGET)/README' >> $(SOURCE)/MANIFEST
+	echo '$(DIRTARGET)/UPDATE' >> $(SOURCE)/MANIFEST
+	echo '$(DIRTARGET)/TEST' >> $(SOURCE)/MANIFEST
 
 warningnote:
 	@if (test -s WARNINGS); then \
@@ -199,4 +242,4 @@
 
 clean:
 	@echo "Not yet implemented"
-
+	rm -f ../java/*.class