Ver código fonte

gui scripts: makefile cosmetics
wingrass: generate bat files also for GUI modules
grass.py: remove PY from PATHEXT
(merge https://trac.osgeo.org/grass/changeset/62932, r62955-6, https://trac.osgeo.org/grass/changeset/63160 from trunk)


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

Martin Landa 10 anos atrás
pai
commit
2b8e663f77
3 arquivos alterados com 21 adições e 19 exclusões
  1. 9 7
      gui/scripts/Makefile
  2. 12 7
      include/Make/GuiScript.make
  3. 0 5
      lib/init/grass.py

+ 9 - 7
gui/scripts/Makefile

@@ -8,17 +8,19 @@ DSTDIR = $(GUIDIR)/scripts
 
 ifdef MINGW
 PYFILES := $(patsubst %.py, $(DSTDIR)/%.py, $(filter %.py, $(PY_SOURCES)))
+BATFILES := $(patsubst %.py, $(DSTDIR)/%.bat, $(filter %.py, $(PY_SOURCES)))
+$(DSTDIR)/%.py: %.py | $(DSTDIR)
+	$(INSTALL) $< $@
+$(DSTDIR)/%.bat: $(MODULE_TOPDIR)/scripts/windows_launch.bat
+	sed -e "s#SCRIPT_NAME#$(*)#" -e "s#SCRIPT_DIR#%GISBASE%/gui/scripts#" $(MODULE_TOPDIR)/scripts/windows_launch.bat > $@
+	unix2dos $@
+default: $(PYFILES) $(BATFILES)
 else
 PYFILES := $(patsubst %.py, $(DSTDIR)/%, $(filter %.py, $(PY_SOURCES)))
-endif
-
-default: $(PYFILES)
-
 $(DSTDIR)/%: %.py | $(DSTDIR)
 	$(INSTALL) $< $@
-
-$(DSTDIR)/%.py: %.py | $(DSTDIR)
-	$(INSTALL) $< $@
+default: $(PYFILES)
+endif
 
 $(DSTDIR):
 	-test -d $@ | $(MKDIR) $@

+ 12 - 7
include/Make/GuiScript.make

@@ -3,12 +3,6 @@
 
 include $(MODULE_TOPDIR)/include/Make/Vars.make
 
-ifdef MINGW
-SCRIPTEXT = .py
-else
-SCRIPTEXT = 
-endif
-
 include $(MODULE_TOPDIR)/include/Make/Rules.make
 include $(MODULE_TOPDIR)/include/Make/ScriptRules.make
 include $(MODULE_TOPDIR)/include/Make/HtmlRules.make
@@ -16,9 +10,16 @@ include $(MODULE_TOPDIR)/include/Make/HtmlRules.make
 MODULES  := $(patsubst g.gui.%.py,%,$(wildcard g.gui.*.py))
 CMDHTML  := $(patsubst %,$(HTMLDIR)/g.gui.%.html,$(MODULES))
 GUIHTML  := $(patsubst %,$(HTMLDIR)/wxGUI.%.html,$(MODULES))
+ifdef MINGW
+SCRIPTEXT = .py
+BATFILES  := $(patsubst %,$(BIN)/g.gui.%.bat,$(MODULES))
+else
+SCRIPTEXT = 
+BATFILES =
+endif
 PYFILES  := $(patsubst %,$(SCRIPTDIR)/g.gui.%$(SCRIPTEXT),$(MODULES))
 
-guiscript: $(IMGDST) $(PYFILES)
+guiscript: $(IMGDST) $(PYFILES) $(BATFILES)
 	$(MAKE) $(CMDHTML)
 	-rm -f g.gui.*.tmp.html
 	$(MAKE) $(GUIHTML)
@@ -38,4 +39,8 @@ g.gui.%.tmp.html: $(SCRIPTDIR)/g.gui.%
 $(SCRIPTDIR)/g.gui.%$(SCRIPTEXT): g.gui.%.py | $(SCRIPTDIR)
 	$(INSTALL) $< $@
 
+$(BIN)/g.gui.%.bat: $(MODULE_TOPDIR)/scripts/windows_launch.bat
+	sed -e "s#SCRIPT_NAME#g.gui.$(*)#" -e "s#SCRIPT_DIR#%GISBASE%/scripts#" $(MODULE_TOPDIR)/scripts/windows_launch.bat > $@
+	unix2dos $@
+
 .PHONY: guiscript

+ 0 - 5
lib/init/grass.py

@@ -423,11 +423,6 @@ def set_paths():
             os.environ['MANPATH'] = addons_man_path
             path_prepend(grass_man_path, 'MANPATH')
 
-    # Add .py (Python) to list of executable extensions to search for
-    # in MS-Windows PATH
-    if windows:
-        path_append('.PY', 'PATHEXT')
-
 
 def find_exe(pgm):
     for dir in os.getenv('PATH').split(os.pathsep):