GuiScript.make 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. # common dependencies and rules for building GUI module
  2. include $(MODULE_TOPDIR)/include/Make/Vars.make
  3. include $(MODULE_TOPDIR)/include/Make/Rules.make
  4. include $(MODULE_TOPDIR)/include/Make/ScriptRules.make
  5. include $(MODULE_TOPDIR)/include/Make/HtmlRules.make
  6. MODULES := $(patsubst g.gui.%.py,%,$(wildcard g.gui.*.py))
  7. CMDHTML := $(patsubst %,$(HTMLDIR)/g.gui.%.html,$(MODULES))
  8. GUIHTML := $(patsubst %,$(HTMLDIR)/wxGUI.%.html,$(MODULES))
  9. ifdef MINGW
  10. SCRIPTEXT = .py
  11. BATFILES := $(patsubst %,$(BIN)/g.gui.%.bat,$(MODULES))
  12. else
  13. SCRIPTEXT =
  14. BATFILES =
  15. endif
  16. PYFILES := $(patsubst %,$(SCRIPTDIR)/g.gui.%$(SCRIPTEXT),$(MODULES))
  17. guiscript: $(IMGDST) $(PYFILES) $(BATFILES)
  18. # we cannot use cross-compiled g.parser for generating html files
  19. ifndef CROSS_COMPILING
  20. $(MAKE) $(CMDHTML)
  21. -rm -f g.gui.*.tmp.html
  22. $(MAKE) $(GUIHTML)
  23. endif
  24. $(HTMLDIR)/g.gui.%.html: g.gui.%.html g.gui.%.tmp.html | $(HTMLDIR)
  25. VERSION_NUMBER=$(GRASS_VERSION_NUMBER) VERSION_DATE=$(GRASS_VERSION_DATE) MODULE_TOPDIR=$(MODULE_TOPDIR) \
  26. $(PYTHON) $(GISBASE)/utils/mkhtml.py g.gui.$* $(GRASS_VERSION_DATE) > $@
  27. $(HTMLDIR)/wxGUI.%.html: g.gui.%.html | $(HTMLDIR)
  28. -rm -f g.gui.$*.tmp.html
  29. VERSION_NUMBER=$(GRASS_VERSION_NUMBER) VERSION_DATE=$(GRASS_VERSION_DATE) MODULE_TOPDIR=$(MODULE_TOPDIR) \
  30. $(PYTHON) $(GISBASE)/utils/mkhtml.py g.gui.$* $(GRASS_VERSION_DATE) > $@
  31. g.gui.%.tmp.html: $(SCRIPTDIR)/g.gui.%
  32. $(call htmldesc,$<,$@)
  33. $(SCRIPTDIR)/g.gui.%$(SCRIPTEXT): g.gui.%.py | $(SCRIPTDIR)
  34. $(INSTALL) $< $@
  35. $(BIN)/g.gui.%.bat: $(MODULE_TOPDIR)/scripts/windows_launch.bat
  36. sed -e "s#SCRIPT_NAME#g.gui.$(*)#" -e "s#SCRIPT_DIR#%GISBASE%/scripts#" $(MODULE_TOPDIR)/scripts/windows_launch.bat > $@
  37. unix2dos $@
  38. .PHONY: guiscript