[GRASS-SVN] r33485 - in grass/trunk: . display/d.graph general/g.mapsets general/g.mkfontcap gui/icons gui/scripts gui/wxpython include/Make lib lib/external/bwidget lib/form lib/proj locale man scripts/d.polar scripts/i.oif scripts/r.in.wms scripts/v.in.gpsbabel vector/v.clean/test vector/v.digit vector/v.in.dwg visualization/nviz visualization/nviz/html

svn_grass at osgeo.org svn_grass at osgeo.org
Wed Sep 17 11:09:28 EDT 2008


Author: glynn
Date: 2008-09-17 11:09:28 -0400 (Wed, 17 Sep 2008)
New Revision: 33485

Added:
   grass/trunk/include/Make/ScriptRules.make
Modified:
   grass/trunk/Makefile
   grass/trunk/display/d.graph/Makefile
   grass/trunk/general/g.mapsets/Makefile
   grass/trunk/general/g.mkfontcap/Makefile
   grass/trunk/gui/icons/Makefile
   grass/trunk/gui/scripts/Makefile
   grass/trunk/gui/wxpython/Makefile
   grass/trunk/include/Make/Grass.make
   grass/trunk/include/Make/Script.make
   grass/trunk/lib/Makefile
   grass/trunk/lib/external/bwidget/Makefile
   grass/trunk/lib/form/Makefile
   grass/trunk/lib/proj/Makefile
   grass/trunk/locale/Makefile
   grass/trunk/man/Makefile
   grass/trunk/scripts/d.polar/Makefile
   grass/trunk/scripts/i.oif/Makefile
   grass/trunk/scripts/r.in.wms/Makefile
   grass/trunk/scripts/v.in.gpsbabel/Makefile
   grass/trunk/vector/v.clean/test/Makefile
   grass/trunk/vector/v.digit/Makefile
   grass/trunk/vector/v.in.dwg/Makefile
   grass/trunk/visualization/nviz/Makefile
   grass/trunk/visualization/nviz/html/Makefile
Log:
Place files in $(ARCH_DISTDIR) rather than $(GISBASE)
Avoid re-"install"ing files unconditionally
Don't pass multiple filenames to $(INSTALL) or $(INSTALL_DATA)



Modified: grass/trunk/Makefile
===================================================================
--- grass/trunk/Makefile	2008-09-17 10:17:35 UTC (rev 33484)
+++ grass/trunk/Makefile	2008-09-17 15:09:28 UTC (rev 33485)
@@ -30,7 +30,7 @@
 
 # Extra commands
 HTML2PDF=		htmldoc --footer d.1
-GRASS_PDFDIR=		$(GISBASE)/docs/pdf
+GRASS_PDFDIR=		$(DOCSDIR)/pdf
 
 
 DIRS = \

Modified: grass/trunk/display/d.graph/Makefile
===================================================================
--- grass/trunk/display/d.graph/Makefile	2008-09-17 10:17:35 UTC (rev 33484)
+++ grass/trunk/display/d.graph/Makefile	2008-09-17 15:09:28 UTC (rev 33485)
@@ -7,5 +7,7 @@
 
 include $(MODULE_TOPDIR)/include/Make/Module.make
 
-default: cmd
-	$(INSTALL_DATA) grass_logo.txt $(GISBASE)/docs/html
+default: cmd $(HTMLDIR)/grass_logo.txt
+
+$(HTMLDIR)/%: %
+	$(INSTALL_DATA) $< $@

Modified: grass/trunk/general/g.mapsets/Makefile
===================================================================
--- grass/trunk/general/g.mapsets/Makefile	2008-09-17 10:17:35 UTC (rev 33484)
+++ grass/trunk/general/g.mapsets/Makefile	2008-09-17 15:09:28 UTC (rev 33485)
@@ -2,7 +2,7 @@
 MODULE_TOPDIR = ../..
 
 PGM = g.mapsets
-GUI = $(GISBASE)/etc/g.mapsets.tcl
+GUI = $(ETC)/g.mapsets.tcl
 
 LIBES     = $(GISLIB)
 DEPENDENCIES= $(GISDEP)
@@ -11,6 +11,6 @@
 
 default: cmd $(GUI)
 
-$(GUI): g.mapsets.tcl
-	if [ ! -d $(GISBASE)/etc ]; then $(MKDIR) $(GISBASE)/etc; fi
-	$(INSTALL) g.mapsets.tcl $(GUI)
+$(ETC)/%: %
+	if [ ! -d $(ETC) ]; then $(MKDIR) $(ETC); fi
+	$(INSTALL) $< $@

Modified: grass/trunk/general/g.mkfontcap/Makefile
===================================================================
--- grass/trunk/general/g.mkfontcap/Makefile	2008-09-17 10:17:35 UTC (rev 33484)
+++ grass/trunk/general/g.mkfontcap/Makefile	2008-09-17 15:09:28 UTC (rev 33485)
@@ -10,8 +10,6 @@
 
 include $(MODULE_TOPDIR)/include/Make/Module.make
 
-*.o: local_proto.h
-
 default: cmd $(CAPFILE)
 
 $(CAPFILE): $(BIN)/$(PGM)$(EXE)

Modified: grass/trunk/gui/icons/Makefile
===================================================================
--- grass/trunk/gui/icons/Makefile	2008-09-17 10:17:35 UTC (rev 33484)
+++ grass/trunk/gui/icons/Makefile	2008-09-17 15:09:28 UTC (rev 33485)
@@ -2,25 +2,28 @@
 
 include $(MODULE_TOPDIR)/include/Make/Dir.make
 
+SRCICO := $(wildcard *.ico)
+SRCICONS := $(wildcard grass/*.gif grass/vdigit/*.gif grass/vdigit/*.xbm silk/*.png)
+ETCICONS := $(patsubst %,$(ETC)/gui/icons/%,$(SRCICONS) $(SRCICO))
+HTMLICONS := $(patsubst %,$(HTMLDIR)/icons/%,$(SRCICONS))
+
 default: $(ICONS)
 	if [ ! -d $(ETC)/gui ] ; then $(MKDIR) $(ETC)/gui ; fi
 	if [ ! -d $(ETC)/gui/icons ] ; then $(MKDIR) $(ETC)/gui/icons ; fi
 	if [ ! -d $(ETC)/gui/icons/grass ] ; then $(MKDIR) $(ETC)/gui/icons/grass ; fi
 	if [ ! -d $(ETC)/gui/icons/grass/vdigit ] ; then $(MKDIR) $(ETC)/gui/icons/grass/vdigit ; fi
 	if [ ! -d $(ETC)/gui/icons/silk ] ; then $(MKDIR) $(ETC)/gui/icons/silk ; fi
-	for icon in grass/*.gif ; do $(INSTALL_DATA) $$icon $(ETC)/gui/icons/grass ; done
-	for icon in grass/vdigit/*.gif ; do $(INSTALL_DATA) $$icon $(ETC)/gui/icons/grass/vdigit ; done
-	for icon in grass/vdigit/*.xbm ; do $(INSTALL_DATA) $$icon $(ETC)/gui/icons/grass/vdigit ; done
-	for icon in silk/*.png ; do $(INSTALL_DATA) $$icon $(ETC)/gui/icons/silk ; done
-	for icon in *.ico ; do $(INSTALL_DATA) $$icon $(ETC)/gui/icons ; done
-	if [ ! -d $(GISBASE)/docs ] ; then $(MKDIR) $(GISBASE)/docs ; fi
-	if [ ! -d $(GISBASE)/docs/html ] ; then $(MKDIR) $(GISBASE)/docs/html ; fi
-	if [ ! -d $(GISBASE)/docs/html/icons ] ; then $(MKDIR) $(GISBASE)/docs/html/icons ; fi
-	if [ ! -d $(GISBASE)/docs/html/icons/grass ] ; then $(MKDIR) $(GISBASE)/docs/html/icons/grass ; fi
-	if [ ! -d $(GISBASE)/docs/html/icons/grass/vdigit ] ; then $(MKDIR) $(GISBASE)/docs/html/icons/grass/vdigit ; fi
-	if [ ! -d $(GISBASE)/docs/html/icons/silk ] ; then $(MKDIR) $(GISBASE)/docs/html/icons/silk ; fi
-	for icon in grass/*.gif ; do $(INSTALL_DATA) $$icon $(GISBASE)/docs/html/icons/grass ; done
-	for icon in grass/vdigit/*.gif ; do $(INSTALL_DATA) $$icon $(GISBASE)/docs/html/icons/grass/vdigit ; done
-	for icon in grass/vdigit/*.xbm ; do $(INSTALL_DATA) $$icon $(GISBASE)/docs/html/icons/grass/vdigit ; done
-	for icon in silk/*.png ; do $(INSTALL_DATA) $$icon $(GISBASE)/docs/html/icons/silk ; done
+	if [ ! -d $(DOCSDIR) ] ; then $(MKDIR) $(DOCSDIR) ; fi
+	if [ ! -d $(HTMLDIR) ] ; then $(MKDIR) $(HTMLDIR) ; fi
+	if [ ! -d $(HTMLDIR)/icons ] ; then $(MKDIR) $(HTMLDIR)/icons ; fi
+	if [ ! -d $(HTMLDIR)/icons/grass ] ; then $(MKDIR) $(HTMLDIR)/icons/grass ; fi
+	if [ ! -d $(HTMLDIR)/icons/grass/vdigit ] ; then $(MKDIR) $(HTMLDIR)/icons/grass/vdigit ; fi
+	if [ ! -d $(HTMLDIR)/icons/silk ] ; then $(MKDIR) $(HTMLDIR)/icons/silk ; fi
+	$(MAKE) $(ETCICONS)
+	$(MAKE) $(HTMLICONS)
 
+$(ETC)/gui/icons/%: %
+	$(INSTALL_DATA) $< $@
+
+$(HTMLDIR)/icons/%: %
+	$(INSTALL_DATA) $< $@

Modified: grass/trunk/gui/scripts/Makefile
===================================================================
--- grass/trunk/gui/scripts/Makefile	2008-09-17 10:17:35 UTC (rev 33484)
+++ grass/trunk/gui/scripts/Makefile	2008-09-17 15:09:28 UTC (rev 33485)
@@ -2,7 +2,13 @@
 
 include $(MODULE_TOPDIR)/include/Make/Dir.make
 
+SRCFILES := $(wildcard *.*)
+DSTFILES := $(patsubst %,$(ETC)/gui/scripts/%,$(SRCFILES))
+
 default:
-	if [ ! -d $(GISBASE)/etc/gui ] ; then $(MKDIR) $(GISBASE)/etc/gui ; fi
-	if [ ! -d $(GISBASE)/etc/gui/scripts ] ; then $(MKDIR) $(GISBASE)/etc/gui/scripts ; fi
-	for file in *.* ; do $(INSTALL) $$file $(GISBASE)/etc/gui/scripts/ ; done
+	if [ ! -d $(ETC)/gui ] ; then $(MKDIR) $(ETC)/gui ; fi
+	if [ ! -d $(ETC)/gui/scripts ] ; then $(MKDIR) $(ETC)/gui/scripts ; fi
+	$(MAKE) $(DSTFILES)
+
+$(ETC)/gui/scripts/%: %
+	$(INSTALL) $< $@

Modified: grass/trunk/gui/wxpython/Makefile
===================================================================
--- grass/trunk/gui/wxpython/Makefile	2008-09-17 10:17:35 UTC (rev 33484)
+++ grass/trunk/gui/wxpython/Makefile	2008-09-17 15:09:28 UTC (rev 33485)
@@ -21,17 +21,23 @@
 
 ETCDIR = $(ETC)/wxpython
 
+SRCFILES := $(wildcard scripts/* compat/* gui_modules/* icons/*.* icons/silk/* images/* xml/*) gis_set.py wxgui.py README scripts/wxgui
+DSTFILES := $(patsubst %,$(ETCDIR)/%,$(SRCFILES))
+
 default: install_scripts
 	$(MAKE) parsubdirs
 
 install_scripts:
-	$(MKDIR) $(ETCDIR) $(ETCDIR)/compat $(ETCDIR)/gui_modules $(ETCDIR)/icons $(ETCDIR)/icons/silk $(ETCDIR)/images $(ETCDIR)/scripts $(ETCDIR)/vdigit $(ETCDIR)/xml $(ETCDIR)/nviz
-	$(INSTALL_DATA) compat/* $(ETCDIR)/compat/
-	$(INSTALL_DATA) gui_modules/* $(ETCDIR)/gui_modules/
-	$(INSTALL_DATA) icons/*.* $(ETCDIR)/icons/
-	$(INSTALL_DATA) icons/silk/* $(ETCDIR)/icons/silk/
-	$(INSTALL_DATA) images/* $(ETCDIR)/images/
-	$(INSTALL_DATA) xml/* $(ETCDIR)/xml/	
-	$(INSTALL_DATA) gis_set.py wxgui.py README $(ETCDIR)/
-	$(INSTALL) scripts/* $(ETCDIR)/scripts/	
-	$(INSTALL) wxgui $(ETCDIR)/scripts/
+	-$(MKDIR) $(ETCDIR) $(ETCDIR)/compat $(ETCDIR)/gui_modules \
+		$(ETCDIR)/icons $(ETCDIR)/icons/silk $(ETCDIR)/images \
+		$(ETCDIR)/scripts $(ETCDIR)/vdigit $(ETCDIR)/xml $(ETCDIR)/nviz
+	$(MAKE) $(DSTFILES)
+
+$(ETCDIR)/scripts/wxgui: wxgui
+	$(INSTALL) $< $@
+
+$(ETCDIR)/scripts/%: scripts/%
+	$(INSTALL) $< $@
+
+$(ETCDIR)/%: %
+	$(INSTALL_DATA) $< $@

Modified: grass/trunk/include/Make/Grass.make
===================================================================
--- grass/trunk/include/Make/Grass.make	2008-09-17 10:17:35 UTC (rev 33484)
+++ grass/trunk/include/Make/Grass.make	2008-09-17 15:09:28 UTC (rev 33485)
@@ -53,6 +53,7 @@
 DBDRIVERDIR     = $(ARCH_DISTDIR)/driver/db
 DOCSDIR         = $(ARCH_DISTDIR)/docs
 HTMLDIR         = $(ARCH_DISTDIR)/docs/html
+SCRIPTDIR       = $(ARCH_DISTDIR)/scripts
 
 FONTDIR         = $(ARCH_DISTDIR)/fonts
 

Modified: grass/trunk/include/Make/Script.make
===================================================================
--- grass/trunk/include/Make/Script.make	2008-09-17 10:17:35 UTC (rev 33484)
+++ grass/trunk/include/Make/Script.make	2008-09-17 15:09:28 UTC (rev 33485)
@@ -1,9 +1,4 @@
 
-# common dependencies and rules for building scripts
-
-SCRIPTDIR = $(ARCH_DISTDIR)/scripts
-STRINGDIR = $(MODULE_TOPDIR)/locale/scriptstrings
-
 SCRIPT = $(SCRIPTDIR)/$(PGM)
 
 HTMLSRC = $(SCRIPT)
@@ -11,6 +6,7 @@
 include $(MODULE_TOPDIR)/include/Make/Vars.make
 include $(MODULE_TOPDIR)/include/Make/Rules.make
 include $(MODULE_TOPDIR)/include/Make/Html.make
+include $(MODULE_TOPDIR)/include/Make/ScriptRules.make
 
 SCRIPT_ACTIONS = $(SCRIPT) html scriptstrings
 ifdef MINGW
@@ -19,29 +15,6 @@
 
 script: $(SCRIPT_ACTIONS)
 
-$(SCRIPTDIR)/%: %.py
-	if [ ! -d $(SCRIPTDIR) ]; then $(MKDIR) $(SCRIPTDIR); fi
-	$(INSTALL) $< $@
-
-$(SCRIPTDIR)/%: %
-	if [ ! -d $(SCRIPTDIR) ]; then $(MKDIR) $(SCRIPTDIR); fi
-	$(INSTALL) $< $@
-
-$(BIN)/$(PGM).bat: $(MODULE_TOPDIR)/scripts/windows_launch.bat
-	sed -e "s#SCRIPT_NAME#$(PGM)#" $(MODULE_TOPDIR)/scripts/windows_launch.bat > $@
-
-# Make strings in a fake .c file so that they get picked up by the internationalizer stuff.
-# These are only the options (parser.c) type things.
-# See locale/scriptstrings/README for more information
-
-$(STRINGDIR)/$(PGM)_to_translate.c: $(PGM)
-	GISRC=$(RUN_GISRC) \
-	GISBASE=$(RUN_GISBASE) \
-	PATH=$(BIN):$$PATH \
-	$(LD_LIBRARY_PATH_VAR)="$(ARCH_LIBDIR):$($(LD_LIBRARY_PATH_VAR))" \
-	g.parser -t $(PGM) | sed s/\"/\\\\\"/g | sed 's/.*/_("&")/' > \
-	$(STRINGDIR)/$(PGM)_to_translate.c ; true
-
 scriptstrings: $(STRINGDIR)/$(PGM)_to_translate.c
 
-.PHONY: script htmlscript scriptstrings
+.PHONY: script scriptstrings

Added: grass/trunk/include/Make/ScriptRules.make
===================================================================
--- grass/trunk/include/Make/ScriptRules.make	                        (rev 0)
+++ grass/trunk/include/Make/ScriptRules.make	2008-09-17 15:09:28 UTC (rev 33485)
@@ -0,0 +1,27 @@
+
+# common dependencies and rules for building scripts
+
+STRINGDIR = $(MODULE_TOPDIR)/locale/scriptstrings
+
+$(SCRIPTDIR)/%: %.py
+	if [ ! -d $(SCRIPTDIR) ]; then $(MKDIR) $(SCRIPTDIR); fi
+	$(INSTALL) $< $@
+
+$(SCRIPTDIR)/%: %
+	if [ ! -d $(SCRIPTDIR) ]; then $(MKDIR) $(SCRIPTDIR); fi
+	$(INSTALL) $< $@
+
+$(BIN)/%.bat: $(MODULE_TOPDIR)/scripts/windows_launch.bat
+	sed -e "s#SCRIPT_NAME#$*#" $(MODULE_TOPDIR)/scripts/windows_launch.bat > $@
+
+# Make strings in a fake .c file so that they get picked up by the internationalizer stuff.
+# These are only the options (parser.c) type things.
+# See locale/scriptstrings/README for more information
+
+$(STRINGDIR)/%_to_translate.c: %
+	GISRC=$(RUN_GISRC) \
+	GISBASE=$(RUN_GISBASE) \
+	PATH=$(BIN):$$PATH \
+	$(LD_LIBRARY_PATH_VAR)="$(ARCH_LIBDIR):$($(LD_LIBRARY_PATH_VAR))" \
+	g.parser -t $< | sed s/\"/\\\\\"/g | sed 's/.*/_("&")/' > \
+	$@ ; true

Modified: grass/trunk/lib/Makefile
===================================================================
--- grass/trunk/lib/Makefile	2008-09-17 10:17:35 UTC (rev 33484)
+++ grass/trunk/lib/Makefile	2008-09-17 15:09:28 UTC (rev 33485)
@@ -53,16 +53,26 @@
 include $(MODULE_TOPDIR)/include/Make/Dir.make
 include $(MODULE_TOPDIR)/include/Make/Doxygen.make
 
+SRCH := $(wildcard ../include/*.h ../include/vect/*.h ../include/iostream/*.h)
+DSTH := $(patsubst ../include/%.h,$(ARCH_INCDIR)/%.h,$(SRCH))
+
+SRCMAKE := $(wildcard ../include/Make/*.make)
+DSTMAKE := $(patsubst ../include/Make/%.make,$(ARCH_DISTDIR)/include/Make/%.make,$(SRCMAKE))
+
 default: headers
 	$(MAKE) subdirs
 
 headers: 
-	if [ ! -d $(GISBASE)/include ]; then $(MKDIR) $(GISBASE)/include; fi
-	if [ ! -d $(GISBASE)/include/grass ]; then $(MKDIR) $(GISBASE)/include/grass; fi
-	if [ ! -d $(GISBASE)/include/grass/vect ]; then $(MKDIR) $(GISBASE)/include/grass/vect; fi
-	if [ ! -d $(GISBASE)/include/grass/iostream ]; then $(MKDIR) $(GISBASE)/include/grass/iostream; fi
-	if [ ! -d $(GISBASE)/include/Make ]; then $(MKDIR) $(GISBASE)/include/Make; fi
-	for file in ../include/*.h ; do $(INSTALL_DATA) $$file $(GISBASE)/include/grass/ ; done
-	for file in ../include/vect/*.h ; do $(INSTALL_DATA) $$file $(GISBASE)/include/grass/vect/ ; done
-	for file in ../include/iostream/*.h ; do $(INSTALL_DATA) $$file $(GISBASE)/include/grass/iostream/ ; done
-	for file in ../include/Make/*.make ; do $(INSTALL_DATA) $$file $(GISBASE)/include/Make/ ; done
+	if [ ! -d $(ARCH_DISTDIR)/include ]; then $(MKDIR) $(ARCH_DISTDIR)/include; fi
+	if [ ! -d $(ARCH_INCDIR) ]; then $(MKDIR) $(ARCH_INCDIR); fi
+	if [ ! -d $(ARCH_INCDIR)/vect ]; then $(MKDIR) $(ARCH_INCDIR)/vect; fi
+	if [ ! -d $(ARCH_INCDIR)/iostream ]; then $(MKDIR) $(ARCH_INCDIR)/iostream; fi
+	$(MAKE) $(DSTH)
+	if [ ! -d $(ARCH_DISTDIR)/include/Make ]; then $(MKDIR) $(ARCH_DISTDIR)/include/Make; fi
+	$(MAKE) $(DSTMAKE)
+
+$(ARCH_INCDIR)/%.h: ../include/%.h
+	$(INSTALL_DATA) $< $@
+
+$(ARCH_DISTDIR)/include/Make/%.make: ../include/Make/%.make
+	$(INSTALL_DATA) $< $@

Modified: grass/trunk/lib/external/bwidget/Makefile
===================================================================
--- grass/trunk/lib/external/bwidget/Makefile	2008-09-17 10:17:35 UTC (rev 33484)
+++ grass/trunk/lib/external/bwidget/Makefile	2008-09-17 15:09:28 UTC (rev 33485)
@@ -2,10 +2,16 @@
 
 include $(MODULE_TOPDIR)/include/Make/Other.make
 
+BWIDGETDIR = $(ARCH_DISTDIR)/bwidget
+
+SRCFILES := $(wildcard images/*.* lang/*.* *.tcl *.txt) README.grass
+DSTFILES := $(patsubst %,$(BWIDGETDIR)/%,$(SRCFILES))
+
 default:
-	if [ ! -d $(GISBASE)/bwidget ]; then $(MKDIR) $(GISBASE)/bwidget; fi
-	if [ ! -d $(GISBASE)/bwidget/images ]; then $(MKDIR) $(GISBASE)/bwidget/images; fi
-	if [ ! -d $(GISBASE)/bwidget/lang ]; then $(MKDIR) $(GISBASE)/bwidget/lang; fi
-	for file in images/*.* ; do $(INSTALL_DATA) $$file $(GISBASE)/bwidget/images/ ; done
-	for file in lang/*.* ; do $(INSTALL_DATA) $$file $(GISBASE)/bwidget/lang/ ; done
-	for file in *.tcl *.txt README.grass ; do $(INSTALL_DATA) $$file $(GISBASE)/bwidget/ ; done
+	if [ ! -d $(BWIDGETDIR) ]; then $(MKDIR) $(BWIDGETDIR); fi
+	if [ ! -d $(BWIDGETDIR)/images ]; then $(MKDIR) $(BWIDGETDIR)/images; fi
+	if [ ! -d $(BWIDGETDIR)/lang ]; then $(MKDIR) $(BWIDGETDIR)/lang; fi
+	$(MAKE) $(DSTFILES)
+
+$(BWIDGETDIR)/%: %
+	$(INSTALL_DATA) $< $@

Modified: grass/trunk/lib/form/Makefile
===================================================================
--- grass/trunk/lib/form/Makefile	2008-09-17 10:17:35 UTC (rev 33484)
+++ grass/trunk/lib/form/Makefile	2008-09-17 15:09:28 UTC (rev 33485)
@@ -11,7 +11,7 @@
 EXTRA_LIBS=$(GISLIB) $(DBMILIB)
 EXTRA_CFLAGS = $(XCFLAGS) $(TCLINCDIR) $(TKINCDIR)
 
-FORMDIR=$(GISBASE)/etc/form
+FORMDIR=$(ARCH_DISTDIR)/etc/form
 FORM=$(FORMDIR)/form.tcl
 FORMPROG=$(FORMDIR)/form
 HTMLLIB=$(FORMDIR)/html_library.tcl

Modified: grass/trunk/lib/proj/Makefile
===================================================================
--- grass/trunk/lib/proj/Makefile	2008-09-17 10:17:35 UTC (rev 33484)
+++ grass/trunk/lib/proj/Makefile	2008-09-17 15:09:28 UTC (rev 33485)
@@ -15,27 +15,31 @@
 
 CSV_FILES := $(wildcard *.csv)
 
-NAD_DIR = $(GISBASE)/etc/nad
+NAD_DIR = $(ETC)/nad
 NAD2BIN = nad2bin
-CSV_DIR = $(GISBASE)/etc/ogr_csv
+CSV_DIR = $(ETC)/ogr_csv
 
-default: lib $(NAD_DIR) $(CSV_DIR)
+NAD_DSTFILES := $(patsubst %.lla,$(NAD_DIR)/%,$(NAD_TABLES))
+NT_DSTFILES  := $(patsubst %,$(NAD_DIR)/%,$(NT_TABLES))
+CSV_DSTFILES := $(patsubst %,$(CSV_DIR)/%,$(CSV_FILES))
 
-$(NAD_DIR): $(NAD_TABLES) $(NT_TABLES)
-	@ if [ ! -d $@ ] ; then $(MKDIR) $@ ; fi
-	for i in $(NAD_TABLES) ; do $(NAD2BIN) < $$i $@/`echo $$i | sed 's/.lla//'`; done
-	$(INSTALL_DATA) $(NT_TABLES) $@
-	@ touch $@
+default: lib
+	if [ ! -d $(NAD_DIR) ] ; then $(MKDIR) $(NAD_DIR) ; fi
+	if [ ! -d $(CSV_DIR) ] ; then $(MKDIR) $(CSV_DIR) ; fi
+	$(MAKE) $(NAD_DSTFILES) $(CSV_DSTFILES)
 
-$(CSV_DIR): $(CSV_FILES)
-	@ if [ ! -d $@ ] ; then $(MKDIR) $@ ; fi
-	$(INSTALL_DATA) $(CSV_FILES) $@
-	@ touch $@
+$(NAD_DIR)/%: %.lla
+	$(NAD2BIN) < $< $@
 
+$(NT_DSTFILES): $(NAD_DIR)/%: %
+	$(INSTALL_DATA) $< $@
+
+$(CSV_DIR)/%.csv: %.csv
+	$(INSTALL_DATA) $< $@
+
 # Note for future improvement:
-# nad2bin should be compiled from source if we are cross compiling and then the
-# above NAD_TABLES files created during installation rather than compilation
+# To allow for cross-compilation, the above NAD_TABLES files should be
+# created during installation rather than compilation
 
-
 #doxygen:
 DOXNAME=proj

Modified: grass/trunk/locale/Makefile
===================================================================
--- grass/trunk/locale/Makefile	2008-09-17 10:17:35 UTC (rev 33484)
+++ grass/trunk/locale/Makefile	2008-09-17 15:09:28 UTC (rev 33485)
@@ -20,8 +20,8 @@
 	@echo '   make mo         create the *.mo files'
 
 # Directory for installing tcl .msg files:
-MSG_DIR = $(GISBASE)/etc/msgs
-MO_DIR = $(GISBASE)/locale
+MSG_DIR = $(ARCH_DISTDIR)/etc/msgs
+MO_DIR = $(ARCH_DISTDIR)/locale
 PO_DIR = po
 
 #distinguish between library messages and modules:

Modified: grass/trunk/man/Makefile
===================================================================
--- grass/trunk/man/Makefile	2008-09-17 10:17:35 UTC (rev 33484)
+++ grass/trunk/man/Makefile	2008-09-17 15:09:28 UTC (rev 33485)
@@ -4,8 +4,7 @@
 
 # some definitions
 SECT = 1
-MANDIR  = $(GISBASE)/man/man$(SECT)
-HTMLDIR = $(GISBASE)/docs/html
+MANDIR  = $(ARCH_DISTDIR)/man/man$(SECT)
 HTML2MAN = VERSION_NUMBER=${GRASS_VERSION_NUMBER} $(GRASS_HOME)/tools/g.html2man/g.html2man.py
 
 MANPAGES := $(patsubst $(HTMLDIR)/%.html,$(MANDIR)/%.$(SECT),$(wildcard $(HTMLDIR)/*.html))

Modified: grass/trunk/scripts/d.polar/Makefile
===================================================================
--- grass/trunk/scripts/d.polar/Makefile	2008-09-17 10:17:35 UTC (rev 33484)
+++ grass/trunk/scripts/d.polar/Makefile	2008-09-17 15:09:28 UTC (rev 33485)
@@ -5,6 +5,9 @@
 include $(MODULE_TOPDIR)/include/Make/Script.make
 
 default: script
-	$(MKDIR) $(GISBASE)/etc/d.polar/
-	$(INSTALL_DATA) ps_defs.eps $(GISBASE)/etc/d.polar/
+	$(MKDIR) $(ETC)/d.polar/
+	$(MAKE) $(ETC)/d.polar/ps_defs.eps
 
+$(ETC)/d.polar/%: %
+	$(INSTALL_DATA) $< $@
+

Modified: grass/trunk/scripts/i.oif/Makefile
===================================================================
--- grass/trunk/scripts/i.oif/Makefile	2008-09-17 10:17:35 UTC (rev 33484)
+++ grass/trunk/scripts/i.oif/Makefile	2008-09-17 15:09:28 UTC (rev 33485)
@@ -4,6 +4,12 @@
 
 include $(MODULE_TOPDIR)/include/Make/Script.make
 
+SRCFILES = i.oifcalc m.cutmatrix
+DSTFILES := $(patsubst %,$(ETC)/i.oif/%,$(SRCFILES))
+
 default: script
-	$(MKDIR) $(GISBASE)/etc/i.oif/
-	$(INSTALL) i.oifcalc m.cutmatrix $(GISBASE)/etc/i.oif/
+	$(MKDIR) $(ETC)/i.oif/
+	$(MAKE) $(DSTFILES)
+
+$(ETC)/i.oif/%: %
+	$(INSTALL) $< $@

Modified: grass/trunk/scripts/r.in.wms/Makefile
===================================================================
--- grass/trunk/scripts/r.in.wms/Makefile	2008-09-17 10:17:35 UTC (rev 33484)
+++ grass/trunk/scripts/r.in.wms/Makefile	2008-09-17 15:09:28 UTC (rev 33485)
@@ -4,8 +4,12 @@
 
 include $(MODULE_TOPDIR)/include/Make/Script.make
 
+SRCFILES = r.in.gdalwarp wms.request wms.download
+DSTFILES := $(patsubst %,$(ETC)/r.in.wms/%,$(SRCFILES))
+
 default: script
-	$(MKDIR) $(GISBASE)/etc/r.in.wms/
-	for file in r.in.gdalwarp wms.request wms.download ; do \
-		$(INSTALL) $$file $(GISBASE)/etc/r.in.wms/ ; \
-	done
+	$(MKDIR) $(ETC)/r.in.wms/
+	$(MAKE) $(DSTFILES)
+
+$(ETC)/r.in.wms/%: %
+	$(INSTALL) $< $@

Modified: grass/trunk/scripts/v.in.gpsbabel/Makefile
===================================================================
--- grass/trunk/scripts/v.in.gpsbabel/Makefile	2008-09-17 10:17:35 UTC (rev 33484)
+++ grass/trunk/scripts/v.in.gpsbabel/Makefile	2008-09-17 15:09:28 UTC (rev 33485)
@@ -5,4 +5,7 @@
 include $(MODULE_TOPDIR)/include/Make/Script.make
 
 default: script
-	$(INSTALL_DATA) grass_write_ascii.style $(GISBASE)/etc/
+	$(MAKE) $(ETC)/grass_write_ascii.style
+
+$(ETC)/%: %
+	$(INSTALL_DATA) $< $@

Modified: grass/trunk/vector/v.clean/test/Makefile
===================================================================
--- grass/trunk/vector/v.clean/test/Makefile	2008-09-17 10:17:35 UTC (rev 33484)
+++ grass/trunk/vector/v.clean/test/Makefile	2008-09-17 15:09:28 UTC (rev 33485)
@@ -1,8 +1,6 @@
 
 MODULE_TOPDIR = ../../..
 PGM = v.topo.check
-RPOLY = $(GISBASE)/scripts/v.rand.poly
-CTEST = $(GISBASE)/scripts/v.clean.test
 
 LIBES = $(VECTLIB) $(GISLIB)
 DEPENDENCIES = $(VECTDEP) $(GISDEP)
@@ -10,14 +8,8 @@
 EXTRA_CFLAGS = $(VECT_CFLAGS)
 
 include $(MODULE_TOPDIR)/include/Make/Module.make
+include $(MODULE_TOPDIR)/include/Make/ScriptRules.make
 
-default: cmd $(RPOLY) $(CTEST)
-
-$(RPOLY): v.rand.poly
-	if [ ! -d $(GISBASE)/scripts ]; then $(MKDIR) $(GISBASE)/scripts; fi
-	$(INSTALL) v.rand.poly $(RPOLY)
-
-$(CTEST): v.clean.test
-	if [ ! -d $(GISBASE)/scripts ]; then $(MKDIR) $(GISBASE)/scripts; fi
-	$(INSTALL) v.clean.test $(CTEST)
-
+default: cmd
+	$(MAKE) script PGM=v.rand.poly
+	$(MAKE) script PGM=v.clean.test

Modified: grass/trunk/vector/v.digit/Makefile
===================================================================
--- grass/trunk/vector/v.digit/Makefile	2008-09-17 10:17:35 UTC (rev 33484)
+++ grass/trunk/vector/v.digit/Makefile	2008-09-17 15:09:28 UTC (rev 33485)
@@ -11,7 +11,7 @@
 EXTRA_LDFLAGS = $(DFLAGS) 
 EXTRA_INC = $(VECT_INC)
 
-AUXDIR := $(GISBASE)/etc/v.digit
+AUXDIR := $(ARCH_DISTDIR)/etc/v.digit
 TCLFILES := $(patsubst %,$(AUXDIR)/%,$(wildcard *.tcl))
 
 pre: $(AUXDIR)

Modified: grass/trunk/vector/v.in.dwg/Makefile
===================================================================
--- grass/trunk/vector/v.in.dwg/Makefile	2008-09-17 10:17:35 UTC (rev 33484)
+++ grass/trunk/vector/v.in.dwg/Makefile	2008-09-17 15:09:28 UTC (rev 33485)
@@ -1,13 +1,13 @@
 MODULE_TOPDIR = ../..
 
 PGM=v.in.dwg
-ADINIT = $(GISBASE)/etc/adinit.dat
+ADINIT = $(ARCH_DISTDIR)/etc/adinit.dat
 
 DEPENDENCIES = $(VECTDEP) $(DBMIDEP) $(GISDEP)
 LIBES     = $(VECTLIB) $(DBMILIB) $(GISLIB) $(OPENDWGLIBPATH) $(OPENDWGLIB)
 EXTRA_INC = $(VECT_INC) $(OPENDWGINCPATH)
 EXTRA_CFLAGS = $(VECT_CFLAGS)
- 
+
 include $(MODULE_TOPDIR)/include/Make/Module.make
 
 default: chck cmd $(ADINIT)

Modified: grass/trunk/visualization/nviz/Makefile
===================================================================
--- grass/trunk/visualization/nviz/Makefile	2008-09-17 10:17:35 UTC (rev 33484)
+++ grass/trunk/visualization/nviz/Makefile	2008-09-17 15:09:28 UTC (rev 33485)
@@ -7,7 +7,7 @@
 
 VER=2.2
 NV_VER=nviz$(VER)
-INSTALL_DIR=$(GISBASE)/etc/$(NV_VER)
+INSTALL_DIR=$(ETC)/$(NV_VER)
 CLEAN_SUBDIRS = src
 
 SCRIPTS := \
@@ -30,9 +30,9 @@
 install:
 	-$(MKDIR) $(INSTALL_DIR)
 	$(INSTALL) src/nvwish$(EXE) $(INSTALL_DIR)/$(PGM)$(EXE)
-	$(INSTALL) scripts/$(PGM) $(GISBASE)/bin
+	$(INSTALL) scripts/$(PGM) $(BIN)
 ifneq ($(strip $(MINGW)),)
-	$(INSTALL) scripts/nviz.bat $(GISBASE)/bin
+	$(INSTALL) scripts/nviz.bat $(BIN)
 endif
 	-$(MKDIR) $(INSTALL_DIR)/scripts
 	for file in $(SCRIPTS) ; do $(INSTALL) $$file $(INSTALL_DIR)/scripts ; done

Modified: grass/trunk/visualization/nviz/html/Makefile
===================================================================
--- grass/trunk/visualization/nviz/html/Makefile	2008-09-17 10:17:35 UTC (rev 33484)
+++ grass/trunk/visualization/nviz/html/Makefile	2008-09-17 15:09:28 UTC (rev 33485)
@@ -2,16 +2,21 @@
 
 include $(MODULE_TOPDIR)/include/Make/Vars.make
 
-GRASS_NVIZ_DOCS=$(GISBASE)/docs/html/nviz
+GRASS_NVIZ_DOCS=$(ARCH_DISTDIR)/docs/html/nviz
 
+SRCFILES := $(wildcard  *.* img/nv/*.* nvimg/*/*.*)
+DSTFILES := $(patsubst %,$(GRASS_NVIZ_DOCS)/%,$(SRCFILES))
+
 default:
-	-$(MKDIR) $(GISBASE)/docs
-	-$(MKDIR) $(GISBASE)/docs/html
-	-$(MKDIR) $(GISBASE)/docs/html/nviz
+	-$(MKDIR) $(ARCH_DISTDIR)/docs
+	-$(MKDIR) $(ARCH_DISTDIR)/docs/html
+	-$(MKDIR) $(GRASS_NVIZ_DOCS)
 	-$(MKDIR) $(GRASS_NVIZ_DOCS)/img
 	-$(MKDIR) $(GRASS_NVIZ_DOCS)/img/nv
 	-$(MKDIR) $(GRASS_NVIZ_DOCS)/nvimg
 	-$(MKDIR) $(GRASS_NVIZ_DOCS)/nvimg/panel
 	-$(MKDIR) $(GRASS_NVIZ_DOCS)/nvimg/work
-	find -L . -type f \( -name '*.html' -o -name '*.png' -o -name '*.gif' \) -print | \
-		while read file ; do $(INSTALL_DATA) $$file $(GRASS_NVIZ_DOCS)/$$file ; done
+	$(MAKE) $(DSTFILES)
+
+$(GRASS_NVIZ_DOCS)/%: %
+	$(INSTALL_DATA) $< $@



More information about the grass-commit mailing list