Diff for /nsdl/build/Makefile between versions 1.3 and 1.8

version 1.3, 2002/05/23 19:58:49 version 1.8, 2002/10/13 06:25:16
Line 3 Line 3
 # Scott Harrison  # Scott Harrison
 # $Id$  # $Id$
   
   # 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`  DISTPROBE=`perl ./distprobe`
 DIST=$(DISTPROBE)  DIST=$(DISTPROBE)
 CATEGORY="development"  CATEGORY="development"
Line 17  LAUNCHSAVE=$(OUTSTREAM) $(SAVE) Line 21  LAUNCHSAVE=$(OUTSTREAM) $(SAVE)
 METAMTARGET=""  METAMTARGET=""
 MTARGET=""  MTARGET=""
 VERSION=0.1  VERSION=0.1
   DIRTARGET=nsdl
   
 help:  help:
  @echo "*** You need to specify a valid target ***"   @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) DIST can be redhat6, redhat7, debian2.2, or default"
  @echo "(option) CATEGORY can be runtime or development"   @echo "(option) CATEGORY can be runtime or development"
  @echo "(option) SOURCE is an absolute or relative directory path"   @echo "(option) SOURCE is an absolute or relative directory path"
  @echo "(option) TARGET 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 "build: compile the CVS source tree"
  @echo "install: install from a compiled CVS source tree to a "   @echo "install: install from a compiled CVS source tree to a "
  @echo "         specified TARGET destination on the filesystem"   @echo "         specified TARGET destination on the filesystem"
  @echo "test: test different parts of the LON-CAPA system (TEST_*)"   @echo "test: test different parts of the LON-CAPA system (TEST_*)"
  @echo "TEST_lpml_scripts: make sure that the system can process "   @echo "TEST_lpml: make sure that the system can process "
  @echo "                   the Linux Packaging Markup Language"   @echo "                   the Linux Packaging Markup Language"
  @echo "TEST_system_dependencies: make sure that all needed system "   @echo "TEST_system_dependencies: make sure that all needed system "
  @echo "                          components are active and present "   @echo "                          components are active and present "
  @echo "                          on the server such as perl modules"   @echo "                          on the server such as perl modules"
  @echo "                          and the MySQL database"   @echo "                          and the MySQL database"
  @echo "TEST_web_layer: mimic various web-based interactions with "   @echo "TEST_weblayer: mimic various web-based interactions with "
  @echo "                respect to the login and various system "   @echo "                respect to the login and various system "
  @echo "                actions on the Gateway server"   @echo "                actions on the Gateway server"
  @echo "HTML: generate an HTML-formatted description of the "   @echo "HTML: generate an HTML-formatted description of the "
Line 54  help: Line 73  help:
  @echo "tardist: build a tarball that will upgrade the software on a "   @echo "tardist: build a tarball that will upgrade the software on a "
  @echo "         system"   @echo "         system"
   
 build:  build: Makefile.build
  @echo "Not yet implemented"   echo -n "" > WARNINGS
    make -f Makefile.build all
    make warningnote
   
   Makefile.build: Makefile alwaysrun
    cat gatewayfiles.lpml | \
    perl lpml_parse.pl build $(CATEGORY) $(DIST) "$(SOURCE)" \
    "$(TARGET)" > Makefile.build
   
   NET_install:
    make TIMESTAMP=`date +"%s"` METAMTARGET="TRANSPORT" \
    MTARGET="install" HOSTNAME="$(HOSTNAME)" lpmladm
    make warningnote
   
 install: Makefile.install  install: Makefile.install
  @echo -n "" > WARNINGS   @echo -n "" > WARNINGS
Line 71  Makefile.install: Makefile alwaysrun Line 102  Makefile.install: Makefile alwaysrun
   
 alwaysrun:  alwaysrun:
   
 test:  test: TEST_lpml TEST_system_dependencies TEST_weblayer
  @echo "Not yet implemented"   @echo "ALL TESTS SUCCESSFUL"
   
 TEST_lpml_scripts:  TEST_lpml:
  @echo "Not yet implemented"   @echo "TESTING LPML INSTALLATION MECHANISM"
    cd lpml_test; perl filecomparetest.pl
   
 TEST_system_dependencies:  TEST_system_dependencies:
  @echo "Not yet implemented"   @echo "TESTING WEB LAYER"
    @echo "not yet implemented"
   
 TEST_web_layer:  TEST_weblayer:
  @echo "Not yet implemented"   @echo "TESTING SYSTEM DEPENDENCIES"
    @echo "not yet implemented"
   
 HTML:  HTML:
  @echo "Not yet implemented"   install -d HTML
    cp $(SOURCE)/doc/gatewayfiles/*.gif HTML
    cat gatewayfiles.lpml | \
    perl lpml_parse.pl html development default "$(SOURCE)" '$(TARGET)' \
    > HTML/index.html
   
 doc:  doc:
  @echo "Not yet implemented"   @echo "Not yet implemented"
Line 96  statuspost: Line 134  statuspost:
  @echo "Not yet implemented"   @echo "Not yet implemented"
   
 tardist:  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:  warningnote:
  @if (test -s WARNINGS); then \   @if (test -s WARNINGS); then \
Line 113  warningnote: Line 207  warningnote:
  echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"; \   echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"; \
  fi   fi
   
   lpmladm:
    @if (test $(METAMTARGET) = "TRANSPORT"); then \
    echo "Transporting to $(HOSTNAME)"; \
    sudo mkdir lpmladm.$(TIMESTAMP); \
    sudo make DIST=$(DIST) CATEGORY=$(CATEGORY) \
    SOURCE="$(SOURCE)" \
    TARGET="lpmladm.$(TIMESTAMP)" \
    NORESTORECONF="$(NORESTORECONF)" "$(MTARGET)"; \
    cd lpmladm.$(TIMESTAMP); \
    sudo tar czf ../tarball$(TIMESTAMP).tar.gz .; \
    cd ..; scp tarball$(TIMESTAMP).tar.gz \
    lpmladm@$(HOSTNAME):~/tarball$(TIMESTAMP).tar.gz; \
    sudo rm -Rf lpmladm.$(TIMESTAMP); \
    sudo rm -f tarball$(TIMESTAMP).tar.gz; \
    ssh lpmladm@$(HOSTNAME) sudo mv tarball$(TIMESTAMP).tar.gz /; \
    ssh lpmladm@$(HOSTNAME) sudo tar -x -z -C / \
    -p --same-owner -f \
    /tarball$(TIMESTAMP).tar.gz; \
    ssh lpmladm@$(HOSTNAME) sudo rm -f \
    /tarball$(TIMESTAMP).tar.gz; \
    elif (test $(METAMTARGET) = "LAUNCH"); then \
    echo "Launching process on $(HOSTNAME)"; \
    LAUNCHSAVE=$(OUTSTREAM) $(SAVE); \
    make DIST=$(DIST) CATEGORY=$(CATEGORY) SOURCE="$(SOURCE)" \
    TARGET="$(TARGET)" NORESTORECONF="$(NORESTORECONF)" \
    LAUNCH="$(LAUNCHSAVE)" "$(MTARGET)"; \
    scp $(SAVE) lpmladm@$(HOSTNAME):$(SAVE); \
    ssh lpmladm@$(HOSTNAME) sudo -u $(LAUNCHUSER) perl $(SAVE); \
    else \
    echo "**** ERROR **** Incorrect METAMTARGET"; \
    fi
   # ssh lpmladm@$(HOSTNAME) sudo rm -f $(SAVE); \
   
 clean:  clean:
  @echo "Not yet implemented"   @echo "Not yet implemented"
    rm -f ../java/*.class

Removed from v.1.3  
changed lines
  Added in v.1.8


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>