[GRASS-SVN] r43905 - in grass/trunk: . include/Make lib/proj
svn_grass at osgeo.org
svn_grass at osgeo.org
Thu Oct 14 05:43:38 EDT 2010
Author: glynn
Date: 2010-10-14 02:43:38 -0700 (Thu, 14 Oct 2010)
New Revision: 43905
Modified:
grass/trunk/Makefile
grass/trunk/include/Make/Docs.make
grass/trunk/include/Make/Install.make
grass/trunk/lib/proj/Makefile
Log:
Build system clean-up, mainly installation
Modified: grass/trunk/Makefile
===================================================================
--- grass/trunk/Makefile 2010-10-14 07:59:19 UTC (rev 43904)
+++ grass/trunk/Makefile 2010-10-14 09:43:38 UTC (rev 43905)
@@ -126,7 +126,6 @@
include $(MODULE_TOPDIR)/include/Make/Install.make
include $(MODULE_TOPDIR)/include/Make/Docs.make
-include $(MODULE_TOPDIR)/include/Make/Doxygen.make
.PHONY: default libs
.PHONY: cleandistdirs cleanscriptstrings clean libsclean distclean
Modified: grass/trunk/include/Make/Docs.make
===================================================================
--- grass/trunk/include/Make/Docs.make 2010-10-14 07:59:19 UTC (rev 43904)
+++ grass/trunk/include/Make/Docs.make 2010-10-14 09:43:38 UTC (rev 43905)
@@ -28,8 +28,7 @@
lib/vector \
lib/vector/dglib \
gui/wxpython \
- rfc \
- swig
+ rfc
htmldocs_dirs := $(patsubst %,%/html,$(docs_dirs))
latexdocs_dirs := $(patsubst %,%/latex,$(docs_dirs))
Modified: grass/trunk/include/Make/Install.make
===================================================================
--- grass/trunk/include/Make/Install.make 2010-10-14 07:59:19 UTC (rev 43904)
+++ grass/trunk/include/Make/Install.make 2010-10-14 09:43:38 UTC (rev 43905)
@@ -17,112 +17,145 @@
# 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 {} \;
+strip: strip-check
+ find $(ARCH_DISTDIR) -type f -perm +111 -print0 | xargs -0 strip
+strip-check:
+ @ if [ ! -f "$(ARCH_BINDIR)/$(GRASS_NAME)" ] ; then \
+ echo "ERROR: GRASS has not been compiled. Try \"make\" first." >&2 ; \
+ echo " Strip aborted, exiting Make." >&2 ; \
+ exit 1; \
+ fi
+
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 $(ARCH_BINDIR)/$(GRASS_NAME)
+ $(MAKE) install-check-built
+ifeq ($(strip $(MACOSX_APP)),1)
+ $(MAKE) install-macosx
+else
+ $(MAKE) install-check-parent
+ $(MAKE) install-check-writable
+ $(MAKE) install-check-prefix
+ $(MAKE) real-install
+endif
+
+install-check-built:
+ @ 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 \
+ fi
+
+install-check-parent:
+ @ 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 }'`; \
+ echo "ERROR: Directory $$INST_PATH is a parent directory of your" >&2 ; \
+ echo " install directory $(INST_DIR) and is not writable." >&2 ; \
+ echo " Perhaps you need root access." >&2 ; \
+ echo " Installation aborted, exiting Make." >&2 ; \
+ exit 1; \
+ fi
+
+install-check-writable:
+ @ if [ -d "$(INST_DIR)" -a ! -w "$(INST_DIR)" ] ; then \
+ echo "ERROR: Your install directory $(INST_DIR) is not writable." >&2 ; \
+ echo " Perhaps you need root access." >&2 ; \
+ echo " Installation aborted, exiting Make." >&2 ; \
+ exit 1; \
+ fi
+
+install-check-prefix:
+ @ 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]"; \
+ echo "WARNING: Your install directory $(INST_DIR)" >&2 ; \
+ echo " does not contain the word 'grass'." >&2 ; \
+ echo " It is highly recommended that the word 'grass' be part" >&2 ; \
+ echo " of your install directory to avoid conflicts." >&2 ; \
+ echo " Do you want to continue? [y/n]" >&2 ; \
read ans; \
- ans=`echo "$$ans" | tr A-Z a-z`; \
- if [ "$$ans" != "y" ] ; then \
- echo "Installation aborted, exiting Make."; \
- exit; \
+ if [ "$$ans" != "y" -a "$$ans" != "Y" ] ; then \
+ echo "Installation aborted, exiting Make." >&2 ; \
+ exit 1; \
fi; \
- fi; \
- $(MAKE) real-install
+ fi
-real-install:
- test -d $(INST_DIR) || $(MAKE_DIR_CMD) $(INST_DIR)
- test -d $(UNIX_BIN) || $(MAKE_DIR_CMD) $(UNIX_BIN)
ifneq ($(strip $(MINGW)),)
- -sed -e 's#'@GISBASE@'#'$(INST_DIR)'#g' \
- -e 's#'@LD_LIBRARY_PATH_VAR@'#'$(LD_LIBRARY_PATH_VAR)'#g' \
- -e 's#'@CONFIG_PROJSHARE@'#'$(PROJSHARE)'#g' \
- $(ARCH_DISTDIR)/$(GRASS_NAME).tmp > $(UNIX_BIN)/$(GRASS_NAME).py
- -chmod a+x $(UNIX_BIN)/$(GRASS_NAME).py
+STARTUP = $(UNIX_BIN)/$(GRASS_NAME).py
else
- -sed -e 's#'@GISBASE@'#'$(INST_DIR)'#g' \
- -e 's#'@LD_LIBRARY_PATH_VAR@'#'$(LD_LIBRARY_PATH_VAR)'#g' \
- -e 's#'@CONFIG_PROJSHARE@'#'$(PROJSHARE)'#g' \
- $(ARCH_DISTDIR)/$(GRASS_NAME).tmp > $(UNIX_BIN)/$(GRASS_NAME)
- -chmod a+x $(UNIX_BIN)/$(GRASS_NAME)
+STARTUP = $(UNIX_BIN)/$(GRASS_NAME)
endif
+
+FONTCAP = etc/fontcap
+TMPGISRC = demolocation/.grassrc$(GRASS_VERSION_MAJOR)$(GRASS_VERSION_MINOR)
+PLATMAKE = include/Make/Platform.make
+
+real-install: | $(INST_DIR) $(UNIX_BIN)
+ $(MAKE) $(STARTUP)
-tar cBCf $(GISBASE) - . | tar xBCf $(INST_DIR) - 2>/dev/null
-rm $(INST_DIR)/$(GRASS_NAME).tmp
- -sed 's#'$(GISBASE)'#'$(INST_DIR)'#g' $(GISBASE)/etc/fontcap > $(INST_DIR)/etc/fontcap
+
+ -rm $(INST_DIR)/$(FONTCAP)
+ $(MAKE) $(INST_DIR)/$(FONTCAP)
+
+ -rm $(INST_DIR)/$(TMPGISRC)
+ $(MAKE) $(INST_DIR)/$(TMPGISRC)
+
+ -rm $(INST_DIR)/$(PLATMAKE)
+ $(MAKE) $(INST_DIR)/$(PLATMAKE)
+
-$(INSTALL) config.status $(INST_DIR)/config.status
- -chmod -R a+rX $(INST_DIR) 2>/dev/null
+ -$(CHMOD) -R a+rX $(INST_DIR) 2>/dev/null
+
+ifneq ($(findstring darwin,$(ARCH)),)
@# 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
+ @/bin/ln -sfh "$(INST_DIR)/docs/html" /Library/Documentation/Help/GRASS-$(GRASS_VERSION_MAJOR).$(GRASS_VERSION_MINOR)
+endif
+$(INST_DIR) $(UNIX_BIN):
+ $(MAKE_DIR_CMD) $@
+$(STARTUP): $(ARCH_DISTDIR)/$(GRASS_NAME).tmp
+ sed -e 's#'@GISBASE@'#'$(INST_DIR)'#g' \
+ -e 's#'@LD_LIBRARY_PATH_VAR@'#'$(LD_LIBRARY_PATH_VAR)'#g' \
+ -e 's#'@CONFIG_PROJSHARE@'#'$(PROJSHARE)'#g' \
+ $< > $@
+ -$(CHMOD) a+x $@
+
+define fix_gisbase
+sed -e 's#$(GISBASE)#$(INST_DIR)#g' $< > $@
+endef
+
+$(INST_DIR)/$(FONTCAP): $(GISBASE)/$(FONTCAP)
+ $(call fix_gisbase)
+
+$(INST_DIR)/$(TMPGISRC): $(GISBASE)/$(TMPGISRC)
+ $(call fix_gisbase)
+
+$(INST_DIR)/$(PLATMAKE): $(GISBASE)/$(PLATMAKE)
+ $(call fix_gisbase)
+
+install-macosx:
+ $(MAKE) -C macosx install-macosx
+
install-strip:
$(MAKE) strip
$(MAKE) install
-install-macosx:
- $(MAKE) -C macosx install-macosx
-
bindist:
- if [ "$(MACOSX_APP)" = "1" ] ; then \
- $(MAKE) bindist-macosx; \
- exit; \
- fi; \
+ifeq ($(strip $(MACOSX_APP)),1)
+ $(MAKE) bindist-macosx
+else
$(MAKE) real-bindist
+endif
+BINDISTNAME = grass-$(GRASS_VERSION_NUMBER)-$(ARCH)-$(DATE)
+
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}'`; \
+ -tar cCBf $(ARCH_DISTDIR) - $(BIN_DIST_FILES) | gzip -fc > $(BINDISTNAME).tar.gz
+ -size=`ls -l $(BINDISTNAME).tar.gz | 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)'#" \
@@ -131,8 +164,8 @@
-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
+ binaryInstall.src > $(BINDISTNAME)-install.sh ; \
+ chmod a+x $(BINDISTNAME)-install.sh 2>/dev/null
bindist-macosx:
$(MAKE) -C macosx bindist-macosx
@@ -146,7 +179,7 @@
@ # 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
+ tar cvfzh grass-$(GRASS_VERSION_NUMBER).tar.gz ./grass-$(GRASS_VERSION_NUMBER)/* --exclude=.svn
@ # restore src code location:
-mv ./grass-$(GRASS_VERSION_NUMBER)/* .
-rmdir ./grass-$(GRASS_VERSION_NUMBER)
@@ -174,5 +207,7 @@
-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: strip strip-check
+.PHONY: install-check-built install-check-parent install-check-writable install-check-prefix
+.PHONY: install real-install install-strip install-macosx
.PHONY: bindist real-bindist bindist-macosx srcdist srclibsdist
Modified: grass/trunk/lib/proj/Makefile
===================================================================
--- grass/trunk/lib/proj/Makefile 2010-10-14 07:59:19 UTC (rev 43904)
+++ grass/trunk/lib/proj/Makefile 2010-10-14 09:43:38 UTC (rev 43905)
@@ -21,21 +21,27 @@
NT_DSTFILES := $(patsubst %,$(NAD_DIR)/%,$(NT_TABLES))
CSV_DSTFILES := $(patsubst %,$(CSV_DIR)/%,$(CSV_FILES))
+NAD_SRCDIR = $(ETC)/nad/src
+NAD_SRCFILES := $(patsubst %.lla,$(NAD_SRCDIR)/%.lla,$(NAD_TABLES))
+
PROJ_TABLES := proj-desc.table proj-parms.table proj-units.table
PROJ_DSTFILES := $(patsubst %,$(ETC)/%,$(PROJ_TABLES))
default: lib
- $(MAKE) $(NAD_DSTFILES) $(CSV_DSTFILES) $(PROJ_DSTFILES)
+ $(MAKE) $(NAD_DSTFILES) $(CSV_DSTFILES) $(PROJ_DSTFILES) $(NAD_SRCFILES)
-$(NAD_DIR)/%: %.lla | $(NAD_DIR)
+$(NAD_DSTFILES): $(NAD_DIR)/%: %.lla | $(NAD_DIR)
$(NAD2BIN) < $< $@
$(NT_DSTFILES): $(NAD_DIR)/%: % | $(NAD_DIR)
$(INSTALL_DATA) $< $@
-$(CSV_DIR)/%.csv: %.csv | $(CSV_DIR)
+$(CSV_DSTFILES): $(CSV_DIR)/%.csv: %.csv | $(CSV_DIR)
$(INSTALL_DATA) $< $@
+$(NAD_SRCFILES): $(NAD_SRCDIR)/%.lla: %.lla | $(NAD_SRCDIR)
+ $(INSTALL_DATA) $< $@
+
$(ETC)/proj-%.table: proj-%.table
$(INSTALL_DATA) $< $@
@@ -45,6 +51,9 @@
$(CSV_DIR):
$(MKDIR) $@
+$(NAD_SRCDIR):
+ $(MKDIR) $@
+
# Note for future improvement:
# To allow for cross-compilation, the above NAD_TABLES files should be
# created during installation rather than compilation
More information about the grass-commit
mailing list