浏览代码

attept to fix WinGRASS GUI scripts (bugs https://trac.osgeo.org/grass/ticket/234, https://trac.osgeo.org/grass/ticket/553, https://trac.osgeo.org/grass/ticket/580, and https://trac.osgeo.org/grass/ticket/586?; merge from devbr6)

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@37087 15284696-431f-4ddb-bdfa-cd5b030d7da7
Hamish Bowman 16 年之前
父节点
当前提交
2b38e19f35
共有 3 个文件被更改,包括 22 次插入2 次删除
  1. 11 1
      gui/scripts/Makefile
  2. 1 0
      gui/scripts/windows_launch.bat
  3. 10 1
      gui/wxpython/scripts/Makefile

+ 11 - 1
gui/scripts/Makefile

@@ -2,13 +2,23 @@ MODULE_TOPDIR = ../..
 
 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:
+ifdef MINGW
+SCRIPT_ACTIONS += create.bat
+endif
+
+default: $(SCRIPT_ACTIONS)
 	if [ ! -d $(ETC)/gui ] ; then $(MKDIR) $(ETC)/gui ; fi
 	if [ ! -d $(ETC)/gui/scripts ] ; then $(MKDIR) $(ETC)/gui/scripts ; fi
 	$(MAKE) $(DSTFILES)
 
 $(ETC)/gui/scripts/%: %
 	$(INSTALL) $< $@
+
+create.bat:
+	for file in d.* g.* r.* v.* ; do \
+	sed -e "s#SCRIPT_NAME#$$file#" $(MODULE_TOPDIR)/gui/scripts/windows_launch.bat \
+		> $(ETC)/gui/scripts/$$file.bat ; done

+ 1 - 0
gui/scripts/windows_launch.bat

@@ -0,0 +1 @@
+@"%GRASS_SH%" -c '"%GISBASE%/etc/gui/scripts/SCRIPT_NAME" %*'

+ 10 - 1
gui/wxpython/scripts/Makefile

@@ -4,12 +4,21 @@ include $(MODULE_TOPDIR)/include/Make/Dir.make
 
 ETCDIR = $(ETC)/gui/scripts
 
+ifdef MINGW
+SCRIPT_ACTIONS += create.bat
+endif
+
 default: install_scripts
 
-install_scripts:
+install_scripts: $(SCRIPT_ACTIONS)
 	if [ ! -d $(ETCDIR) ] ; then $(MKDIR) $(ETCDIR) ; fi
 	$(MAKE) $(ETCDIR)/d.rast3d
 
 $(ETCDIR)/%: %
 	$(INSTALL) $< $@
 
+create.bat:
+	sed -e "s#SCRIPT_NAME#d.rast3d#" $(MODULE_TOPDIR)/gui/scripts/windows_launch.bat \
+		> $(ETCDIR)/d.rast3d.bat
+
+clean: cleansubdirs