Script.make 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. include $(MODULE_TOPDIR)/include/Make/Vars.make
  2. ifdef MINGW
  3. SCRIPT = $(SCRIPTDIR)/$(PGM).py
  4. else
  5. SCRIPT = $(SCRIPTDIR)/$(PGM)
  6. endif
  7. HTMLSRC = $(SCRIPT)
  8. ETCDIR = $(ETC)/$(PGM)
  9. ETCPYFILES := $(patsubst %,$(ETCDIR)/%.py,$(ETCFILES))
  10. ETCPYCFILES := $(patsubst %,$(ETCDIR)/%.pyc,$(ETCFILES))
  11. include $(MODULE_TOPDIR)/include/Make/Rules.make
  12. include $(MODULE_TOPDIR)/include/Make/Html.make
  13. include $(MODULE_TOPDIR)/include/Make/ScriptRules.make
  14. SCRIPT_ACTIONS = $(SCRIPT) $(ETCPYFILES) $(ETCPYCFILES) html scriptstrings
  15. ifdef MINGW
  16. SCRIPT_ACTIONS += $(BIN)/$(PGM).bat
  17. SCRIPT_DIR = %GISBASE%/scripts
  18. endif
  19. script: $(SCRIPT_ACTIONS)
  20. $(BIN)/$(PGM).bat: $(MODULE_TOPDIR)/scripts/windows_launch.bat
  21. sed -e "s#SCRIPT_NAME#$(PGM)#" -e "s#SCRIPT_DIR#$(SCRIPT_DIR)#" $(MODULE_TOPDIR)/scripts/windows_launch.bat > $@
  22. unix2dos $@
  23. scriptstrings: $(STRINGDIR)/$(PGM)_to_translate.c
  24. install:
  25. $(INSTALL) $(SCRIPT) $(INST_DIR)/scripts/
  26. $(INSTALL_DATA) $(HTMLDIR)/$(PGM).html $(INST_DIR)/docs/html/
  27. $(eval IMG := $(wildcard $(HTMLDIR)/*.png) $(wildcard $(HTMLDIR)/*.jpg) $(wildcard $(HTMLDIR)/*.gif))
  28. if [ -n "$(IMG)" ] ; then \
  29. $(INSTALL_DATA) $(IMG) $(INST_DIR)/docs/html/ ; \
  30. fi
  31. $(INSTALL_DATA) $(ARCH_DISTDIR)/docs/man/man1/$(PGM).1 $(INST_DIR)/docs/man/man1/
  32. if [ -d "$(ETC)/$(PGM)" ] ; then \
  33. cp -RL $(ETC)/$(PGM) $(INST_DIR)/etc/ ; \
  34. fi
  35. .PHONY: script scriptstrings