[GRASS-SVN] r40491 - in grass/trunk: . gui/wxpython/scripts include include/Make

svn_grass at osgeo.org svn_grass at osgeo.org
Sun Jan 17 00:49:22 EST 2010


Author: glynn
Date: 2010-01-17 00:49:21 -0500 (Sun, 17 Jan 2010)
New Revision: 40491

Added:
   grass/trunk/include/Make/Docs.make
   grass/trunk/include/Make/Install.make
Modified:
   grass/trunk/Makefile
   grass/trunk/gui/wxpython/scripts/Makefile
   grass/trunk/include/Make/Grass.make
   grass/trunk/include/Makefile
Log:
Makefile clean-up
 Move installation and doxygen rules to separate *.make files


Modified: grass/trunk/Makefile
===================================================================
--- grass/trunk/Makefile	2010-01-17 04:44:06 UTC (rev 40490)
+++ grass/trunk/Makefile	2010-01-17 05:49:21 UTC (rev 40491)
@@ -19,20 +19,10 @@
 
 MODULE_TOPDIR = .
 
-include $(MODULE_TOPDIR)/include/Make/Vars.make
+include $(MODULE_TOPDIR)/include/Make/Dir.make
 
-# Install directories
-exec_prefix=            ${prefix}
-BINDIR=			${UNIX_BIN}
+DATE := $(shell date '+%d_%m_%Y')
 
-# Shell commands
-MAKE_DIR_CMD=		mkdir -p -m 755
-
-# Extra commands
-HTML2PDF=		htmldoc --footer d.1
-GRASS_PDFDIR=		$(DOCSDIR)/pdf
-
-
 DIRS = \
 	demolocation \
 	tools \
@@ -61,21 +51,8 @@
 SUBDIRS = $(DIRS)
 
 FILES = AUTHORS COPYING CHANGES REQUIREMENTS.html GPL.TXT contributors.csv translators.csv
-FILES_DST = $(patsubst %,${ARCH_DISTDIR}/%,$(FILES))
+FILES_DST = $(patsubst %,$(ARCH_DISTDIR)/%,$(FILES))
 
-# why no locale directory?
-BIN_DIST_FILES = $(FILES) \
-	grass${GRASS_VERSION_MAJOR}${GRASS_VERSION_MINOR}.tmp \
-	bin \
-	docs \
-	driver \
-	etc \
-	fonts \
-	include \
-	lib \
-	man \
-	scripts
-
 default:
 	@echo "GRASS GIS compilation log"     > $(ERRORLOG)
 	@echo "-------------------------"    >> $(ERRORLOG)
@@ -83,12 +60,9 @@
 	@echo "--"                           >> $(ERRORLOG)
 	@echo "Errors in:"                   >> $(ERRORLOG)
 	chmod 755 install-sh
-	@list='$(SUBDIRS)'; \
-	for subdir in $$list; do \
-		$(MAKE) -C $$subdir || echo $(CURDIR)/$$subdir >> $(ERRORLOG) ; \
-	done
+	$(MAKE) subdirs
 	$(MAKE) $(FILES_DST)
-	$(MAKE) ${ARCH_DISTDIR}/grass${GRASS_VERSION_MAJOR}${GRASS_VERSION_MINOR}.tmp
+	$(MAKE) $(ARCH_DISTDIR)/$(GRASS_NAME).tmp
 	@if [ `wc -l < "$(ERRORLOG)"` -gt 5 ] ; then \
 		echo "--"     >> $(ERRORLOG) ; \
 		echo "In case of errors please change into the directory with error and run 'make'." >> $(ERRORLOG) ; \
@@ -103,10 +77,10 @@
 	@cat $(ERRORLOG)
 	@if [ `wc -l < "$(ERRORLOG)"` -gt 8 ] ; then false ; else true ; fi
 
-${ARCH_DISTDIR}/%: %
+$(ARCH_DISTDIR)/%: %
 	$(INSTALL_DATA) $< $@
 
-${ARCH_DISTDIR}/grass${GRASS_VERSION_MAJOR}${GRASS_VERSION_MINOR}.tmp: ${ARCH_BINDIR}/grass${GRASS_VERSION_MAJOR}${GRASS_VERSION_MINOR}
+$(ARCH_DISTDIR)/$(GRASS_NAME).tmp: $(ARCH_BINDIR)/$(GRASS_NAME)
 	$(INSTALL) $< $@
 
 LIBDIRS = \
@@ -121,291 +95,32 @@
 
 # Compile libraries only
 libs:
-	make -C lib/ headers
-	@list='$(LIBDIRS)'; \
-	for subdir in $$list; do \
-		$(MAKE) -C $$subdir; \
-	done
-	-cp -f $(FILES) ${ARCH_DISTDIR}/
-	-cp -fr --parents include ${ARCH_DISTDIR}/
+	$(MAKE) -C include
+	$(MAKE) subdirs SUBDIRS=$(LIBDIRS)
+	$(MAKE) $(FILES_DST)
 
 cleandistdirs: 
-	-rm -rf ${ARCH_DISTDIR}
-	-rm -rf ${ARCH_BINDIR}
+	-rm -rf $(ARCH_DISTDIR)
+	-rm -rf $(ARCH_BINDIR)
 
 # Clean out the strings extracted from scripts for translation
 cleanscriptstrings:
 	rm -f locale/scriptstrings/*.c 2>/dev/null
 
 clean: cleandistdirs cleanscriptstrings
-	@list='$(SUBDIRS)'; \
-	for subdir in $$list; do \
-		$(MAKE) -C $$subdir clean; \
-	done
 
 libsclean: cleandistdirs
-	@list='$(LIBDIRS)'; \
-	for subdir in $$list; do \
-		$(MAKE) -C $$subdir clean; \
-	done
+	$(MAKE) clean-recursive SUBDIRS=$(LIBDIRS)
 
 distclean: clean
-	-rm -f config.cache config.log config.status config.status.${ARCH} 2>/dev/null
+	-rm -f config.cache config.log config.status config.status.$(ARCH) 2>/dev/null
 	-rm -f ChangeLog ChangeLog.bak $(ERRORLOG) grass.pc
 	-rm -f include/config.h include/version.h
 	-rm -f include/Make/Platform.make include/Make/Doxyfile_arch_html include/Make/Doxyfile_arch_latex 2>/dev/null
 	-rm -f swig/perl/Makefile.PL swig/perl2/make.pl 2>/dev/null
 
-strip:
-	@ if [ ! -f ${ARCH_BINDIR}/grass${GRASS_VERSION_MAJOR}${GRASS_VERSION_MINOR} ] ; then \
-		echo "ERROR: GRASS has not been compiled. Try \"make\" first."; \
-		echo "  Strip aborted, exiting Make."; \
-		exit; \
-	fi; \
-	cd ${ARCH_DISTDIR} ; find . -type f -perm +111 -exec strip {} \;
+include $(MODULE_TOPDIR)/include/Make/Install.make
+include $(MODULE_TOPDIR)/include/Make/Docs.make
 
-install:
-	@ # The following action MUST be a single action. That is, all lines
-	@ # except the last line must have a backslash (\) at the end to
-	@ # continue the statement. The reason for this is that Make does not
-	@ # have an exit command thus, exit terminates the shell. However, 
-	@ # Make creates a new shell for each action listed for a target.
-	@ # Therefore, the only way exit will quit Make is if there is only
-	@ # a single action for the target.
-	@ # Check if grass has been compiled, if INST_DIR is writable, and if
-	@ # grass is part of INST_DIR
-	echo ${ARCH_BINDIR}/grass${GRASS_VERSION_MAJOR}${GRASS_VERSION_MINOR}
-	@ if [ ! -f ${ARCH_BINDIR}/grass${GRASS_VERSION_MAJOR}${GRASS_VERSION_MINOR} ] ; then \
-		echo "ERROR: GRASS has not been compiled. Try \"make\" first."; \
-		echo "  Installation aborted, exiting Make."; \
-		exit; \
-	fi; \
-	if [ "${MACOSX_APP}" = "1" ] ; then \
-		${MAKE} install-macosx; \
-		exit; \
-	fi; \
-	INST_PATH=`dirname ${INST_DIR}`; \
-	while [ ! -d $$INST_PATH ]; do \
-		INST_PATH=`dirname $$INST_PATH`; \
-	done; \
-	if [ ! -d "${INST_DIR}" -a ! -w "$$INST_PATH" ] ; then \
-		echo "ERROR: Directory $$INST_PATH is a parent directory of your"; \
-		echo "  install directory ${INST_DIR} and is not writable."; \
-		echo "  Perhaps you need root access."; \
-		echo "  Installation aborted, exiting Make."; \
-		exit; \
-	fi; \
-	if [ -d ${INST_DIR} -a ! -w "${INST_DIR}" ] ; then \
-		echo "ERROR: Your install directory ${INST_DIR} is not writable."; \
-		echo "  Perhaps you need root access."; \
-		echo "  Installation aborted, exiting Make."; \
-		exit; \
-	fi; \
-	result=`echo "${INST_DIR}" | awk '{ if ($$1 ~ /grass/) print $$1 }'`; \
-	if [ "$$result" = "" ] ; then \
-		echo "WARNING: Your install directory ${INST_DIR}"; \
-		echo "  does not contain the word 'grass'."; \
-		echo "  It is highly recommended that the word 'grass' be part"; \
-		echo "  of your install directory to avoid conflicts."; \
-		echo "  Do you want to continue? [y/n]"; \
-		read ans; \
-		ans=`echo "$$ans" | tr A-Z a-z`; \
-		if [ "$$ans" != "y" ] ; then \
-			echo "Installation aborted, exiting Make."; \
-			exit; \
-		fi; \
-	fi; \
-	${MAKE} real-install
-
-real-install:
-	test -d ${INST_DIR} || ${MAKE_DIR_CMD} ${INST_DIR}
-	test -d ${BINDIR} || ${MAKE_DIR_CMD} ${BINDIR}
-	-sed -e "s#^GISBASE.*#GISBASE=${INST_DIR}#" ${ARCH_BINDIR}/grass${GRASS_VERSION_MAJOR}${GRASS_VERSION_MINOR}.sh > ${BINDIR}/grass${GRASS_VERSION_MAJOR}${GRASS_VERSION_MINOR}.sh
-	-sed -e 's#^gisbase = ".*"#gisbase = "${INST_DIR}"#' ${ARCH_BINDIR}/grass${GRASS_VERSION_MAJOR}${GRASS_VERSION_MINOR} > ${BINDIR}/grass${GRASS_VERSION_MAJOR}${GRASS_VERSION_MINOR}
-	-chmod a+x ${BINDIR}/grass${GRASS_VERSION_MAJOR}${GRASS_VERSION_MINOR}
-ifneq ($(strip $(MINGW)),)
-	-sed -e "s#WINGISBASE=.*#WINGISBASE=${INST_DIR}#" ${ARCH_BINDIR}/grass${GRASS_VERSION_MAJOR}${GRASS_VERSION_MINOR}.bat > ${BINDIR}/grass${GRASS_VERSION_MAJOR}${GRASS_VERSION_MINOR}.bat
-	-chmod a+x ${BINDIR}/grass${GRASS_VERSION_MAJOR}${GRASS_VERSION_MINOR}.bat
-endif
-	-tar cBCf ${GISBASE} - . | tar xBCf ${INST_DIR} - 2>/dev/null
-	-sed 's#'${GISBASE}'#'${INST_DIR}'#g' ${GISBASE}/etc/fontcap > ${INST_DIR}/etc/fontcap
-	-${INSTALL} config.status ${INST_DIR}/config.status
-	-chmod -R a+rX ${INST_DIR} 2>/dev/null
-	@#GEM installation
-	-tar cBf - gem/skeleton | tar xBCf ${INST_DIR}/etc - 2>/dev/null
-	-${INSTALL} gem/gem$(GRASS_VERSION_MAJOR)$(GRASS_VERSION_MINOR) ${BINDIR} 2>/dev/null
-	@# enable OSX Help Viewer
-	@if [ "`grep -i '^ARCH.*darwin' < include/Make/Platform.make`" ] ; then /bin/ln -sfh "${INST_DIR}/docs/html" /Library/Documentation/Help/GRASS-${GRASS_VERSION_MAJOR}.${GRASS_VERSION_MINOR} ; fi
-
-
-install-strip:
-	${MAKE} strip
-	${MAKE} install
-
-install-macosx:
-	${MAKE} -C macosx install-macosx
-
-bindist:  
-	if [ "${MACOSX_APP}" = "1" ] ; then \
-		${MAKE} bindist-macosx; \
-		exit; \
-	fi; \
-	${MAKE} real-bindist
-
-real-bindist:
-	mkdir -p ${ARCH_DISTDIR}/etc/nad/src ; \
-	    cp -f ${MODULE_TOPDIR}/lib/proj/*.lla ${ARCH_DISTDIR}/etc/nad/src ; true
-	( date=`date '+%d_%m_%Y'`; cd ${ARCH_DISTDIR}; tar cBf - ${BIN_DIST_FILES} | gzip -fc > ../grass-${GRASS_VERSION_MAJOR}.${GRASS_VERSION_MINOR}.${GRASS_VERSION_RELEASE}-${ARCH}-$$date.tar.gz)
-	-date=`date '+%d_%m_%Y'`; name=grass-${GRASS_VERSION_MAJOR}.${GRASS_VERSION_MINOR}.${GRASS_VERSION_RELEASE}-${ARCH}-$$date.tar.gz; \
-	    size=`ls -l $$name | awk '{print $$5}'`; \
-	    sed -e "s/BIN_DIST_VERSION/${GRASS_VERSION_MAJOR}.${GRASS_VERSION_MINOR}.${GRASS_VERSION_RELEASE}-${ARCH}-$$date/" \
-	    -e "s/GRASSPRG_NAME/grass${GRASS_VERSION_MAJOR}${GRASS_VERSION_MINOR}/" \
-	    -e "s/SIZE_TAR_FILE/$$size/" -e "s#BIN_DIST_DIR#'${INST_DIR}'#" \
-	    -e "s/ARCHITECTURE/${ARCH}/" \
-	    -e "s/LD_LIBRARY_PATH_VAR/${LD_LIBRARY_PATH_VAR}/" \
-	    -e "s/TEST_STR=/TEST_STR=executable/" \
-	    -e "s#IMPORTANT.*#Generated from the binaryInstall.src file using the command make bindist#" \
-	    -e "s/# executable shell.*//" -e "s/# make bindist.*//" \
-	    binaryInstall.src > grass-${GRASS_VERSION_MAJOR}.${GRASS_VERSION_MINOR}.${GRASS_VERSION_RELEASE}-${ARCH}-$$date-install.sh ; \
-	    chmod a+x grass-${GRASS_VERSION_MAJOR}.${GRASS_VERSION_MINOR}.${GRASS_VERSION_RELEASE}-${ARCH}-$$date-install.sh 2>/dev/null
-
-bindist-macosx:
-	${MAKE} -C macosx bindist-macosx
-
-# make a source package for distribution:
-srcdist: distclean
-	-${MAKE_DIR_CMD} ./grass-${GRASS_VERSION_MAJOR}.${GRASS_VERSION_MINOR}.${GRASS_VERSION_RELEASE}
-
-	@ # needed to store code in package with grass-version path:
-	-mv * ./grass-${GRASS_VERSION_MAJOR}.${GRASS_VERSION_MINOR}.${GRASS_VERSION_RELEASE}
-	@ # do not include the debian control files:
-	-mv ./grass-${GRASS_VERSION_MAJOR}.${GRASS_VERSION_MINOR}.${GRASS_VERSION_RELEASE}/debian .
-	@ #we use -h to get the linked files into as real files:
-	tar cvfzh grass-${GRASS_VERSION_MAJOR}.${GRASS_VERSION_MINOR}.${GRASS_VERSION_RELEASE}.tar.gz ./grass-${GRASS_VERSION_MAJOR}.${GRASS_VERSION_MINOR}.${GRASS_VERSION_RELEASE}/* --exclude=CVS
-	@ # restore src code location:
-	-mv ./grass-${GRASS_VERSION_MAJOR}.${GRASS_VERSION_MINOR}.${GRASS_VERSION_RELEASE}/* .
-	-rmdir ./grass-${GRASS_VERSION_MAJOR}.${GRASS_VERSION_MINOR}.${GRASS_VERSION_RELEASE}
-	@ echo "Distribution source package: grass-${GRASS_VERSION_MAJOR}.${GRASS_VERSION_MINOR}.${GRASS_VERSION_RELEASE}.tar.gz ready. Calculating MD5 sum..."
-	md5sum grass-${GRASS_VERSION_MAJOR}.${GRASS_VERSION_MINOR}.${GRASS_VERSION_RELEASE}.tar.gz > grass-${GRASS_VERSION_MAJOR}.${GRASS_VERSION_MINOR}.${GRASS_VERSION_RELEASE}.md5sum
-
-# make a source package for library distribution:
-srclibsdist: distclean
-	-${MAKE_DIR_CMD} ./grass-lib-${GRASS_VERSION_MAJOR}.${GRASS_VERSION_MINOR}.${GRASS_VERSION_RELEASE}
-
-	@ # needed to store code in package with grass-version path:
-	-cp -L * ./grass-lib-${GRASS_VERSION_MAJOR}.${GRASS_VERSION_MINOR}.${GRASS_VERSION_RELEASE}
-	-cp -rL tools ./grass-lib-${GRASS_VERSION_MAJOR}.${GRASS_VERSION_MINOR}.${GRASS_VERSION_RELEASE}
-	-cp -rL include ./grass-lib-${GRASS_VERSION_MAJOR}.${GRASS_VERSION_MINOR}.${GRASS_VERSION_RELEASE}
-	-cp -rL --parents lib/external/shapelib ./grass-lib-${GRASS_VERSION_MAJOR}.${GRASS_VERSION_MINOR}.${GRASS_VERSION_RELEASE}
-	-cp -rL --parents lib/datetime ./grass-lib-${GRASS_VERSION_MAJOR}.${GRASS_VERSION_MINOR}.${GRASS_VERSION_RELEASE}
-	-cp -rL --parents lib/db ./grass-lib-${GRASS_VERSION_MAJOR}.${GRASS_VERSION_MINOR}.${GRASS_VERSION_RELEASE}
-	-cp -rL --parents lib/gis ./grass-lib-${GRASS_VERSION_MAJOR}.${GRASS_VERSION_MINOR}.${GRASS_VERSION_RELEASE}
-	-cp -rL --parents lib/linkm ./grass-lib-${GRASS_VERSION_MAJOR}.${GRASS_VERSION_MINOR}.${GRASS_VERSION_RELEASE}
-	-cp -rL --parents lib/form ./grass-lib-${GRASS_VERSION_MAJOR}.${GRASS_VERSION_MINOR}.${GRASS_VERSION_RELEASE}
-	-cp -rL --parents lib/vector ./grass-lib-${GRASS_VERSION_MAJOR}.${GRASS_VERSION_MINOR}.${GRASS_VERSION_RELEASE}
-
-	-cp -rL --parents db/drivers ./grass-lib-${GRASS_VERSION_MAJOR}.${GRASS_VERSION_MINOR}.${GRASS_VERSION_RELEASE}
-
-	tar chvfz grass-lib-${GRASS_VERSION_MAJOR}.${GRASS_VERSION_MINOR}.${GRASS_VERSION_RELEASE}.tar.gz ./grass-lib-${GRASS_VERSION_MAJOR}.${GRASS_VERSION_MINOR}.${GRASS_VERSION_RELEASE}/* --exclude=CVS
-	-rm -r ./grass-lib-${GRASS_VERSION_MAJOR}.${GRASS_VERSION_MINOR}.${GRASS_VERSION_RELEASE}
-	@ echo "Distribution source package: grass-lib-${GRASS_VERSION_MAJOR}.${GRASS_VERSION_MINOR}.${GRASS_VERSION_RELEASE}.tar.gz ready."
-
-# generate docs as single HTML document:
-htmldocs-single:
-	(cd lib/ ; $(MAKE) cleandocs ; $(MAKE) htmldocs-single)
-	(cd rfc/ ; $(MAKE) cleandocs ; $(MAKE) htmldocs-single)
-	(cd gui/wxpython/ ; $(MAKE) cleandocs ; $(MAKE) htmldocs-single)
-	(cd swig/; $(MAKE) cleandocs ; $(MAKE) htmldocs-single)
-
-# generate docs as multiple HTML documents:
-htmldocs:
-	(cd lib/db/ ; $(MAKE) cleandocs ; $(MAKE) htmldocs)
-	(cd lib/g3d/ ; $(MAKE) cleandocs ; $(MAKE) htmldocs)
-	(cd lib/gis/ ; $(MAKE) cleandocs ; $(MAKE) htmldocs)
-	(cd lib/gmath/ ; $(MAKE) cleandocs ; $(MAKE) htmldocs)
-	(cd lib/gpde/ ; $(MAKE) cleandocs ; $(MAKE) htmldocs)
-	(cd lib/ogsf/ ; $(MAKE) cleandocs ; $(MAKE) htmldocs)
-	(cd lib/proj/ ; $(MAKE) cleandocs ; $(MAKE) htmldocs)
-	(cd lib/python/ ; $(MAKE) cleandocs ; $(MAKE) htmldocs)
-	(cd lib/segment/; $(MAKE) cleandocs ; $(MAKE) htmldocs)
-	(cd lib/vector/ ; $(MAKE) cleandocs ; $(MAKE) htmldocs)
-	(cd lib/vector/dglib/ ; $(MAKE) cleandocs ; $(MAKE) htmldocs)
-	(cd rfc/ ; $(MAKE) cleandocs ; $(MAKE) htmldocs)
-	(cd gui/wxpython/ ; $(MAKE) cleandocs ; $(MAKE) htmldocs)
-	(cd swig/; $(MAKE) cleandocs ; $(MAKE) htmldocs)
-
-packagehtmldocs: htmldocs
-	tar chvfz grass${GRASS_VERSION_MAJOR}${GRASS_VERSION_MINOR}refman_`date '+%Y_%m_%d'`_html.tar.gz lib/db/html lib/g3d/html lib/gis/html lib/gmath/html lib/gpde/html lib/proj/html lib/python/html lib/ogsf/html lib/segment/html lib/vector/html lib/vector/dglib/html gui/wxpython/html rfc/html swig/html
-
-#alternatively, the docs can be generated as single PDF document (see doxygen FAQ for 'TeX capacity exceeded'):
-#  (cd lib/ ; make pdfdocs)
-
-pdfdocs:
-	(cd lib/db/ ; $(MAKE) cleandocs ; $(MAKE) pdfdocs)
-	(cd lib/g3d/ ; $(MAKE) cleandocs ; $(MAKE) pdfdocs)
-	(cd lib/gis/ ; $(MAKE) cleandocs ; $(MAKE) pdfdocs)
-	(cd lib/gmath/ ; $(MAKE) cleandocs ; $(MAKE) pdfdocs)
-	(cd lib/gpde/ ; $(MAKE) cleandocs ; $(MAKE) pdfdocs)
-	(cd lib/ogsf/ ; $(MAKE) cleandocs ; $(MAKE) pdfdocs)
-	(cd lib/proj/ ; $(MAKE) cleandocs ; $(MAKE) pdfdocs)
-	(cd lib/python/ ; $(MAKE) cleandocs ; $(MAKE) pdfdocs)
-	(cd lib/segment/; $(MAKE) cleandocs ; $(MAKE) pdfdocs)
-	(cd lib/vector/ ; $(MAKE) cleandocs ; $(MAKE) pdfdocs)
-	(cd lib/vector/dglib/ ; $(MAKE) cleandocs ; $(MAKE) pdfdocs)
-	(cd gui/wxpython/ ; $(MAKE) cleandocs ; $(MAKE) pdfdocs)
-	(cd rfc/ ; $(MAKE) cleandocs ; $(MAKE) pdfdocs)
-	(cd swig/; $(MAKE) cleandocs ; $(MAKE) pdfdocs)
-	@echo "Written PDF docs in: lib/db/latex/, lib/g3d/latex/, lib/gis/latex/, lib/gmath/latex/ lib/gpde/latex/ lib/ogsf/latex/, lib/proj/latex/, lib/python/latex/, lib/segment/latex/, lib/vector/latex/, lib/vector/dglib/latex/, gui/wxpython/, rfc/latex/, swig/latex/"
-
-cleandocs:
-	(cd lib/db/ ; $(MAKE) cleandocs)
-	(cd lib/g3d/ ; $(MAKE) cleandocs)
-	(cd lib/gis/ ; $(MAKE) cleandocs)
-	(cd lib/gmath/ ; $(MAKE) cleandocs)
-	(cd lib/gpde/ ; $(MAKE) cleandocs)
-	(cd lib/ogsf/ ; $(MAKE) cleandocs)
-	(cd lib/proj/ ; $(MAKE) cleandocs)
-	(cd lib/python/ ; $(MAKE) cleandocs)
-	(cd lib/segment/; $(MAKE) cleandocs)
-	(cd lib/vector/ ; $(MAKE) cleandocs)
-	(cd lib/vector/dglib/ ; $(MAKE) cleandocs)
-	(cd lib/ ; $(MAKE) cleandocs)
-	(cd gui/wxpython/ ; $(MAKE) cleandocs)
-	(cd rfc/ ; $(MAKE) cleandocs)
-	(cd swig/; $(MAKE) cleandocs)
-
-html2pdfdoc:
-	@ echo "Light PDF document from modules' HTML documentation"
-	@ # http://www.htmldoc.org
-	@test -d $(GRASS_PDFDIR) || mkdir -p $(GRASS_PDFDIR)
-	(cd ${ARCH_DISTDIR}/docs/html ; $(HTML2PDF) --webpage --no-links database.html display.html general.html imagery.html misc.html photo.html postscript.html raster.html raster3D.html vector.html -f $(GRASS_PDFDIR)/grass${GRASS_VERSION_MAJOR}${GRASS_VERSION_MINOR}commands.pdf)
-
-html2pdfdoccomplete:
-	@ echo "Complete PDF document from modules' HTML documentation"
-	@ # http://www.htmldoc.org
-	@test -d $(GRASS_PDFDIR) || mkdir -p $(GRASS_PDFDIR)
-	(cd ${ARCH_DISTDIR}/docs/html ; $(HTML2PDF) --webpage database.html db.*.html -f $(GRASS_PDFDIR)/grass${GRASS_VERSION_MAJOR}${GRASS_VERSION_MINOR}database.pdf)
-	(cd ${ARCH_DISTDIR}/docs/html ; $(HTML2PDF) --webpage display.html d.*.html -f $(GRASS_PDFDIR)/grass${GRASS_VERSION_MAJOR}${GRASS_VERSION_MINOR}display.pdf)
-	(cd ${ARCH_DISTDIR}/docs/html ; $(HTML2PDF) --webpage general.html g.*.html -f $(GRASS_PDFDIR)/grass${GRASS_VERSION_MAJOR}${GRASS_VERSION_MINOR}general.pdf)
-	(cd ${ARCH_DISTDIR}/docs/html ; $(HTML2PDF) --webpage imagery.html i.*.html -f $(GRASS_PDFDIR)/grass${GRASS_VERSION_MAJOR}${GRASS_VERSION_MINOR}imagery.pdf)
-	(cd ${ARCH_DISTDIR}/docs/html ; $(HTML2PDF) --webpage misc.html m.*.html -f $(GRASS_PDFDIR)/grass${GRASS_VERSION_MAJOR}${GRASS_VERSION_MINOR}misc.pdf)
-	(cd ${ARCH_DISTDIR}/docs/html ; $(HTML2PDF) --webpage photo.html i.ortho*.html photo*.html -f $(GRASS_PDFDIR)/grass${GRASS_VERSION_MAJOR}${GRASS_VERSION_MINOR}photo.pdf)
-	(cd ${ARCH_DISTDIR}/docs/html ; $(HTML2PDF) --webpage postscript.html ps.*.html -f $(GRASS_PDFDIR)/grass${GRASS_VERSION_MAJOR}${GRASS_VERSION_MINOR}postscript.pdf)
-	(cd ${ARCH_DISTDIR}/docs/html ; $(HTML2PDF) --webpage raster.html r.*.html -f $(GRASS_PDFDIR)/grass${GRASS_VERSION_MAJOR}${GRASS_VERSION_MINOR}raster.pdf)
-	(cd ${ARCH_DISTDIR}/docs/html ; $(HTML2PDF) --webpage raster3D.html r3.*.html -f $(GRASS_PDFDIR)/grass${GRASS_VERSION_MAJOR}${GRASS_VERSION_MINOR}raster3d.pdf)
-	(cd ${ARCH_DISTDIR}/docs/html ; $(HTML2PDF) --webpage vector.html v*.html -f $(GRASS_PDFDIR)/grass${GRASS_VERSION_MAJOR}${GRASS_VERSION_MINOR}vector.pdf)
-
-changelog:
-	@ echo "creating ChangeLog file (following 'trunk' only)..."
-	@ # svn2cl creates a GNU style ChangeLog file:
-	@ # http://ch.tudelft.nl/~arthur/svn2cl/
-	@if [ ! -x "`which svn2cl`" ] ; then \
-		echo "\"svn2cl\" is required, please install first from http://ch.tudelft.nl/~arthur/svn2cl/" ;	exit 1 ; \
-	fi
-	sh svn2cl ./ChangeLog
-
-.PHONY: default libs cleandistdirs cleanscriptstrings clean libsclean
-.PHONY: distclean strip install real-install install-strip install-macosx
-.PHONY: bindist real-bindist bindist-macosx srcdist srclibsdist
-.PHONY: htmldocs-single htmldocs packagehtmldocs pdfdocs cleandocs html2pdfdoc
-.PHONY: html2pdfdoccomplete changelog
+.PHONY: default libs
+.PHONY: cleandistdirs cleanscriptstrings clean libsclean distclean

Modified: grass/trunk/gui/wxpython/scripts/Makefile
===================================================================
--- grass/trunk/gui/wxpython/scripts/Makefile	2010-01-17 04:44:06 UTC (rev 40490)
+++ grass/trunk/gui/wxpython/scripts/Makefile	2010-01-17 05:49:21 UTC (rev 40491)
@@ -14,5 +14,3 @@
 
 $(ETC)/gui:
 	$(MKDIR) $@
-
-clean: cleansubdirs

Added: grass/trunk/include/Make/Docs.make
===================================================================
--- grass/trunk/include/Make/Docs.make	                        (rev 0)
+++ grass/trunk/include/Make/Docs.make	2010-01-17 05:49:21 UTC (rev 40491)
@@ -0,0 +1,104 @@
+
+# This should be "include"d from the top-level Makefile, and nowhere else
+
+# Extra commands
+HTML2PDF=		htmldoc --footer d.1
+GRASS_PDFDIR=		$(DOCSDIR)/pdf
+
+# generate docs as single HTML document:
+htmldocs-single:
+
+# generate docs as multiple HTML documents:
+htmldocs:
+
+docs_dirs = \
+	lib/db \
+	lib/g3d \
+	lib/gis \
+	lib/gmath \
+	lib/gpde \
+	lib/proj \
+	lib/python \
+	lib/ogsf \
+	lib/segment \
+	lib/vector \
+	lib/vector/dglib \
+	gui/wxpython \
+	rfc \
+	swig
+
+htmldocs_dirs := $(patsubst %,%/html,$(docs_dirs))
+latexdocs_dirs := $(patsubst %,%/latex,$(docs_dirs))
+
+htmldocs:
+	for dir in $(docs_dirs) ; do \
+	  $(MAKE) -C $$dir cleandocs ; \
+	  $(MAKE) -C $$dir htmldocs ; \
+	  done
+
+packagehtmldocs: htmldocs
+	tar chvfz $(GRASS_NAME)refman_$(DATE)_html.tar.gz $(htmldocs_dirs)
+
+#alternatively, the docs can be generated as single PDF document (see doxygen FAQ for 'TeX capacity exceeded'):
+#  (cd lib/ ; make pdfdocs)
+
+pdfdocs:
+	for dir in $(docs_dirs) ; do \
+	  $(MAKE) -C $$dir cleandocs ; \
+	  $(MAKE) -C $$dir pdfdocs ; \
+	  done
+	@echo "Written PDF docs in: $(latexdocs_dirs)"
+
+cleandocs:
+	for dir in $(docs_dirs) ; do \
+	  $(MAKE) -C $$dir cleandocs ; \
+	  done
+
+indices = \
+	database.html \
+	display.html \
+	general.html \
+	imagery.html \
+	misc.html \
+	photo.html \
+	postscript.html \
+	raster.html \
+	raster3D.html \
+	vector.html
+
+html_pdf = \
+	cd $(ARCH_DISTDIR)/docs/html && \
+	$(HTML2PDF) --webpage $(1).html $(2).*.html -f $(GRASS_PDFDIR)/$(GRASS_NAME)$(1).pdf
+
+html2pdfdoc:
+	@ echo "Light PDF document from modules' HTML documentation"
+	@ # http://www.htmldoc.org
+	@test -d $(GRASS_PDFDIR) || mkdir -p $(GRASS_PDFDIR)
+	$(call html_pdf commands,--no-links $(indices))
+
+html2pdfdoccomplete:
+	@ echo "Complete PDF document from modules' HTML documentation"
+	@ # http://www.htmldoc.org
+	@test -d $(GRASS_PDFDIR) || mkdir -p $(GRASS_PDFDIR)
+	$(call html_pdf database,db.*.html)
+	$(call html_pdf display,d.*.html)
+	$(call html_pdf general,g.*.html)
+	$(call html_pdf imagery,i.*.html)
+	$(call html_pdf misc,m.*.html)
+	$(call html_pdf photo,i.ortho*.html photo*.html)
+	$(call html_pdf postscript,ps.*.html)
+	$(call html_pdf raster,r.*.html)
+	$(call html_pdf raster3d,r3.*.html)
+	$(call html_pdf vector,v.*.html)
+
+changelog:
+	@ echo "creating ChangeLog file (following 'trunk' only)..."
+	@ # svn2cl creates a GNU style ChangeLog file:
+	@ # http://ch.tudelft.nl/~arthur/svn2cl/
+	@if [ ! -x "`which svn2cl`" ] ; then \
+		echo "\"svn2cl\" is required, please install first from http://ch.tudelft.nl/~arthur/svn2cl/" ;	exit 1 ; \
+	fi
+	sh svn2cl ./ChangeLog
+
+.PHONY: htmldocs-single htmldocs packagehtmldocs pdfdocs cleandocs html2pdfdoc
+.PHONY: html2pdfdoccomplete changelog

Modified: grass/trunk/include/Make/Grass.make
===================================================================
--- grass/trunk/include/Make/Grass.make	2010-01-17 04:44:06 UTC (rev 40490)
+++ grass/trunk/include/Make/Grass.make	2010-01-17 05:49:21 UTC (rev 40491)
@@ -1,6 +1,3 @@
-# to force make to use /bin/sh
-SHELL           = /bin/sh
-
 #########################################################################
 #                         Variable names
 # xxxINCDIR  directory(ies) including header files (example: /usr/include)
@@ -69,6 +66,8 @@
 GRASS_VERSION_NUMBER  = $(GRASS_VERSION_MAJOR).$(GRASS_VERSION_MINOR).$(GRASS_VERSION_RELEASE)
 GRASS_VERSION_NAME    = $(GRASS_VERSION_MAJOR)$(GRASS_VERSION_MINOR)$(GRASS_VERSION_RELEASE)
 
+GRASS_NAME	= grass$(GRASS_VERSION_MAJOR)$(GRASS_VERSION_MINOR)
+
 ##################### other #############################################
 
 COMPILE_FLAGS      = $(CPPFLAGS) $(CFLAGS1) $(INCLUDE_DIRS)

Added: grass/trunk/include/Make/Install.make
===================================================================
--- grass/trunk/include/Make/Install.make	                        (rev 0)
+++ grass/trunk/include/Make/Install.make	2010-01-17 05:49:21 UTC (rev 40491)
@@ -0,0 +1,174 @@
+
+# This should be "include"d from the top-level Makefile, and nowhere else
+
+BIN_DIST_FILES = $(FILES) \
+	grass$(GRASS_NAME).tmp \
+	bin \
+	docs \
+	driver \
+	etc \
+	fonts \
+	include \
+	lib \
+	man \
+	scripts \
+	locale
+
+# Shell commands
+MAKE_DIR_CMD	= $(MKDIR) -m 755
+
+strip:
+	@ if [ ! -f $(ARCH_BINDIR)/$(GRASS_NAME) ] ; then \
+		echo "ERROR: GRASS has not been compiled. Try \"make\" first."; \
+		echo "  Strip aborted, exiting Make."; \
+		exit; \
+	fi; \
+	cd $(ARCH_DISTDIR) ; find . -type f -perm +111 -exec strip {} \;
+
+install:
+	@ # The following action MUST be a single action. That is, all lines
+	@ # except the last line must have a backslash (\) at the end to
+	@ # continue the statement. The reason for this is that Make does not
+	@ # have an exit command thus, exit terminates the shell. However, 
+	@ # Make creates a new shell for each action listed for a target.
+	@ # Therefore, the only way exit will quit Make is if there is only
+	@ # a single action for the target.
+	@ # Check if grass has been compiled, if INST_DIR is writable, and if
+	@ # grass is part of INST_DIR
+	echo $(ARCH_BINDIR)/$(GRASS_NAME)
+	@ if [ ! -f $(ARCH_BINDIR)/$(GRASS_NAME) ] ; then \
+		echo "ERROR: GRASS has not been compiled. Try \"make\" first."; \
+		echo "  Installation aborted, exiting Make."; \
+		exit; \
+	fi; \
+	if [ "$(MACOSX_APP)" = "1" ] ; then \
+		$(MAKE) install-macosx; \
+		exit; \
+	fi; \
+	INST_PATH=`dirname $(INST_DIR)`; \
+	while [ ! -d $$INST_PATH ]; do \
+		INST_PATH=`dirname $$INST_PATH`; \
+	done; \
+	if [ ! -d "$(INST_DIR)" -a ! -w "$$INST_PATH" ] ; then \
+		echo "ERROR: Directory $$INST_PATH is a parent directory of your"; \
+		echo "  install directory $(INST_DIR) and is not writable."; \
+		echo "  Perhaps you need root access."; \
+		echo "  Installation aborted, exiting Make."; \
+		exit; \
+	fi; \
+	if [ -d $(INST_DIR) -a ! -w "$(INST_DIR)" ] ; then \
+		echo "ERROR: Your install directory $(INST_DIR) is not writable."; \
+		echo "  Perhaps you need root access."; \
+		echo "  Installation aborted, exiting Make."; \
+		exit; \
+	fi; \
+	result=`echo "$(INST_DIR)" | awk '{ if ($$1 ~ /grass/) print $$1 }'`; \
+	if [ "$$result" = "" ] ; then \
+		echo "WARNING: Your install directory $(INST_DIR)"; \
+		echo "  does not contain the word 'grass'."; \
+		echo "  It is highly recommended that the word 'grass' be part"; \
+		echo "  of your install directory to avoid conflicts."; \
+		echo "  Do you want to continue? [y/n]"; \
+		read ans; \
+		ans=`echo "$$ans" | tr A-Z a-z`; \
+		if [ "$$ans" != "y" ] ; then \
+			echo "Installation aborted, exiting Make."; \
+			exit; \
+		fi; \
+	fi; \
+	$(MAKE) real-install
+
+real-install:
+	test -d $(INST_DIR) || $(MAKE_DIR_CMD) $(INST_DIR)
+	test -d $(BINDIR) || $(MAKE_DIR_CMD) $(BINDIR)
+	-sed -e "s#^GISBASE.*#GISBASE=$(INST_DIR)#" $(ARCH_BINDIR)/$(GRASS_NAME).sh > $(BINDIR)/$(GRASS_NAME).sh
+	-sed -e 's#^gisbase = ".*"#gisbase = "$(INST_DIR)"#' $(ARCH_BINDIR)/$(GRASS_NAME) > $(BINDIR)/$(GRASS_NAME)
+	-chmod a+x $(BINDIR)/$(GRASS_NAME)
+ifneq ($(strip $(MINGW)),)
+	-sed -e "s#WINGISBASE=.*#WINGISBASE=$(INST_DIR)#" $(ARCH_BINDIR)/$(GRASS_NAME).bat > $(BINDIR)/$(GRASS_NAME).bat
+	-chmod a+x $(BINDIR)/$(GRASS_NAME).bat
+endif
+	-tar cBCf $(GISBASE) - . | tar xBCf $(INST_DIR) - 2>/dev/null
+	-sed 's#'$(GISBASE)'#'$(INST_DIR)'#g' $(GISBASE)/etc/fontcap > $(INST_DIR)/etc/fontcap
+	-$(INSTALL) config.status $(INST_DIR)/config.status
+	-chmod -R a+rX $(INST_DIR) 2>/dev/null
+	@#GEM installation
+	-tar cBf - gem/skeleton | tar xBCf $(INST_DIR)/etc - 2>/dev/null
+	-$(INSTALL) gem/gem$(GRASS_VERSION_MAJOR)$(GRASS_VERSION_MINOR) $(BINDIR) 2>/dev/null
+	@# enable OSX Help Viewer
+	@if [ "`grep -i '^ARCH.*darwin' < include/Make/Platform.make`" ] ; then /bin/ln -sfh "$(INST_DIR)/docs/html" /Library/Documentation/Help/GRASS-$(GRASS_VERSION_MAJOR).$(GRASS_VERSION_MINOR) ; fi
+
+
+install-strip:
+	$(MAKE) strip
+	$(MAKE) install
+
+install-macosx:
+	$(MAKE) -C macosx install-macosx
+
+bindist:  
+	if [ "$(MACOSX_APP)" = "1" ] ; then \
+		$(MAKE) bindist-macosx; \
+		exit; \
+	fi; \
+	$(MAKE) real-bindist
+
+real-bindist:
+	mkdir -p $(ARCH_DISTDIR)/etc/nad/src ; \
+	    cp -f $(MODULE_TOPDIR)/lib/proj/*.lla $(ARCH_DISTDIR)/etc/nad/src ; true
+	-cd $(ARCH_DISTDIR); tar cBf - $(BIN_DIST_FILES) | gzip -fc > ../grass-$(GRASS_VERSION_NUMBER)-$(ARCH)-$(DATE).tar.gz
+	-name=grass-$(GRASS_VERSION_NUMBER)-$(ARCH)-$(DATE).tar.gz; \
+	    size=`ls -l $$name | awk '{print $$5}'`; \
+	    sed -e "s/BIN_DIST_VERSION/$(GRASS_VERSION_NUMBER)-$(ARCH)-$(DATE)/" \
+	    -e "s/GRASSPRG_NAME/$(GRASS_NAME)/" \
+	    -e "s/SIZE_TAR_FILE/$$size/" -e "s#BIN_DIST_DIR#'$(INST_DIR)'#" \
+	    -e "s/ARCHITECTURE/$(ARCH)/" \
+	    -e "s/LD_LIBRARY_PATH_VAR/$(LD_LIBRARY_PATH_VAR)/" \
+	    -e "s/TEST_STR=/TEST_STR=executable/" \
+	    -e "s#IMPORTANT.*#Generated from the binaryInstall.src file using the command make bindist#" \
+	    -e "s/# executable shell.*//" -e "s/# make bindist.*//" \
+	    binaryInstall.src > grass-$(GRASS_VERSION_NUMBER)-$(ARCH)-$(DATE)-install.sh ; \
+	    chmod a+x grass-$(GRASS_VERSION_NUMBER)-$(ARCH)-$(DATE)-install.sh 2>/dev/null
+
+bindist-macosx:
+	$(MAKE) -C macosx bindist-macosx
+
+# make a source package for distribution:
+srcdist: distclean
+	-$(MAKE_DIR_CMD) ./grass-$(GRASS_VERSION_NUMBER)
+
+	@ # needed to store code in package with grass-version path:
+	-mv * ./grass-$(GRASS_VERSION_NUMBER)
+	@ # do not include the debian control files:
+	-mv ./grass-$(GRASS_VERSION_NUMBER)/debian .
+	@ #we use -h to get the linked files into as real files:
+	tar cvfzh grass-$(GRASS_VERSION_NUMBER).tar.gz ./grass-$(GRASS_VERSION_NUMBER)/* --exclude=CVS
+	@ # restore src code location:
+	-mv ./grass-$(GRASS_VERSION_NUMBER)/* .
+	-rmdir ./grass-$(GRASS_VERSION_NUMBER)
+	@ echo "Distribution source package: grass-$(GRASS_VERSION_NUMBER).tar.gz ready. Calculating MD5 sum..."
+	md5sum grass-$(GRASS_VERSION_NUMBER).tar.gz > grass-$(GRASS_VERSION_NUMBER).md5sum
+
+# make a source package for library distribution:
+srclibsdist: distclean
+	-$(MAKE_DIR_CMD) ./grass-lib-$(GRASS_VERSION_NUMBER)
+
+	@ # needed to store code in package with grass-version path:
+	-cp -L * ./grass-lib-$(GRASS_VERSION_NUMBER)
+	-cp -rL tools ./grass-lib-$(GRASS_VERSION_NUMBER)
+	-cp -rL include ./grass-lib-$(GRASS_VERSION_NUMBER)
+	-cp -rL --parents lib/external/shapelib ./grass-lib-$(GRASS_VERSION_NUMBER)
+	-cp -rL --parents lib/datetime ./grass-lib-$(GRASS_VERSION_NUMBER)
+	-cp -rL --parents lib/db ./grass-lib-$(GRASS_VERSION_NUMBER)
+	-cp -rL --parents lib/gis ./grass-lib-$(GRASS_VERSION_NUMBER)
+	-cp -rL --parents lib/linkm ./grass-lib-$(GRASS_VERSION_NUMBER)
+	-cp -rL --parents lib/form ./grass-lib-$(GRASS_VERSION_NUMBER)
+	-cp -rL --parents lib/vector ./grass-lib-$(GRASS_VERSION_NUMBER)
+	-cp -rL --parents db/drivers ./grass-lib-$(GRASS_VERSION_NUMBER)
+
+	tar chvfz grass-lib-$(GRASS_VERSION_NUMBER).tar.gz ./grass-lib-$(GRASS_VERSION_NUMBER)/* --exclude=CVS
+	-rm -r ./grass-lib-$(GRASS_VERSION_NUMBER)
+	@ echo "Distribution source package: grass-lib-$(GRASS_VERSION_NUMBER).tar.gz ready."
+
+.PHONY: strip install real-install install-strip install-macosx
+.PHONY: bindist real-bindist bindist-macosx srcdist srclibsdist

Modified: grass/trunk/include/Makefile
===================================================================
--- grass/trunk/include/Makefile	2010-01-17 04:44:06 UTC (rev 40490)
+++ grass/trunk/include/Makefile	2010-01-17 05:49:21 UTC (rev 40491)
@@ -1,6 +1,7 @@
 MODULE_TOPDIR = ..
 
 include $(MODULE_TOPDIR)/include/Make/Vars.make
+include $(MODULE_TOPDIR)/include/Make/Rules.make
 
 SRCH := $(wildcard ../include/*.h ../include/vect/*.h ../include/iostream/*.h)
 DSTH := $(patsubst ../include/%.h,$(ARCH_INCDIR)/%.h,$(SRCH))
@@ -10,6 +11,9 @@
 
 default: $(DSTH) $(DSTMAKE)
 
+# cancel rule from Rules.make
+$(ARCH_INCDIR)/%.h: %.h
+
 $(ARCH_INCDIR)/vect/%.h: vect/%.h | $(ARCH_INCDIR)/vect
 	$(INSTALL_DATA) $< $@
 
@@ -25,14 +29,9 @@
 $(ARCH_INCDIR)/iostream: | $(ARCH_INCDIR)
 	$(MKDIR) $@
 
-$(ARCH_INCDIR): | $(ARCH_DISTDIR)
-	$(MKDIR) $@
-
 $(ARCH_DISTDIR)/include/Make/%.make: Make/%.make | $(ARCH_DISTDIR)/include/Make
 	$(INSTALL_DATA) $< $@
 
 $(ARCH_DISTDIR)/include/Make:
 	$(MKDIR) $@
 
-$(ARCH_DISTDIR):
-	$(MKDIR) $@



More information about the grass-commit mailing list