--- projects/cms/source/reports/php/Makefile 2001/10/10 17:12:15 1.2 +++ projects/cms/source/reports/php/Makefile 2003/02/16 21:46:24 1.7 @@ -1,38 +1,67 @@ -# Makefile for php webreports -# $Id: Makefile,v 1.2 2001/10/10 17:12:15 tdb Exp $ +# Makefile for the php pages +# $Id: Makefile,v 1.7 2003/02/16 21:46:24 tdb Exp $ include Config.inc -# these files will be included in the distribution -FILES = README `ls -d alerts/* | grep -v CVS` `ls -d allalerts/* | grep -v CVS`\ - `ls -d historical/* | grep -v CVS` `ls -d index/* | grep -v CVS`\ - `ls -d latest/* | grep -v CVS` `ls -d public/* | grep -v CVS`\ - `ls -d shared/* | grep -v CVS` `ls -d logins/* | grep -v CVS` +.PHONY : all +all : dist -all: dist +### Code Building -dist: - tar -cvf $(BUILDDIR)/$(TARFILE) $(FILES) - gzip -fv9 $(BUILDDIR)/$(TARFILE) - zip -9 $(BUILDDIR)/$(ZIPFILE) $(FILES) +.PHONY : build +build : + if test ! -d "$(TMPDIR)"; then mkdir -p $(TMPDIR); fi + cp -R $(FILES) $(TMPDIR) + @touch $(MCOMPILECHECK) -cvsbuild: - $(CVS) -d $(CVSROOT) export -r $(REVISION) -d $(CVSBUILDTEMP) $(CVSMODULE) - cd $(CVSBUILDTEMP) && $(MAKE) dist - cp $(CVSBUILDTEMP)/$(BUILDDIR)/$(TARGZFILE) $(BUILDDIR)/$(ARCNAME)-$(REVISION)$(TARGZEXT) - cp $(CVSBUILDTEMP)/$(BUILDDIR)/$(ZIPFILE) $(BUILDDIR)/$(ARCNAME)-$(REVISION)$(ZIPEXT) +### Changelog -clean: - rm -Rf $(BUILDDIR)/$(ZIPFILE) - rm -Rf $(BUILDDIR)/$(TARFILE) - rm -Rf $(BUILDDIR)/$(TARGZFILE) - rm -Rf $(BUILDDIR)/$(ARCNAME)-*$(TAREXT) - rm -Rf $(BUILDDIR)/$(ARCNAME)-*$(TARGZEXT) - rm -Rf $(BUILDDIR)/$(ARCNAME)-*$(ZIPEXT) - rm -Rf $(CVSBUILDTEMP) +.PHONY : changelog +changelog : $(CHANGELOG) -update: - $(CVS) -q -d $(CVSROOT) update +.PHONY : mkchangelog +mkchangelog : + if [ -d $(SOURCEROOT)/CVS ]; then \ + $(CVS2CL) $(CVS2CLFLAGS) > $(CHANGELOG); \ + else \ + echo "Can't generate ChangeLog from non-checked out copy." > $(CHANGELOG); \ + fi -# for compatibility with other scripts -distclean: clean +### Dist Making + +.PHONY : dist +dist : + cd $(BUILD) && $(MAKE) dist dest=$(DISTDEST) + +### Code Cleaning + +.PHONY : clean +clean : + cd $(BUILD) && $(MAKE) clean ver=$(VERSION) + rm -f $(MCOMPILECHECK) + +.PHONY : distclean +distclean : clean + cd $(BUILD) && rm -f $(CLPATH) + rm -f Config.inc + +### Install + +.PHONY : install +install : $(MCOMPILECHECK) $(CHANGELOG) + @echo "-------------------------------------------------------" + @echo "Installing to $(INSTALLPREFIX)" + @echo " copying files to $(INSTALLPREFIX)" + @mkdir -p $(INSTALLPREFIX) + @echo "CVS" > TAR_EXCLUDE_TMP + @echo ".#*" >> TAR_EXCLUDE_TMP + @tar -cf - -X TAR_EXCLUDE_TMP -C $(TMPDIR) `cd $(TMPDIR) && echo *` | ( cd $(INSTALLPREFIX) && tar -xf - ) + @rm -f TAR_EXCLUDE_TMP + @echo " copying text information files to $(INSTALLPREFIX)" + @cp COPYING $(CHANGELOG) $(INSTALLPREFIX) + @echo "Completed install to $(INSTALLPREFIX)" + @echo "-------------------------------------------------------" + +### Global Include + +include $(MKINC)