Multi.make 884 B

1234567891011121314151617181920212223242526272829303132333435
  1. PACKAGE = "grassmods"
  2. include $(MODULE_TOPDIR)/include/Make/Vars.make
  3. include $(MODULE_TOPDIR)/include/Make/Rules.make
  4. include $(MODULE_TOPDIR)/include/Make/Html.make
  5. include $(MODULE_TOPDIR)/include/Make/Compile.make
  6. PROGFILES = $(patsubst %,$(BIN)/%$(EXE),$(PROGRAMS))
  7. HTMLFILES = $(patsubst %,$(HTMLDIR)/%.html,$(PROGRAMS))
  8. MANFILES = $(patsubst %,$(MANDIR)/%.$(MANSECT),$(PROGRAMS))
  9. multi: progs htmlmulti
  10. progs: $(PROGFILES)
  11. ifdef CROSS_COMPILING
  12. htmlmulti:
  13. else
  14. htmlmulti: $(HTMLFILES) $(MANFILES)
  15. endif
  16. $(BIN)/%$(EXE): $(DEPENDENCIES)
  17. $(call linker)
  18. define objs_rule
  19. $(BIN)/$(1)$(EXE): $$(patsubst %.o,$(OBJDIR)/%.o,$$($$(subst .,_,$(1)_OBJS)))
  20. $(HTMLDIR)/$(1).html: $(1).html $(1).tmp.html $(BIN)/$(1)$(EXE)
  21. $(1).tmp.html: $(BIN)/$(1)$(EXE)
  22. $$(call htmldesc,$$<,$$@)
  23. .INTERMEDIATE: $(1).tmp.html
  24. endef
  25. $(foreach prog,$(PROGRAMS),$(eval $(call objs_rule,$(prog))))