[GRASS-SVN] r34545 - in grass/trunk: . db gem general/g.version gui/images gui/wxpython gui/wxpython/nviz gui/wxpython/scripts lib/symbol ps/ps.map raster/r.li/r.li.setup scripts/d.polar scripts/db.test scripts/r.in.wms visualization/nviz visualization/nviz/html

svn_grass at osgeo.org svn_grass at osgeo.org
Thu Nov 27 15:28:33 EST 2008


Author: glynn
Date: 2008-11-27 15:28:33 -0500 (Thu, 27 Nov 2008)
New Revision: 34545

Modified:
   grass/trunk/Makefile
   grass/trunk/db/Makefile
   grass/trunk/gem/Makefile
   grass/trunk/general/g.version/Makefile
   grass/trunk/gui/images/Makefile
   grass/trunk/gui/wxpython/Makefile
   grass/trunk/gui/wxpython/nviz/Makefile
   grass/trunk/gui/wxpython/scripts/Makefile
   grass/trunk/lib/symbol/Makefile
   grass/trunk/ps/ps.map/Makefile
   grass/trunk/raster/r.li/r.li.setup/Makefile
   grass/trunk/scripts/d.polar/Makefile
   grass/trunk/scripts/db.test/Makefile
   grass/trunk/scripts/r.in.wms/Makefile
   grass/trunk/visualization/nviz/Makefile
   grass/trunk/visualization/nviz/html/Makefile
Log:
Don't create directories or install files if they already exist and haven't changed


Modified: grass/trunk/Makefile
===================================================================
--- grass/trunk/Makefile	2008-11-27 19:10:51 UTC (rev 34544)
+++ grass/trunk/Makefile	2008-11-27 20:28:33 UTC (rev 34545)
@@ -58,6 +58,7 @@
 SUBDIRS = $(DIRS)
 
 FILES = AUTHORS COPYING CHANGES REQUIREMENTS.html GPL.TXT
+FILES_DST = $(patsubst %,${ARCH_DISTDIR}/%,$(FILES))
 
 # why no locale directory?
 BIN_DIST_FILES = $(FILES) \
@@ -84,8 +85,8 @@
 	for subdir in $$list; do \
 		$(MAKE) -C $$subdir; \
 	done
-	-cp -f $(FILES) ${ARCH_DISTDIR}/
-	-cp -f ${ARCH_BINDIR}/grass${GRASS_VERSION_MAJOR}${GRASS_VERSION_MINOR} ${ARCH_DISTDIR}/grass${GRASS_VERSION_MAJOR}${GRASS_VERSION_MINOR}.tmp
+	$(MAKE) $(FILES_DST)
+	$(MAKE) ${ARCH_BINDIR}/grass${GRASS_VERSION_MAJOR}${GRASS_VERSION_MINOR}
 	@if [ `cat "$(ERRORLOG)" | wc -l` -gt 5 ] ; then \
 		echo "--"     >> $(ERRORLOG) ; \
 		echo "In case of errors please change into the directory with error and run 'make'." >> $(ERRORLOG) ; \
@@ -100,6 +101,12 @@
 	@cat $(ERRORLOG)
 	@if [ `cat "$(ERRORLOG)" | wc -l` -gt 8 ] ; then false ; else true ; fi
 
+${ARCH_DISTDIR}/%: %
+	$(INSTALL_DATA) $< $@
+
+${ARCH_BINDIR}/grass${GRASS_VERSION_MAJOR}${GRASS_VERSION_MINOR}: ${ARCH_DISTDIR}/grass${GRASS_VERSION_MAJOR}${GRASS_VERSION_MINOR}.tmp
+	$(INSTALL) $< $@
+
 LIBDIRS = \
 	lib/external/shapelib \
 	lib/datetime \

Modified: grass/trunk/db/Makefile
===================================================================
--- grass/trunk/db/Makefile	2008-11-27 19:10:51 UTC (rev 34544)
+++ grass/trunk/db/Makefile	2008-11-27 20:28:33 UTC (rev 34545)
@@ -2,7 +2,6 @@
 MODULE_TOPDIR = ..
 
 SUBDIRS = \
-	drivers \
 	db.columns \
 	db.connect \
 	db.copy \
@@ -23,5 +22,7 @@
 
 default: htmldir
 
-htmldir: subdirs
+htmldir:
+	$(MAKE) -C drivers
+	$(MAKE) parsubdirs
 

Modified: grass/trunk/gem/Makefile
===================================================================
--- grass/trunk/gem/Makefile	2008-11-27 19:10:51 UTC (rev 34544)
+++ grass/trunk/gem/Makefile	2008-11-27 20:28:33 UTC (rev 34545)
@@ -29,9 +29,11 @@
 	actions.o \
 	main.o
 
-default: $(SRCS) $(HDRS) $(OBJS)
-	$(CC) $(OBJS) -o gem7 $(CFLAGS) $(CLIBS) $(LDFLAGS)
+default: gem7
 
+gem7: $(SRCS) $(HDRS) $(OBJS)
+	$(CC) $(OBJS) -o $@ $(CFLAGS) $(CLIBS) $(LDFLAGS)
+
 %.o: %.c
 	$(CC) $(CFLAGS) $(CPPFLAGS) -o $@ -c $<
 

Modified: grass/trunk/general/g.version/Makefile
===================================================================
--- grass/trunk/general/g.version/Makefile	2008-11-27 19:10:51 UTC (rev 34544)
+++ grass/trunk/general/g.version/Makefile	2008-11-27 20:28:33 UTC (rev 34545)
@@ -4,8 +4,8 @@
 
 # cat the COPYING file, add a c line-break \n at each line end
 # and remove the unix newline. 
-COPYING=`cat ./../../COPYING | sed -f sed.script | tr -d '\012'`
-GRASS_CONFIGURE_PARAMS=`head -n 7 ./../../config.status | tail -n 1 | tr -d '\012'`
+COPYING := $(shell cat ./../../COPYING | sed -f sed.script | tr -d '\012')
+GRASS_CONFIGURE_PARAMS := $(shell head -n 7 ./../../config.status | tail -n 1 | tr -d '\012')
 
 EXTRA_CFLAGS=-DGRASS_VERSION_NUMBER=\"'$(GRASS_VERSION_NUMBER)'\" -DGRASS_VERSION_DATE=\"'$(GRASS_VERSION_DATE)'\" -DGRASS_VERSION_UPDATE_PKG=\"'$(GRASS_VERSION_UPDATE_PKG)'\"  -DGRASS_CONFIGURE_PARAMS="\"$(GRASS_CONFIGURE_PARAMS)\"" -DCOPYING="\"$(COPYING)\""
 
@@ -14,9 +14,10 @@
 
 include $(MODULE_TOPDIR)/include/Make/Module.make
 
-default: cmd COPYING GRASS_CONFIGURE_PARAMS
+default: cmd $(GRASS_VERSION_FILE) $(GRASS_BUILD_FILE)
 
-COPYING:
-	cat ./../../COPYING | sed -f sed.script | tr -d '\012' > $(GRASS_VERSION_FILE)
-GRASS_CONFIGURE_PARAMS:
-	head -n 7 ./../../config.status | tail -n 1 | sed 's+#++1' | tr -d '\012' > $(GRASS_BUILD_FILE)
+$(GRASS_VERSION_FILE): $(MODULE_TOPDIR)/COPYING
+	cat $< | sed -f sed.script | tr -d '\012' > $@
+
+$(GRASS_BUILD_FILE): $(MODULE_TOPDIR)/config.status
+	head -n 7 $< | tail -n 1 | sed 's+#++1' | tr -d '\012' > $@

Modified: grass/trunk/gui/images/Makefile
===================================================================
--- grass/trunk/gui/images/Makefile	2008-11-27 19:10:51 UTC (rev 34544)
+++ grass/trunk/gui/images/Makefile	2008-11-27 20:28:33 UTC (rev 34545)
@@ -5,5 +5,8 @@
 default:
 	if [ ! -d $(ETC)/gui ] ; then $(MKDIR) $(ETC)/gui ; fi
 	if [ ! -d $(ETC)/gui/images ] ; then $(MKDIR) $(ETC)/gui/images ; fi
-	$(INSTALL_DATA) startup_banner.png $(ETC)/gui/images/startup_banner.png
+	$(MAKE) $(ETC)/gui/images/startup_banner.png
 
+$(ETC)/gui/images/%: %
+	$(INSTALL_DATA) $< $@
+

Modified: grass/trunk/gui/wxpython/Makefile
===================================================================
--- grass/trunk/gui/wxpython/Makefile	2008-11-27 19:10:51 UTC (rev 34544)
+++ grass/trunk/gui/wxpython/Makefile	2008-11-27 20:28:33 UTC (rev 34545)
@@ -13,9 +13,9 @@
 	$(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
+	-for dir in '' compat gui_modules icons icons/silk images scripts vdigit xml nviz ; do \
+	if [ ! -d $(ETCDIR)/$$dir ] ; then $(MKDIR) $(ETCDIR)/$$dir ; fi ; \
+	done
 	$(MAKE) $(DSTFILES)
 
 $(ETCDIR)/scripts/wxgui: wxgui
@@ -26,3 +26,4 @@
 
 $(ETCDIR)/%: %
 	$(INSTALL_DATA) $< $@
+

Modified: grass/trunk/gui/wxpython/nviz/Makefile
===================================================================
--- grass/trunk/gui/wxpython/nviz/Makefile	2008-11-27 19:10:51 UTC (rev 34544)
+++ grass/trunk/gui/wxpython/nviz/Makefile	2008-11-27 20:28:33 UTC (rev 34545)
@@ -47,6 +47,14 @@
 	$(SHLIB_LD) -o $@ $(LDFLAGS) $^ $(EXTRA_LIBS)
 endif
 
-install_nviz: $(SHLIB) $(LIB_NAME).py
-	$(INSTALL) $(SHLIB) $(ETCDIR)/nviz
-	$(INSTALL_DATA) $(LIB_NAME).py $(ETCDIR)/nviz
+install_nviz:
+	$(MAKE) $(ETCDIR)/nviz/_$(LIB_NAME).so $(ETCDIR)/nviz/$(LIB_NAME).py
+
+$(ETCDIR)/nviz/_$(LIB_NAME).so: $(SHLIB)
+	$(INSTALL) $< $@
+
+$(ETCDIR)/nviz/$(LIB_NAME).py: $(LIB_NAME).py
+	$(INSTALL_DATA) $< $@
+
+.PHONY: install_nviz
+

Modified: grass/trunk/gui/wxpython/scripts/Makefile
===================================================================
--- grass/trunk/gui/wxpython/scripts/Makefile	2008-11-27 19:10:51 UTC (rev 34544)
+++ grass/trunk/gui/wxpython/scripts/Makefile	2008-11-27 20:28:33 UTC (rev 34545)
@@ -7,6 +7,9 @@
 default: install_scripts
 
 install_scripts:
-	$(MKDIR) $(ETCDIR)
-	$(INSTALL) d.rast3d $(ETCDIR)/
+	if [ ! -d $(ETCDIR) ] ; then $(MKDIR) $(ETCDIR) ; fi
+	$(MAKE) $(ETCDIR)/d.rast3d
 
+$(ETCDIR)/%: %
+	$(INSTALL) $< $@
+

Modified: grass/trunk/lib/symbol/Makefile
===================================================================
--- grass/trunk/lib/symbol/Makefile	2008-11-27 19:10:51 UTC (rev 34544)
+++ grass/trunk/lib/symbol/Makefile	2008-11-27 20:28:33 UTC (rev 34545)
@@ -6,20 +6,22 @@
 
 include $(MODULE_TOPDIR)/include/Make/Lib.make
 
-default: lib symb
+SYMBOL_SRC := $(wildcard symbol/*/*)
+SYMBOL_DST := $(patsubst symbol/%,$(ETC)/symbol/%,$(SYMBOL_SRC))
 
-symb:
+default: lib
+	$(MAKE) dirs
+	$(MAKE) symb
+
+dirs:
 	if [ ! -d $(ETC)/symbol ]; then $(MKDIR) $(ETC)/symbol ; fi
 	if [ ! -d $(ETC)/symbol/demo ]; then $(MKDIR) $(ETC)/symbol/demo ; fi
 	if [ ! -d $(ETC)/symbol/basic ]; then $(MKDIR) $(ETC)/symbol/basic ; fi
 	if [ ! -d $(ETC)/symbol/extra ]; then $(MKDIR) $(ETC)/symbol/extra ; fi
-	@# check for file type to avoid problems with CVS/ directory:
-	for file in symbol/demo/* ; do \
-		[ -f "$$file" ] && $(INSTALL_DATA) $$file $(ETC)/symbol/demo ; \
-	done
-	for file in symbol/basic/* ; do \
-		[ -f "$$file" ] && $(INSTALL_DATA) $$file $(ETC)/symbol/basic ; \
-	done
-	for file in symbol/extra/* ; do \
-		[ -f "$$file" ] && $(INSTALL_DATA) $$file $(ETC)/symbol/extra ; \
-	done
+
+symb:	$(SYMBOL_DST)
+
+$(ETC)/symbol/%: symbol/%
+	$(INSTALL_DATA) $< $@
+
+.PHONY: dirs symb

Modified: grass/trunk/ps/ps.map/Makefile
===================================================================
--- grass/trunk/ps/ps.map/Makefile	2008-11-27 19:10:51 UTC (rev 34544)
+++ grass/trunk/ps/ps.map/Makefile	2008-11-27 20:28:33 UTC (rev 34545)
@@ -17,12 +17,14 @@
 default: cmd $(PROLOG) patt
 
 $(PROLOG): prolog.ps
-	$(MKDIR) $(ETC)/paint
+	if [ ! -d $(ETC)/paint ] ; then $(MKDIR) $(ETC)/paint ; fi
 	$(INSTALL_DATA) $< $@
 
 patt:
-	$(MKDIR) $(ETC)/paint/patterns/
+	if [ ! -d $(ETC)/paint/patterns ] ; then $(MKDIR) $(ETC)/paint/patterns ; fi
 	$(MAKE) $(DSTPAT)
 
 $(ETC)/paint/patterns/%.eps: patterns/%.eps
 	$(INSTALL_DATA) $< $@
+
+.PHONY: patt

Modified: grass/trunk/raster/r.li/r.li.setup/Makefile
===================================================================
--- grass/trunk/raster/r.li/r.li.setup/Makefile	2008-11-27 19:10:51 UTC (rev 34544)
+++ grass/trunk/raster/r.li/r.li.setup/Makefile	2008-11-27 20:28:33 UTC (rev 34545)
@@ -6,17 +6,28 @@
 
 include $(MODULE_TOPDIR)/include/Make/Script.make
 
+SCRIPT_SRC = \
+	area_query \
+	masked_area_selection \
+	r.li.setup.main \
+	r.li.setup.procedures.tcl \
+	r.li.windows.tcl \
+	sample_area_vector.sh \
+	square_mouse_selection.sh \
+	square_query
+
+SCRIPT_DST := $(patsubst %,$(TARGET)/%,$(SCRIPT_SRC))
+
+DATA_SRC = circle.txt polygon.txt
+
+DATA_DST := $(patsubst %,$(TARGET)/%,$(DATA_SRC))
+
 default: script
-	$(MKDIR) $(TARGET)
-	$(INSTALL) area_query $(TARGET)/area_query
-	$(INSTALL) masked_area_selection $(TARGET)/masked_area_selection
-	$(INSTALL) r.li.setup.main $(TARGET)/r.li.setup.main
-	$(INSTALL) r.li.setup.procedures.tcl $(TARGET)/r.li.setup.procedures.tcl
-	$(INSTALL) r.li.windows.tcl $(TARGET)/r.li.windows.tcl
-	$(INSTALL) sample_area_vector.sh $(TARGET)/sample_area_vector.sh
-	$(INSTALL) square_mouse_selection.sh $(TARGET)/square_mouse_selection.sh
-	$(INSTALL) square_query $(TARGET)/square_query
-	$(INSTALL_DATA) circle.txt $(TARGET)/circle.txt
-	$(INSTALL_DATA) polygon.txt $(TARGET)/polygon.txt
+	if [ ! -d $(TARGET) ] ; then $(MKDIR) $(TARGET) ; fi
+	$(MAKE) $(SCRIPT_DST) $(DATA_DST)
 
+$(TARGET)/%.txt: %.txt
+	$(INSTALL_DATA) $< $@
 
+$(TARGET)/%: %
+	$(INSTALL) $< $@

Modified: grass/trunk/scripts/d.polar/Makefile
===================================================================
--- grass/trunk/scripts/d.polar/Makefile	2008-11-27 19:10:51 UTC (rev 34544)
+++ grass/trunk/scripts/d.polar/Makefile	2008-11-27 20:28:33 UTC (rev 34545)
@@ -5,7 +5,7 @@
 include $(MODULE_TOPDIR)/include/Make/Script.make
 
 default: script
-	$(MKDIR) $(ETC)/d.polar/
+	if [ ! -d $(ETC)/d.polar ] ; then $(MKDIR) $(ETC)/d.polar ; fi
 	$(MAKE) $(ETC)/d.polar/ps_defs.eps
 
 $(ETC)/d.polar/%: %

Modified: grass/trunk/scripts/db.test/Makefile
===================================================================
--- grass/trunk/scripts/db.test/Makefile	2008-11-27 19:10:51 UTC (rev 34544)
+++ grass/trunk/scripts/db.test/Makefile	2008-11-27 20:28:33 UTC (rev 34545)
@@ -4,8 +4,14 @@
 
 include $(MODULE_TOPDIR)/include/Make/Script.make
 
+TEST_SRC := $(wildcard test*)
+TEST_DST := $(patsubst %,$(ETC)/db.test/%,$(TEST_SRC))
+
 default: script tests
 
 tests:
 	if [ ! -d $(ETC)/db.test ]; then $(MKDIR) $(ETC)/db.test; fi
-	$(INSTALL_DATA) test* $(ETC)/db.test/
+	$(MAKE) $(TEST_DST)
+
+$(ETC)/db.test/%: %
+	$(INSTALL_DATA) $< $@

Modified: grass/trunk/scripts/r.in.wms/Makefile
===================================================================
--- grass/trunk/scripts/r.in.wms/Makefile	2008-11-27 19:10:51 UTC (rev 34544)
+++ grass/trunk/scripts/r.in.wms/Makefile	2008-11-27 20:28:33 UTC (rev 34545)
@@ -8,7 +8,7 @@
 DSTFILES := $(patsubst %,$(ETC)/r.in.wms/%,$(SRCFILES))
 
 default: script
-	$(MKDIR) $(ETC)/r.in.wms/
+	if [ ! -d $(ETC)/r.in.wms ] ; then $(MKDIR) $(ETC)/r.in.wms ; fi
 	$(MAKE) $(DSTFILES)
 
 $(ETC)/r.in.wms/%: %

Modified: grass/trunk/visualization/nviz/Makefile
===================================================================
--- grass/trunk/visualization/nviz/Makefile	2008-11-27 19:10:51 UTC (rev 34544)
+++ grass/trunk/visualization/nviz/Makefile	2008-11-27 20:28:33 UTC (rev 34545)
@@ -19,7 +19,11 @@
 	scripts/$(NV_VER)_script \
 	$(wildcard scripts/*.tcl) \
 	$(wildcard scripts/*Index)
+SCRIPT_DST := $(patsubst scripts/%,$(INSTALL_DIR)/scripts/%,$(SCRIPTS))
 
+BITMAPS := $(filter-out flythrough,$(wildcard bitmaps/*)) $(wildcard bitmaps/flythrough/*.gif)
+BITMAP_DST := $(patsubst bitmaps/%,$(INSTALL_DIR)/bitmaps/%,$(BITMAPS))
+
 ifneq ($(USE_OPENGL),)
 ifneq ($(strip $(TCLTKLIBS)),)
 default:
@@ -32,15 +36,31 @@
 
 # Install the scripts in the appropriate directory
 install:
-	-$(MKDIR) $(INSTALL_DIR)
-	$(INSTALL) src/nvwish$(EXE) $(INSTALL_DIR)/$(PGM)$(EXE)
-	$(INSTALL) scripts/$(PGM) $(BIN)
+	-if [ ! -d $(INSTALL_DIR) ] ; then $(MKDIR) $(INSTALL_DIR) ; fi
+	$(MAKE) $(INSTALL_DIR)/$(PGM)$(EXE)
+	$(MAKE) $(BIN)/$(PGM)
 ifneq ($(strip $(MINGW)),)
-	$(INSTALL) scripts/nviz.bat $(BIN)
+	$(MAKE) $(BIN)/nviz.bat
 endif
-	-$(MKDIR) $(INSTALL_DIR)/scripts
-	for file in $(SCRIPTS) ; do $(INSTALL) $$file $(INSTALL_DIR)/scripts ; done
-	-$(MKDIR) $(INSTALL_DIR)/bitmaps
-	-$(MKDIR) $(INSTALL_DIR)/bitmaps/flythrough
-	find -L bitmaps -path '*/.svn' -prune -o -type f -print | \
-		while read file ; do $(INSTALL_DATA) $$file $(INSTALL_DIR)/$$file ; done
+	-if [ ! -d $(INSTALL_DIR)/scripts ] ; then $(MKDIR) $(INSTALL_DIR)/scripts ; fi
+	$(MAKE) $(SCRIPT_DST)
+	-if [ ! -d $(INSTALL_DIR)/bitmaps ] ; then $(MKDIR) $(INSTALL_DIR)/bitmaps ; fi
+	-if [ ! -d $(INSTALL_DIR)/bitmaps/flythrough ] ; then $(MKDIR) $(INSTALL_DIR)/bitmaps/flythrough ; fi
+	$(MAKE) $(BITMAP_DST)
+
+$(INSTALL_DIR)/$(PGM)$(EXE): src/nvwish$(EXE)
+	$(INSTALL) $< $@
+
+$(BIN)/$(PGM): scripts/$(PGM)
+	$(INSTALL) $< $@
+
+$(BIN)/nviz.bat: scripts/nviz.bat
+	$(INSTALL) $< $@
+
+$(INSTALL_DIR)/scripts/%: scripts/%
+	$(INSTALL) $< $@
+
+$(INSTALL_DIR)/bitmaps/%: bitmaps/%
+	$(INSTALL_DATA) $< $@
+
+.PHONY: install

Modified: grass/trunk/visualization/nviz/html/Makefile
===================================================================
--- grass/trunk/visualization/nviz/html/Makefile	2008-11-27 19:10:51 UTC (rev 34544)
+++ grass/trunk/visualization/nviz/html/Makefile	2008-11-27 20:28:33 UTC (rev 34545)
@@ -8,14 +8,11 @@
 DSTFILES := $(patsubst %,$(GRASS_NVIZ_DOCS)/%,$(SRCFILES))
 
 default:
-	-$(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
+	-if [ ! -d $(ARCH_DISTDIR)/docs ] ; then $(MKDIR) $(ARCH_DISTDIR)/docs ; fi
+	-if [ ! -d $(ARCH_DISTDIR)/docs/html ] ; then $(MKDIR) $(ARCH_DISTDIR)/docs/html ; fi
+	-for dir in '' img img/nv nvimg nvimg/panel nvimg/work ; do \
+	if [ ! -d $(GRASS_NVIZ_DOCS)/$$dir ] ; then $(MKDIR) $(GRASS_NVIZ_DOCS)/$$dir ; fi \
+	done
 	$(MAKE) $(DSTFILES)
 
 $(GRASS_NVIZ_DOCS)/%: %



More information about the grass-commit mailing list