Makefile 854 B

123456789101112131415161718192021222324252627
  1. MODULE_TOPDIR = ../..
  2. include $(MODULE_TOPDIR)/include/Make/Rules.make
  3. include $(MODULE_TOPDIR)/include/Make/Vars.make
  4. include $(MODULE_TOPDIR)/include/Make/Python.make
  5. DSTDIR = $(GUIDIR)/scripts
  6. ifdef MINGW
  7. PYFILES := $(patsubst %.py, $(DSTDIR)/%_wrapper.py, $(filter %.py, $(PY_SOURCES)))
  8. BATFILES := $(patsubst %.py, $(DSTDIR)/%.bat, $(filter %.py, $(PY_SOURCES)))
  9. $(DSTDIR)/%_wrapper.py: %.py | $(DSTDIR)
  10. $(INSTALL) $< $@
  11. $(DSTDIR)/%.bat: $(MODULE_TOPDIR)/scripts/windows_launch.bat
  12. sed -e "s#SCRIPT_NAME#$(*)_wrapper#" -e "s#SCRIPT_DIR#%GISBASE%/gui/scripts#" $(MODULE_TOPDIR)/scripts/windows_launch.bat > $@
  13. unix2dos $@
  14. default: $(PYFILES) $(BATFILES)
  15. else
  16. PYFILES := $(patsubst %.py, $(DSTDIR)/%, $(filter %.py, $(PY_SOURCES)))
  17. $(DSTDIR)/%: %.py | $(DSTDIR)
  18. $(INSTALL) $< $@
  19. default: $(PYFILES)
  20. endif
  21. $(DSTDIR):
  22. -test -d $@ | $(MKDIR) $@