Module.make 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. # common dependencies and rules for building module
  2. PACKAGE = "grassmods"
  3. HTMLSRC = $(BIN)/$(PGM)$(EXE)
  4. include $(MODULE_TOPDIR)/include/Make/Vars.make
  5. include $(MODULE_TOPDIR)/include/Make/Rules.make
  6. include $(MODULE_TOPDIR)/include/Make/Html.make
  7. include $(MODULE_TOPDIR)/include/Make/Compile.make
  8. ETCFILES_DST := $(patsubst %,$(ETC)/$(PGM)/%,$(ETCFILES))
  9. cmd: $(BIN)/$(PGM)$(EXE) $(ETCFILES_DST) html
  10. $(BIN)/$(PGM)$(EXE): $(ARCH_OBJS) $(DEPENDENCIES)
  11. $(call linker)
  12. $(ETC)/$(PGM)/%: % | $(ETC)/$(PGM)
  13. $(INSTALL_DATA) $< $@
  14. $(ETC)/$(PGM):
  15. $(MKDIR) $@
  16. install:
  17. $(INSTALL) $(ARCH_DISTDIR)/bin/$(PGM)$(EXE) $(INST_DIR)/bin/
  18. $(INSTALL_DATA) $(HTMLDIR)/$(PGM).html $(INST_DIR)/docs/html/
  19. $(eval IMG := $(wildcard $(HTMLDIR)/*.png) $(wildcard $(HTMLDIR)/*.jpg) $(wildcard $(HTMLDIR)/*.gif))
  20. if [ -n "$(IMG)" ] ; then \
  21. $(INSTALL_DATA) $(IMG) $(INST_DIR)/docs/html/ ; \
  22. fi
  23. $(INSTALL_DATA) $(ARCH_DISTDIR)/docs/man/man1/$(PGM).1 $(INST_DIR)/docs/man/man1/
  24. if [ -d "$(ETC)/$(PGM)" ] ; then \
  25. cp -rL $(ETC)/$(PGM) $(INST_DIR)/etc/ ; \
  26. fi
  27. .PHONY: cmd