--- nsdl/build/Makefile 2002/07/14 06:39:06 1.6 +++ nsdl/build/Makefile 2002/10/13 06:25:16 1.8 @@ -1,7 +1,11 @@ # The NSDL to LON-CAPA Gateway Server # Scott Harrison -# $Id: Makefile,v 1.6 2002/07/14 06:39:06 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 +# type "make tardist" and use the distributable tarball. DISTPROBE=`perl ./distprobe` DIST=$(DISTPROBE) @@ -17,14 +21,29 @@ LAUNCHSAVE=$(OUTSTREAM) $(SAVE) METAMTARGET="" MTARGET="" VERSION=0.1 +DIRTARGET=nsdl help: @echo "*** You need to specify a valid target ***" - @echo "NOTE: You can specify options to your Makefile target." + @echo "To get a list of valid targets: \"make help_TARGETS\"" + @echo "To get a list of valid options: \"make help_OPTIONS\"" + @echo " " + @echo "Typically invoked targets are:" + @echo " make build" + @echo " make install" + @echo " make all" + @echo " make tardist" + @echo " make clean" + +help_OPTIONS: + @echo "You can specify options to your Makefile target." @echo "(option) DIST can be redhat6, redhat7, debian2.2, or default" @echo "(option) CATEGORY can be runtime or development" @echo "(option) SOURCE is an absolute or relative directory path" @echo "(option) TARGET is an absolute or relative directory path" + +help_TARGETS: + @echo "Valid targets" @echo "build: compile the CVS source tree" @echo "install: install from a compiled CVS source tree to a " @echo " specified TARGET destination on the filesystem" @@ -92,9 +111,11 @@ TEST_lpml: 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 @@ -113,7 +134,63 @@ statuspost: @echo "Not yet implemented" tardist: - @echo "Not yet implemented" + @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)/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:]]' | \ + 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 \ @@ -165,4 +242,4 @@ lpmladm: clean: @echo "Not yet implemented" - + rm -f ../java/*.class