[GRASS-SVN] r39163 - grass/trunk/include/Make
svn_grass at osgeo.org
svn_grass at osgeo.org
Sat Sep 12 23:26:36 EDT 2009
Author: glynn
Date: 2009-09-12 23:26:35 -0400 (Sat, 12 Sep 2009)
New Revision: 39163
Modified:
grass/trunk/include/Make/Html.make
grass/trunk/include/Make/Rules.make
grass/trunk/include/Make/ScriptRules.make
Log:
Refactor; re-use code to run GRASS commands during build
Modified: grass/trunk/include/Make/Html.make
===================================================================
--- grass/trunk/include/Make/Html.make 2009-09-13 00:02:41 UTC (rev 39162)
+++ grass/trunk/include/Make/Html.make 2009-09-13 03:26:35 UTC (rev 39163)
@@ -7,21 +7,8 @@
else
-htmldesc = \
- GISRC=$(RUN_GISRC) \
- GISBASE=$(RUN_GISBASE) \
- PATH="$(GISBASE)/bin:$$PATH" \
- PYTHONPATH="$(call mkpath,$(GISBASE)/etc/python,$$PYTHONPATH)" \
- $(LD_LIBRARY_PATH_VAR)="$(BIN):$(ARCH_LIBDIR):$(BASE_LIBDIR):$($(LD_LIBRARY_PATH_VAR))" \
- LC_ALL=C \
- $(1) --html-description < /dev/null | grep -v '</body>\|</html>' > $(2)
+htmldesc = $(call run_grass,$(1) --html-description < /dev/null | grep -v '</body>\|</html>' > $(2))
-ifneq ($(MINGW),)
-mkpath = $(shell PATH="$(GISBASE)/bin:$(ARCH_LIBDIR):$$PATH" GISRC=$(RUN_GISRC) $(BIN)/g.dirseps$(EXE) -h $(1));$(2)
-else
-mkpath = $(1):$(2)
-endif
-
$(HTMLDIR)/%.html: %.html %.tmp.html $(HTMLSRC)
-test -d $(HTMLDIR) || $(MKDIR) $(HTMLDIR)
$(GISBASE)/tools/mkhtml.sh $* > $@
Modified: grass/trunk/include/Make/Rules.make
===================================================================
--- grass/trunk/include/Make/Rules.make 2009-09-13 00:02:41 UTC (rev 39162)
+++ grass/trunk/include/Make/Rules.make 2009-09-13 03:26:35 UTC (rev 39163)
@@ -21,6 +21,21 @@
$(ARCH_INCDIR)/%.h: %.h
$(INSTALL_DATA) $< $@
+ifneq ($(MINGW),)
+mkpath = $(shell PATH="$(GISBASE)/bin:$(ARCH_LIBDIR):$$PATH" GISRC=$(RUN_GISRC) $(BIN)/g.dirseps$(EXE) -h $(1));$(2)
+else
+mkpath = $(1):$(2)
+endif
+
+run_grass = \
+ GISRC=$(RUN_GISRC) \
+ GISBASE=$(RUN_GISBASE) \
+ PATH="$(GISBASE)/bin:$$PATH" \
+ PYTHONPATH="$(call mkpath,$(GISBASE)/etc/python,$$PYTHONPATH)" \
+ $(LD_LIBRARY_PATH_VAR)="$(BIN):$(ARCH_LIBDIR):$(BASE_LIBDIR):$($(LD_LIBRARY_PATH_VAR))" \
+ LC_ALL=C \
+ $(1)
+
# default clean rules
clean:
-rm -rf $(OBJDIR) $(EXTRA_CLEAN_DIRS)
Modified: grass/trunk/include/Make/ScriptRules.make
===================================================================
--- grass/trunk/include/Make/ScriptRules.make 2009-09-13 00:02:41 UTC (rev 39162)
+++ grass/trunk/include/Make/ScriptRules.make 2009-09-13 03:26:35 UTC (rev 39163)
@@ -15,16 +15,10 @@
# These are only the options (parser.c) type things.
# See locale/scriptstrings/README for more information
-strings = \
- GISRC=$(RUN_GISRC) \
- GISBASE=$(RUN_GISBASE) \
- PATH=$(BIN):$$PATH \
- $(LD_LIBRARY_PATH_VAR)="$(ARCH_LIBDIR):$($(LD_LIBRARY_PATH_VAR))" \
- g.parser -t $(1) | sed s/\"/\\\\\"/g | sed 's/.*/_("&")/' > \
- $(2) ; true
+strings = $(call run_grass,g.parser -t $(1) | sed s/\"/\\\\\"/g | sed 's/.*/_("&")/' > $(2))
$(STRINGDIR)/%_to_translate.c: %.py
- $(call strings,$<,$@)
+ -$(call strings,$<,$@)
$(STRINGDIR)/%_to_translate.c: %
- $(call strings,$<,$@)
+ -$(call strings,$<,$@)
More information about the grass-commit
mailing list