ShScript.make 1.3 KB

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