[GRASS-SVN] r39655 - in grass/trunk: general/g.mapsets general/manage/lister gui/icons gui/images gui/scripts gui/wxpython gui/wxpython/scripts include/Make lib lib/external/bwidget lib/form lib/gis lib/gtcltk lib/proj lib/python lib/symbol lib/vector/dglib lib/vector/rtree ps/ps.map raster/r.li/r.li.setup scripts/d.polar scripts/db.test scripts/r.in.wms swig/python visualization/nviz visualization/nviz/html

svn_grass at osgeo.org svn_grass at osgeo.org
Sat Oct 31 16:07:25 EDT 2009


Author: glynn
Date: 2009-10-31 16:07:25 -0400 (Sat, 31 Oct 2009)
New Revision: 39655

Modified:
   grass/trunk/general/g.mapsets/Makefile
   grass/trunk/general/manage/lister/Makefile
   grass/trunk/gui/icons/Makefile
   grass/trunk/gui/images/Makefile
   grass/trunk/gui/scripts/Makefile
   grass/trunk/gui/wxpython/Makefile
   grass/trunk/gui/wxpython/scripts/Makefile
   grass/trunk/include/Make/Compile.make
   grass/trunk/lib/Makefile
   grass/trunk/lib/external/bwidget/Makefile
   grass/trunk/lib/form/Makefile
   grass/trunk/lib/gis/Makefile
   grass/trunk/lib/gtcltk/Makefile
   grass/trunk/lib/proj/Makefile
   grass/trunk/lib/python/Makefile
   grass/trunk/lib/symbol/Makefile
   grass/trunk/lib/vector/dglib/Makefile
   grass/trunk/lib/vector/rtree/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/swig/python/Makefile
   grass/trunk/visualization/nviz/Makefile
   grass/trunk/visualization/nviz/html/Makefile
Log:
Treat destination directories as targets


Modified: grass/trunk/general/g.mapsets/Makefile
===================================================================
--- grass/trunk/general/g.mapsets/Makefile	2009-10-31 20:05:02 UTC (rev 39654)
+++ grass/trunk/general/g.mapsets/Makefile	2009-10-31 20:07:25 UTC (rev 39655)
@@ -11,8 +11,8 @@
 
 default: cmd $(GUI)
 
-$(ETC)/gui/scripts/%: %
-	if [ ! -d $(ETC) ]; then $(MKDIR) $(ETC); fi
-	if [ ! -d $(ETC)/gui ]; then $(MKDIR) $(ETC)/gui; fi
-	if [ ! -d $(ETC)/gui/scripts ]; then $(MKDIR) $(ETC)/gui/scripts; fi
+$(ETC)/gui/scripts/%: % | $(ETC)/gui/scripts
 	$(INSTALL) $< $@
+
+$(ETC)/gui/scripts:
+	$(MKDIR) $@

Modified: grass/trunk/general/manage/lister/Makefile
===================================================================
--- grass/trunk/general/manage/lister/Makefile	2009-10-31 20:05:02 UTC (rev 39654)
+++ grass/trunk/general/manage/lister/Makefile	2009-10-31 20:07:25 UTC (rev 39655)
@@ -7,24 +7,10 @@
 
 include $(MODULE_TOPDIR)/include/Make/Module.make
 
-PGM1=cell
-PGM2=vector
-
 default: $(ETC)/lister/cell $(ETC)/lister/vector
 
-ifneq ($(BROKEN_MAKE),)
-$(ETC)/lister/cell: $(OBJDIR)/cell.o $(ETC)/lister
-else
-$(ETC)/lister/cell: $(OBJDIR)/cell.o | $(ETC)/lister
-endif
-	$(CC) $(LDFLAGS) -o $@ $(OBJDIR)/cell.o $(FMODE_OBJ) $(LIST) $(LIBES) $(MATHLIB) $(XDRLIB)
+$(ETC)/lister/%: $(OBJDIR)/%.o | $(ETC)/lister
+	$(CC) $(LDFLAGS) -o $@ $< $(FMODE_OBJ) $(LIST) $(LIBES) $(MATHLIB) $(XDRLIB)
 
-ifneq ($(BROKEN_MAKE),)
-$(ETC)/lister/vector: $(OBJDIR)/vector.o $(ETC)/lister
-else
-$(ETC)/lister/vector: $(OBJDIR)/vector.o | $(ETC)/lister
-endif
-	$(CC) $(LDFLAGS) -o $@ $(OBJDIR)/vector.o $(FMODE_OBJ) $(LIST) $(LIBES) $(MATHLIB) $(XDRLIB)
-
 $(ETC)/lister:
-	$(MKDIR) $(ETC)/lister
+	$(MKDIR) $@

Modified: grass/trunk/gui/icons/Makefile
===================================================================
--- grass/trunk/gui/icons/Makefile	2009-10-31 20:05:02 UTC (rev 39654)
+++ grass/trunk/gui/icons/Makefile	2009-10-31 20:07:25 UTC (rev 39655)
@@ -7,25 +7,28 @@
 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
-	if [ ! -d $(ETC)/gui/icons/grass2 ] ; then $(MKDIR) $(ETC)/gui/icons/grass2 ; fi
-	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
-	if [ ! -d $(HTMLDIR)/icons/grass2 ] ; then $(MKDIR) $(HTMLDIR)/icons/grass2 ; fi
-	$(MAKE) $(ETCICONS)
-	$(MAKE) $(HTMLICONS)
+ETCDIRS = \
+	$(ETC)/gui \
+	$(ETC)/gui/icons \
+	$(ETC)/gui/icons/grass \
+	$(ETC)/gui/icons/grass/vdigit \
+	$(ETC)/gui/icons/silk \
+	$(ETC)/gui/icons/grass2
 
-$(ETC)/gui/icons/%: %
+HTMLDIRS = \
+	$(HTMLDIR)/icons \
+	$(HTMLDIR)/icons/grass \
+	$(HTMLDIR)/icons/grass/vdigit \
+	$(HTMLDIR)/icons/silk \
+	$(HTMLDIR)/icons/grass2
+
+default: $(ICONS) $(ETCICONS) $(HTMLICONS)
+
+$(ETC)/gui/icons/%: % | $(ETCDIRS)
 	$(INSTALL_DATA) $< $@
 
-$(HTMLDIR)/icons/%: %
+$(HTMLDIR)/icons/%: % | $(HTMLDIRS)
 	$(INSTALL_DATA) $< $@
+
+$(ETCDIRS) $(HTMLDIRS): %:
+	$(MKDIR) $@

Modified: grass/trunk/gui/images/Makefile
===================================================================
--- grass/trunk/gui/images/Makefile	2009-10-31 20:05:02 UTC (rev 39654)
+++ grass/trunk/gui/images/Makefile	2009-10-31 20:07:25 UTC (rev 39655)
@@ -3,10 +3,10 @@
 include $(MODULE_TOPDIR)/include/Make/Dir.make
 
 default:
-	if [ ! -d $(ETC)/gui ] ; then $(MKDIR) $(ETC)/gui ; fi
-	if [ ! -d $(ETC)/gui/images ] ; then $(MKDIR) $(ETC)/gui/images ; fi
 	$(MAKE) $(ETC)/gui/images/startup_banner.png
 
-$(ETC)/gui/images/%: %
+$(ETC)/gui/images/%: % | $(ETC)/gui/images
 	$(INSTALL_DATA) $< $@
 
+$(ETC)/gui/images:
+	$(MKDIR) $@

Modified: grass/trunk/gui/scripts/Makefile
===================================================================
--- grass/trunk/gui/scripts/Makefile	2009-10-31 20:05:02 UTC (rev 39654)
+++ grass/trunk/gui/scripts/Makefile	2009-10-31 20:07:25 UTC (rev 39655)
@@ -2,14 +2,13 @@
 
 include $(MODULE_TOPDIR)/include/Make/Dir.make
 
-# FIXME: adjust so SRCFILES doesn't install windows_launch.bat
 SRCFILES := $(wildcard *.*)
 DSTFILES := $(patsubst %,$(ETC)/gui/scripts/%,$(SRCFILES))
 
-default:
-	if [ ! -d $(ETC)/gui ] ; then $(MKDIR) $(ETC)/gui ; fi
-	if [ ! -d $(ETC)/gui/scripts ] ; then $(MKDIR) $(ETC)/gui/scripts ; fi
-	$(MAKE) $(DSTFILES)
+default: $(DSTFILES)
 
-$(ETC)/gui/scripts/%: %
+$(ETC)/gui/scripts/%: % | $(ETC)/gui/scripts
 	$(INSTALL) $< $@
+
+$(ETC)/gui/scripts:
+	$(MKDIR) $@

Modified: grass/trunk/gui/wxpython/Makefile
===================================================================
--- grass/trunk/gui/wxpython/Makefile	2009-10-31 20:05:02 UTC (rev 39654)
+++ grass/trunk/gui/wxpython/Makefile	2009-10-31 20:07:25 UTC (rev 39655)
@@ -13,22 +13,23 @@
 SRCFILES := $(wildcard scripts/p.* compat/* gui_modules/* icons/*.* icons/silk/* images/* xml/*) gis_set.py wxgui.py README
 DSTFILES := $(patsubst %,$(ETCDIR)/%,$(SRCFILES)) $(patsubst %.py,$(ETCDIR)/%.pyc,$(filter %.py,$(SRCFILES)))
 
-default: install_scripts
+DSTDIRS := $(patsubst %,$(ETCDIR)/%,compat gui_modules icons icons/silk images scripts vdigit xml nviz)
+
+default: $(DSTFILES) menustrings.py
 	$(MAKE) parsubdirs
 
-install_scripts:
-	-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)
-	$(MAKE) menustrings.py
-
-$(ETCDIR)/%: %
+$(ETCDIR)/%: % | $(DSTDIRS)
 	$(INSTALL_DATA) $< $@
 
 menustrings.py: gui_modules/menudata.py xml/menudata.xml
 	GISBASE="$(GISBASE)" \
 	$(PYTHON) $< > $@
 
+$(DSTDIRS): %: | $(ETCDIR)
+	$(MKDIR) $@
+
+$(ETCDIR):
+	$(MKDIR) $@
+
 #doxygen:
 DOXNAME=wxpython

Modified: grass/trunk/gui/wxpython/scripts/Makefile
===================================================================
--- grass/trunk/gui/wxpython/scripts/Makefile	2009-10-31 20:05:02 UTC (rev 39654)
+++ grass/trunk/gui/wxpython/scripts/Makefile	2009-10-31 20:07:25 UTC (rev 39655)
@@ -7,11 +7,12 @@
 default: install_scripts
 
 install_scripts:
-	if [ ! -d $(ETC)/gui ] ; then $(MKDIR) $(ETC)/gui ; fi
-	if [ ! -d $(ETCDIR) ] ; then $(MKDIR) $(ETCDIR) ; fi
 	$(MAKE) $(ETCDIR)/d.rast3d
 
-$(ETCDIR)/%: %
+$(ETCDIR)/%: % | $(ETC)/gui
 	$(INSTALL) $< $@
 
+$(ETC)/gui:
+	$(MKDIR) $@
+
 clean: cleansubdirs

Modified: grass/trunk/include/Make/Compile.make
===================================================================
--- grass/trunk/include/Make/Compile.make	2009-10-31 20:05:02 UTC (rev 39654)
+++ grass/trunk/include/Make/Compile.make	2009-10-31 20:07:25 UTC (rev 39655)
@@ -15,8 +15,6 @@
 compiler = $(call compiler_x,$(CC))
 
 # default cc rules
-ifeq ($(BROKEN_MAKE),)
-
 $(OBJDIR)/%.o : %.c $(LOCAL_HEADERS) $(EXTRA_HEADERS) | $(OBJDIR)
 	$(call compiler_c)
 
@@ -26,22 +24,6 @@
 $(OBJDIR)/%.o : %.cpp $(LOCAL_HEADERS) $(EXTRA_HEADERS) | $(OBJDIR)
 	$(call compiler_cxx)
 
-else
-
-$(OBJDIR)/%.o : %.c $(LOCAL_HEADERS) $(EXTRA_HEADERS)
-	$(MAKE) $(OBJDIR)
-	$(call compiler_c)
-
-$(OBJDIR)/%.o : %.cc $(LOCAL_HEADERS) $(EXTRA_HEADERS)
-	$(MAKE) $(OBJDIR)
-	$(call compiler_cxx)
-
-$(OBJDIR)/%.o : %.cpp $(LOCAL_HEADERS) $(EXTRA_HEADERS)
-	$(MAKE) $(OBJDIR)
-	$(call compiler_cxx)
-
-endif
-
 # default parser generation rules, include prefix for files/vars
 %.yy.c: %.l
 	$(LEX) $(LFLAGS) -t $< > $@

Modified: grass/trunk/lib/Makefile
===================================================================
--- grass/trunk/lib/Makefile	2009-10-31 20:05:02 UTC (rev 39654)
+++ grass/trunk/lib/Makefile	2009-10-31 20:07:25 UTC (rev 39655)
@@ -56,20 +56,26 @@
 SRCMAKE := $(wildcard ../include/Make/*.make)
 DSTMAKE := $(patsubst ../include/Make/%.make,$(ARCH_DISTDIR)/include/Make/%.make,$(SRCMAKE))
 
-default: headers
+default: $(DSTH) $(DSTMAKE)
 	$(MAKE) subdirs
 
-headers: 
-	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_DISTDIR)/include:
+	$(MKDIR) $@
 
-$(ARCH_INCDIR)/%.h: ../include/%.h
+$(ARCH_INCDIR) | $(ARCH_DISTDIR)/include:
+	$(MKDIR) $@
+
+$(ARCH_INCDIR)/vect | $(ARCH_INCDIR):
+	$(MKDIR) $@
+
+$(ARCH_INCDIR)/iostream | $(ARCH_INCDIR):
+	$(MKDIR) $@
+
+$(ARCH_INCDIR)/%.h: ../include/%.h | $(ARCH_INCDIR) $(ARCH_INCDIR)/vect $(ARCH_INCDIR)/iostream
 	$(INSTALL_DATA) $< $@
 
-$(ARCH_DISTDIR)/include/Make/%.make: ../include/Make/%.make
+$(ARCH_DISTDIR)/include/Make/%.make: ../include/Make/%.make | $(ARCH_DISTDIR)/include/Make
 	$(INSTALL_DATA) $< $@
+
+$(ARCH_DISTDIR)/include/Make:
+	$(MKDIR) $@

Modified: grass/trunk/lib/external/bwidget/Makefile
===================================================================
--- grass/trunk/lib/external/bwidget/Makefile	2009-10-31 20:05:02 UTC (rev 39654)
+++ grass/trunk/lib/external/bwidget/Makefile	2009-10-31 20:07:25 UTC (rev 39655)
@@ -8,10 +8,10 @@
 DSTFILES := $(patsubst %,$(BWIDGETDIR)/%,$(SRCFILES))
 
 default:
-	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)/%: %
+$(BWIDGETDIR)/%: % | $(BWIDGETDIR) $(BWIDGETDIR)/images $(BWIDGETDIR)/lang
 	$(INSTALL_DATA) $< $@
+
+$(BWIDGETDIR) $(BWIDGETDIR)/images $(BWIDGETDIR)/lang: %:
+	$(MKDIR) $@

Modified: grass/trunk/lib/form/Makefile
===================================================================
--- grass/trunk/lib/form/Makefile	2009-10-31 20:05:02 UTC (rev 39654)
+++ grass/trunk/lib/form/Makefile	2009-10-31 20:07:25 UTC (rev 39655)
@@ -25,20 +25,19 @@
 LDFLAGS := $(subst $(MACOSX_ARCHS),,$(LDFLAGS)) $(MACOSX_ARCHS_TCLTK)
 endif
 
+LIBES = $(DBMILIB) $(GISLIB) $(DATETIMELIB) $(TCLTKLIBPATH) $(TCLTKLIBS) \
+	$(MATHLIB) $(XDRLIB)
+
 default: lib $(GTCLTKFORM)
 
 $(FORMDIR):
-	if [ ! -d $@ ]; then $(MKDIR) $@; fi
+	$(MKDIR) $@
 
-$(HTMLLIB): html_library_grass.tcl
-	$(MAKE) $(FORMDIR)
+$(HTMLLIB): html_library_grass.tcl | $(FORMDIR)
 	$(INSTALL_DATA) $< $@
 
-$(FORM): form.tcl
-	$(MAKE) $(FORMDIR)
+$(FORM): form.tcl | $(FORMDIR)
 	$(INSTALL_DATA) $< $@
 
-$(FORMPROG): $(OBJDIR)/form.o
-	$(MAKE) $(FORMDIR)
-	$(CC) $(LDFLAGS) -o $@ $(OBJDIR)/form.o $(DBMILIB) $(GISLIB) $(DATETIMELIB) \
-				$(TCLTKLIBPATH) $(TCLTKLIBS) $(MATHLIB) $(XDRLIB)
+$(FORMPROG): $(OBJDIR)/form.o | $(FORMDIR)
+	$(CC) $(LDFLAGS) -o $@ $(OBJDIR)/form.o $(LIBES)

Modified: grass/trunk/lib/gis/Makefile
===================================================================
--- grass/trunk/lib/gis/Makefile	2009-10-31 20:05:02 UTC (rev 39654)
+++ grass/trunk/lib/gis/Makefile	2009-10-31 20:07:25 UTC (rev 39655)
@@ -33,11 +33,7 @@
 $(ETC)/colors:
 	$(MKDIR) $@
 
-ifneq ($(BROKEN_MAKE),)
-$(ETC)/colors/%: colors/% $(ETC)/colors
-else
 $(ETC)/colors/%: colors/% | $(ETC)/colors
-endif
 	$(INSTALL_DATA) $< $@
 
 $(ETC)/%: %

Modified: grass/trunk/lib/gtcltk/Makefile
===================================================================
--- grass/trunk/lib/gtcltk/Makefile	2009-10-31 20:05:02 UTC (rev 39654)
+++ grass/trunk/lib/gtcltk/Makefile	2009-10-31 20:07:25 UTC (rev 39655)
@@ -4,8 +4,14 @@
 include $(MODULE_TOPDIR)/include/Make/Etc.make
 include $(MODULE_TOPDIR)/include/Make/NoHtml.make
 
-default: etc $(ETC)/gtcltk
+TCLSRC := $(wildcard *.tcl)
+TCLDST := $(patsubst %.tcl,$(ETC)/gtcltk/%.tcl,$(TCLSRC))
 
-$(ETC)/gtcltk: *.tcl 
-	if [ ! -d $(ETC)/gtcltk ]; then $(MKDIR) $(ETC)/gtcltk; fi
-	for file in *.tcl ; do $(INSTALL_DATA) $$file $(ETC)/gtcltk/ ; done
+default: etc $(TCLDST)
+
+$(ETC)/gtcltk/%.tcl: %.tcl | $(ETC)/gtcltk
+	$(INSTALL_DATA) $< $@
+
+$(ETC)/gtcltk:
+	$(MKDIR) $@
+

Modified: grass/trunk/lib/proj/Makefile
===================================================================
--- grass/trunk/lib/proj/Makefile	2009-10-31 20:05:02 UTC (rev 39654)
+++ grass/trunk/lib/proj/Makefile	2009-10-31 20:07:25 UTC (rev 39655)
@@ -22,19 +22,23 @@
 CSV_DSTFILES := $(patsubst %,$(CSV_DIR)/%,$(CSV_FILES))
 
 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)
 
-$(NAD_DIR)/%: %.lla
+$(NAD_DIR)/%: %.lla | $(NAD_DIR)
 	$(NAD2BIN) < $< $@
 
-$(NT_DSTFILES): $(NAD_DIR)/%: %
+$(NT_DSTFILES): $(NAD_DIR)/%: % | $(NAD_DIR)
 	$(INSTALL_DATA) $< $@
 
-$(CSV_DIR)/%.csv: %.csv
+$(CSV_DIR)/%.csv: %.csv | $(CSV_DIR)
 	$(INSTALL_DATA) $< $@
 
+$(NAD_DIR):
+	$(MKDIR) $@
+
+$(CSV_DIR):
+	$(MKDIR) $@
+
 # Note for future improvement:
 # To allow for cross-compilation, the above NAD_TABLES files should be
 # created during installation rather than compilation

Modified: grass/trunk/lib/python/Makefile
===================================================================
--- grass/trunk/lib/python/Makefile	2009-10-31 20:05:02 UTC (rev 39654)
+++ grass/trunk/lib/python/Makefile	2009-10-31 20:07:25 UTC (rev 39655)
@@ -11,21 +11,22 @@
 
 PYFILES := $(patsubst %,$(DSTDIR)/%.py,$(MODULES) __init__)
 
-default: $(DSTDIR)
-	$(MAKE) $(PYFILES)
+default: $(PYFILES) $(GDIR)/__init__.py
 
 $(PYDIR):
-	test -d $@ || $(MKDIR) -p $@
+	$(MKDIR) $@
 
-$(GDIR): $(PYDIR)
-	test -d $@ || $(MKDIR) -p $@
+$(GDIR): | $(PYDIR)
+	$(MKDIR) $@
 
-$(DSTDIR): $(GDIR)
-	test -d $@ || $(MKDIR) -p $@
-	@cat grass__init__.py > $(GDIR)/__init__.py
+$(DSTDIR): | $(GDIR)
+	$(MKDIR) $@
 
-$(DSTDIR)/%: %
+$(GDIR)/__init__.py: grass__init__.py | $(GDIR)
 	$(INSTALL_DATA) $< $@
 
+$(DSTDIR)/%: % | $(DSTDIR)
+	$(INSTALL_DATA) $< $@
+
 #doxygen:
 DOXNAME=grasspython

Modified: grass/trunk/lib/symbol/Makefile
===================================================================
--- grass/trunk/lib/symbol/Makefile	2009-10-31 20:05:02 UTC (rev 39654)
+++ grass/trunk/lib/symbol/Makefile	2009-10-31 20:07:25 UTC (rev 39655)
@@ -7,21 +7,16 @@
 
 SYMBOL_SRC := $(wildcard symbol/*/*)
 SYMBOL_DST := $(patsubst symbol/%,$(ETC)/symbol/%,$(SYMBOL_SRC))
+SYMBOL_DIRS := $(patsubst %,$(ETC)/symbol/%, demo basic extra geology)
 
 default: lib
-	$(MAKE) dirs
-	$(MAKE) symb
+	$(MAKE) $(SYMBOL_DST)
 
-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
-	if [ ! -d $(ETC)/symbol/geology ]; then $(MKDIR) $(ETC)/symbol/geology ; fi
+$(SYMBOL_DIRS): %: | $(ETC)/symbol
+	$(MKDIR) $@
 
-symb:	$(SYMBOL_DST)
+$(ETC)/symbol:
+	$(MKDIR) $@
 
-$(ETC)/symbol/%: symbol/%
+$(ETC)/symbol/%: symbol/% | $(SYMBOL_DIRS)
 	$(INSTALL_DATA) $< $@
-
-.PHONY: dirs symb

Modified: grass/trunk/lib/vector/dglib/Makefile
===================================================================
--- grass/trunk/lib/vector/dglib/Makefile	2009-10-31 20:05:02 UTC (rev 39654)
+++ grass/trunk/lib/vector/dglib/Makefile	2009-10-31 20:07:25 UTC (rev 39655)
@@ -18,12 +18,13 @@
 	 $(DGLINC)/tree.h $(DGLINC)/type.h $(DGLINC)/helpers.h $(DGLINC)/graph_v1.h $(DGLINC)/graph_v2.h \
 	 $(ARCH_INCDIR)/dgl.h
 
-$(DGLINC)/%.h: %.h
-	-test -d $(DGLINC) || $(MKDIR) $(DGLINC)
-	$(INSTALL_DATA) $^ $@
+$(DGLINC)/%.h: %.h | $(DGLINC)
+	$(INSTALL_DATA) $< $@
 
-$(ARCH_INCDIR)/dgl.h: dgl.h
-	$(INSTALL_DATA) $^ $@
+$(DGLINC):
+	$(MKDIR) $@
 
+.PHONY: headers
+
 #doxygen:
 DOXNAME=dg

Modified: grass/trunk/lib/vector/rtree/Makefile
===================================================================
--- grass/trunk/lib/vector/rtree/Makefile	2009-10-31 20:05:02 UTC (rev 39654)
+++ grass/trunk/lib/vector/rtree/Makefile	2009-10-31 20:07:25 UTC (rev 39655)
@@ -22,11 +22,7 @@
 $(RTLINC):
 	$(MKDIR) $@
 
-ifneq ($(BROKEN_MAKE),)
-$(RTLINC)/%.h: %.h $(RTLINC)
-else
 $(RTLINC)/%.h: %.h | $(RTLINC)
-endif
 	$(INSTALL_DATA) $< $@
 
 $(ARCH_INCDIR)/rtree.h: rtree.h

Modified: grass/trunk/ps/ps.map/Makefile
===================================================================
--- grass/trunk/ps/ps.map/Makefile	2009-10-31 20:05:02 UTC (rev 39654)
+++ grass/trunk/ps/ps.map/Makefile	2009-10-31 20:07:25 UTC (rev 39655)
@@ -17,25 +17,22 @@
 DSTDEC := $(patsubst decorations/%.eps,$(ETC)/paint/decorations/%.eps,$(SRCDEC))
 
 
-default: cmd $(PROLOG) patt decor
+default: cmd $(PROLOG) $(DSTPAT) $(DSTDEC)
 
-$(PROLOG): prolog.ps
-	if [ ! -d $(ETC)/paint ] ; then $(MKDIR) $(ETC)/paint ; fi
+$(PROLOG): prolog.ps | $(ETC)/paint
 	$(INSTALL_DATA) $< $@
 
-patt:
-	if [ ! -d $(ETC)/paint/patterns ] ; then $(MKDIR) $(ETC)/paint/patterns ; fi
-	$(MAKE) $(DSTPAT)
-
-$(ETC)/paint/patterns/%.eps: patterns/%.eps
+$(ETC)/paint/patterns/%.eps: patterns/%.eps | $(ETC)/paint/patterns
 	$(INSTALL_DATA) $< $@
 
-decor:
-	if [ ! -d $(ETC)/paint/decorations ] ; then $(MKDIR) $(ETC)/paint/decorations ; fi
-	$(MAKE) $(DSTDEC)
-
-$(ETC)/paint/decorations/%.eps: decorations/%.eps
+$(ETC)/paint/decorations/%.eps: decorations/%.eps | $(ETC)/paint/decorations
 	$(INSTALL_DATA) $< $@
 
+$(ETC)/paint:
+	$(MKDIR) $@
 
-.PHONY: patt decor
+$(ETC)/paint/patterns: | $(ETC)/paint
+	$(MKDIR) $@
+
+$(ETC)/paint/decorations: | $(ETC)/paint
+	$(MKDIR) $@

Modified: grass/trunk/raster/r.li/r.li.setup/Makefile
===================================================================
--- grass/trunk/raster/r.li/r.li.setup/Makefile	2009-10-31 20:05:02 UTC (rev 39654)
+++ grass/trunk/raster/r.li/r.li.setup/Makefile	2009-10-31 20:07:25 UTC (rev 39655)
@@ -22,12 +22,14 @@
 
 DATA_DST := $(patsubst %,$(TARGET)/%,$(DATA_SRC))
 
-default: script
-	if [ ! -d $(TARGET) ] ; then $(MKDIR) $(TARGET) ; fi
-	$(MAKE) $(SCRIPT_DST) $(DATA_DST)
+default: script $(SCRIPT_DST) $(DATA_DST)
 
-$(TARGET)/%.txt: %.txt
+$(TARGET)/%.txt: %.txt | $(TARGET)
 	$(INSTALL_DATA) $< $@
 
-$(TARGET)/%: %
+$(TARGET)/%: % | $(TARGET)
 	$(INSTALL) $< $@
+
+$(TARGET):
+	$(MKDIR) $@
+

Modified: grass/trunk/scripts/d.polar/Makefile
===================================================================
--- grass/trunk/scripts/d.polar/Makefile	2009-10-31 20:05:02 UTC (rev 39654)
+++ grass/trunk/scripts/d.polar/Makefile	2009-10-31 20:07:25 UTC (rev 39655)
@@ -4,10 +4,10 @@
 
 include $(MODULE_TOPDIR)/include/Make/Script.make
 
-default: script
-	if [ ! -d $(ETC)/d.polar ] ; then $(MKDIR) $(ETC)/d.polar ; fi
-	$(MAKE) $(ETC)/d.polar/ps_defs.eps
+default: script $(ETC)/d.polar/ps_defs.eps
 
-$(ETC)/d.polar/%: %
+$(ETC)/d.polar/%: % | $(ETC)/d.polar
 	$(INSTALL_DATA) $< $@
 
+$(ETC)/d.polar:
+	$(MKDIR) $@

Modified: grass/trunk/scripts/db.test/Makefile
===================================================================
--- grass/trunk/scripts/db.test/Makefile	2009-10-31 20:05:02 UTC (rev 39654)
+++ grass/trunk/scripts/db.test/Makefile	2009-10-31 20:07:25 UTC (rev 39655)
@@ -7,11 +7,10 @@
 TEST_SRC := $(wildcard test*)
 TEST_DST := $(patsubst %,$(ETC)/db.test/%,$(TEST_SRC))
 
-default: script tests
+default: script $(TEST_DST)
 
-tests:
-	if [ ! -d $(ETC)/db.test ]; then $(MKDIR) $(ETC)/db.test; fi
-	$(MAKE) $(TEST_DST)
-
-$(ETC)/db.test/%: %
+$(ETC)/db.test/%: % | $(ETC)/db.test
 	$(INSTALL_DATA) $< $@
+
+$(ETC)/db.test:
+	$(MKDIR) $@

Modified: grass/trunk/scripts/r.in.wms/Makefile
===================================================================
--- grass/trunk/scripts/r.in.wms/Makefile	2009-10-31 20:05:02 UTC (rev 39654)
+++ grass/trunk/scripts/r.in.wms/Makefile	2009-10-31 20:07:25 UTC (rev 39655)
@@ -7,9 +7,10 @@
 SRCFILES = wms_parse.py wms_request.py wms_download.py gdalwarp.py r.in.gdalwarp.py wms_gdal.py
 DSTFILES := $(patsubst %,$(ETC)/r.in.wms/%,$(SRCFILES))
 
-default: script
-	if [ ! -d $(ETC)/r.in.wms ] ; then $(MKDIR) $(ETC)/r.in.wms ; fi
-	$(MAKE) $(DSTFILES)
+default: script $(DSTFILES)
 
-$(ETC)/r.in.wms/%: %
+$(ETC)/r.in.wms/%: % | $(ETC)/r.in.wms
 	$(INSTALL) $< $@
+
+$(ETC)/r.in.wms:
+	$(MKDIR) $@

Modified: grass/trunk/swig/python/Makefile
===================================================================
--- grass/trunk/swig/python/Makefile	2009-10-31 20:05:02 UTC (rev 39654)
+++ grass/trunk/swig/python/Makefile	2009-10-31 20:07:25 UTC (rev 39655)
@@ -69,18 +69,18 @@
 	$(SWIG) $(SWIGFLAGS) -python -o $*_wrap.c -module $* -shadow $<
 
 $(PYDIR):
-	test -d $@ || $(MKDIR) -p $@
+	$(MKDIR) $@
 
-$(GDIR): $(PYDIR)
-	test -d $@ || $(MKDIR) -p $@
+$(GDIR): | $(PYDIR)
+	$(MKDIR) $@
 
-$(DSTDIR): $(GDIR)
-	test -d $@ || $(MKDIR) -p $@
+$(DSTDIR): | $(GDIR)
+	$(MKDIR) $@
 
-$(DSTDIR)/_%.so: _%.so
+$(DSTDIR)/_%.so: _%.so | $(DSTDIR)
 	$(INSTALL) $< $@
 
-$(DSTDIR)/%.py: %.py
+$(DSTDIR)/%.py: %.py | $(DSTDIR)
 	$(INSTALL_DATA) $< $@
 
 numptr:

Modified: grass/trunk/visualization/nviz/Makefile
===================================================================
--- grass/trunk/visualization/nviz/Makefile	2009-10-31 20:05:02 UTC (rev 39654)
+++ grass/trunk/visualization/nviz/Makefile	2009-10-31 20:07:25 UTC (rev 39655)
@@ -36,19 +36,27 @@
 
 # Install the scripts in the appropriate directory
 install:
-	-if [ ! -d $(INSTALL_DIR) ] ; then $(MKDIR) $(INSTALL_DIR) ; fi
 	$(MAKE) $(INSTALL_DIR)/$(PGM)$(EXE)
 	$(MAKE) $(BIN)/$(PGM)
 ifneq ($(strip $(MINGW)),)
 	$(MAKE) $(BIN)/nviz.bat
 endif
-	-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_DIR):
+	$(MKDIR) $@
+
+$(INSTALL_DIR)/scripts: | $(INSTALL_DIR)
+	$(MKDIR) $@
+
+$(INSTALL_DIR)/bitmaps: | $(INSTALL_DIR)
+	$(MKDIR) $@
+
+$(INSTALL_DIR)/bitmaps/flythrough: | $(INSTALL_DIR)/bitmaps
+	$(MKDIR) $@
+
+$(INSTALL_DIR)/$(PGM)$(EXE): src/nvwish$(EXE) | $(INSTALL_DIR)
 	$(INSTALL) $< $@
 
 $(BIN)/$(PGM): scripts/$(PGM)
@@ -57,10 +65,10 @@
 $(BIN)/nviz.bat: scripts/nviz.bat
 	$(INSTALL) $< $@
 
-$(INSTALL_DIR)/scripts/%: scripts/%
+$(INSTALL_DIR)/scripts/%: scripts/% | $(INSTALL_DIR)/scripts
 	$(INSTALL) $< $@
 
-$(INSTALL_DIR)/bitmaps/%: bitmaps/%
+$(INSTALL_DIR)/bitmaps/%: bitmaps/% | $(INSTALL_DIR)/bitmaps
 	$(INSTALL_DATA) $< $@
 
 .PHONY: install

Modified: grass/trunk/visualization/nviz/html/Makefile
===================================================================
--- grass/trunk/visualization/nviz/html/Makefile	2009-10-31 20:05:02 UTC (rev 39654)
+++ grass/trunk/visualization/nviz/html/Makefile	2009-10-31 20:07:25 UTC (rev 39655)
@@ -7,13 +7,13 @@
 SRCFILES := $(wildcard  *.* img/nv/*.* nvimg/*/*.*)
 DSTFILES := $(patsubst %,$(GRASS_NVIZ_DOCS)/%,$(SRCFILES))
 
-default:
-	-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)
+DSTDIRS := $(ARCH_DISTDIR)/docs $(ARCH_DISTDIR)/docs/html $(GRASS_NVIZ_DOCS) \
+	$(patsubst %,$(GRASS_NVIZ_DOCS)/%,img img/nv nvimg/panel nvimg/work)
 
-$(GRASS_NVIZ_DOCS)/%: %
+default: $(DSTFILES)
+
+$(DSTDIRS): %:
+	$(MKDIR) $@
+
+$(GRASS_NVIZ_DOCS)/%: % | $(DSTDIRS)
 	$(INSTALL_DATA) $< $@



More information about the grass-commit mailing list