Makefile 667 B

1234567891011121314151617181920212223242526272829303132333435
  1. include config.mk
  2. SUBMAKES := $(wildcard ./src/*/Makefile)
  3. SUBDIRS := $(foreach _,${SUBMAKES},$(call dir,${_}))
  4. TARGETS := $(foreach _,${SUBDIRS},${_}$(call notdir,$(abspath ${_})))
  5. SUBMAKE_TARGETS := uninstall clean \
  6. test_compilers \
  7. clang-tidy-check clang-format-check check-all
  8. .PHONY: all
  9. all: ${TARGETS}
  10. define submake
  11. .PHONY: ${1}
  12. ${1}: ${2}
  13. { : \
  14. ; set -ue \
  15. ; for d in $${SUBDIRS} \
  16. ; do $$(MAKE) -C "$$$${d}" ${1} \
  17. ; done \
  18. }
  19. endef
  20. ${TARGETS}:
  21. ${MAKE} -C $(call dir,${@})
  22. $(eval $(call submake,install,${TARGETS}))
  23. $(foreach _,${SUBMAKE_TARGETS},$(eval $(call submake,${_},)))
  24. .PHONY: metalang
  25. metalang:
  26. ${MAKE} -C include ${@}