[GRASS-SVN] r50553 - grass/trunk/gui/images
svn_grass at osgeo.org
svn_grass at osgeo.org
Mon Jan 30 06:49:12 EST 2012
Author: glynn
Date: 2012-01-30 03:49:12 -0800 (Mon, 30 Jan 2012)
New Revision: 50553
Modified:
grass/trunk/gui/images/Makefile
Log:
Use real make rules instead of shell script
Modified: grass/trunk/gui/images/Makefile
===================================================================
--- grass/trunk/gui/images/Makefile 2012-01-30 11:42:45 UTC (rev 50552)
+++ grass/trunk/gui/images/Makefile 2012-01-30 11:49:12 UTC (rev 50553)
@@ -4,23 +4,30 @@
ETCDIR = $(ETC)/gui/images
-FILES := $(wildcard *.png)
+IMGSRC := $(wildcard *.png)
+IMGDST := $(patsubst %,$(ETCDIR)/%,$(IMGSRC))
-default: $(patsubst %,$(ETCDIR)/%,$(FILES)) symbol_thumbnails
+CATEGORIES = basic demo extra geology
+SYMSRC := $(foreach dir,$(CATEGORIES),$(wildcard symbols/$(dir)/*.png))
+SYMDST := $(patsubst symbols/%,$(ETCDIR)/symbols/%,$(SYMSRC))
+default: $(IMGDST) $(SYMDST)
+
+define symbols_rule
+$(ETCDIR)/symbols/$(1)/%.png: symbols/$(1)/%.png | $(ETCDIR)/symbols/$(1)
+ $(INSTALL_DATA) $$< $$@
+endef
+
+$(foreach category,$(CATEGORIES),$(eval $(call symbols_rule,$(category))))
+
$(ETCDIR)/%.png: %.png | $(ETCDIR)
$(INSTALL_DATA) $< $@
-symbol_thumbnails: $(ETCDIR)
- if [ ! -d $(ETCDIR)/symbols ]; then $(MKDIR) $(ETCDIR)/symbols ; fi
- for category in basic demo extra geology ; do \
- if [ ! -d $(ETCDIR)/symbols/$$category ] ; then \
- $(MKDIR) $(ETCDIR)/symbols/$$category ; \
- fi ; \
- for file in symbols/$$category/*.png ; do \
- $(INSTALL_DATA) $$file $(ETCDIR)/symbols/$$category ; \
- done ; \
- done
-
$(ETCDIR):
$(MKDIR) $@
+
+$(ETCDIR)/symbols: $(ETCDIR)
+ $(MKDIR) $@
+
+$(ETCDIR)/symbols/%: | $(ETCDIR)/symbols
+ $(MKDIR) $@
More information about the grass-commit
mailing list