[GRASS-SVN] r39921 - grass/branches/releasebranch_6_4/general/g.version

svn_grass at osgeo.org svn_grass at osgeo.org
Sun Dec 6 09:48:35 EST 2009


Author: martinl
Date: 2009-12-06 09:48:33 -0500 (Sun, 06 Dec 2009)
New Revision: 39921

Modified:
   grass/branches/releasebranch_6_4/general/g.version/Makefile
   grass/branches/releasebranch_6_4/general/g.version/main.c
Log:
glynn: Avoid passing large amounts of data via -D switches 
       (merge from r39844 from devbr6)


Modified: grass/branches/releasebranch_6_4/general/g.version/Makefile
===================================================================
--- grass/branches/releasebranch_6_4/general/g.version/Makefile	2009-12-06 11:28:46 UTC (rev 39920)
+++ grass/branches/releasebranch_6_4/general/g.version/Makefile	2009-12-06 14:48:33 UTC (rev 39921)
@@ -7,16 +7,23 @@
 COPYING=`cat ./../../COPYING | sed -f sed.script | tr -d '\012'`
 GRASS_CONFIGURE_PARAMS=`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)\""
+EXTRA_CFLAGS = \
+	-DGRASS_VERSION_NUMBER=\"'$(GRASS_VERSION_NUMBER)'\" \
+	-DGRASS_VERSION_DATE=\"'$(GRASS_VERSION_DATE)'\" \
+	-DGRASS_VERSION_UPDATE_PKG=\"'$(GRASS_VERSION_UPDATE_PKG)'\" \
+	-I$(OBJDIR)
 
-LIBES     = $(GISLIB)
-DEPENDENCIES= $(GISDEP)
+EXTRA_HEADERS = $(OBJDIR)/copying.h $(OBJDIR)/confparms.h
 
+LIBES = $(GISLIB)
+DEPENDENCIES = $(GISDEP)
+
 include $(MODULE_TOPDIR)/include/Make/Module.make
 
-default: cmd COPYING GRASS_CONFIGURE_PARAMS
+default: cmd
 
-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)
+$(OBJDIR)/copying.h: $(MODULE_TOPDIR)/COPYING | $(OBJDIR)
+	sed -e 's/^\(.*\)$$/"\1\\n"/' $< > $@
+
+$(OBJDIR)/confparms.h: $(MODULE_TOPDIR)/config.status | $(OBJDIR)
+	sed -n '7s/^#\(.*\)$$/"\1"/p' $< > $@

Modified: grass/branches/releasebranch_6_4/general/g.version/main.c
===================================================================
--- grass/branches/releasebranch_6_4/general/g.version/main.c	2009-12-06 11:28:46 UTC (rev 39920)
+++ grass/branches/releasebranch_6_4/general/g.version/main.c	2009-12-06 14:48:33 UTC (rev 39921)
@@ -23,6 +23,14 @@
 #define GRASS_VERSION_UPDATE_PKG "0.1"
 #endif
 
+static const char COPYING[] =
+#include "copying.h"
+;
+
+static const char GRASS_CONFIGURE_PARAMS[] =
+#include "confparms.h"
+;
+
 int main(int argc, char *argv[])
 {
     struct GModule *module;



More information about the grass-commit mailing list