Browse Source

wingrass: produce bat files for scripts
fix bat wrapper generation for addons (patch provided by glynn, see https://trac.osgeo.org/grass/ticket/2150)
(merge https://trac.osgeo.org/grass/changeset/61136 & https://trac.osgeo.org/grass/changeset/61715 from trunk)


git-svn-id: https://svn.osgeo.org/grass/grass/branches/releasebranch_7_0@61869 15284696-431f-4ddb-bdfa-cd5b030d7da7

Martin Landa 10 years ago
parent
commit
ddfd6490d6
2 changed files with 9 additions and 0 deletions
  1. 8 0
      include/Make/Script.make
  2. 1 0
      scripts/windows_launch.bat

+ 8 - 0
include/Make/Script.make

@@ -18,9 +18,17 @@ include $(MODULE_TOPDIR)/include/Make/Html.make
 include $(MODULE_TOPDIR)/include/Make/ScriptRules.make
 
 SCRIPT_ACTIONS = $(SCRIPT) $(ETCPYFILES) $(ETCPYCFILES) html scriptstrings
+ifdef MINGW
+SCRIPT_ACTIONS += $(BIN)/$(PGM).bat
+SCRIPT_DIR = %GISBASE%/scripts
+endif
 
 script: $(SCRIPT_ACTIONS)
 
+$(BIN)/$(PGM).bat: $(MODULE_TOPDIR)/scripts/windows_launch.bat
+	sed -e "s#SCRIPT_NAME#$(PGM)#" -e "s#SCRIPT_DIR#$(SCRIPT_DIR)#" $(MODULE_TOPDIR)/scripts/windows_launch.bat > $@
+	unix2dos $@
+
 scriptstrings: $(STRINGDIR)/$(PGM)_to_translate.c
 
 install:

+ 1 - 0
scripts/windows_launch.bat

@@ -0,0 +1 @@
+@"%GRASS_PYTHON%" "SCRIPT_DIR/SCRIPT_NAME.py" %*