Makefile 552 B

1234567891011121314151617181920212223
  1. # Makefile for sub directories
  2. #
  3. # mindepth makes sure we do not include this Makeile
  4. MAKEFILES = $(shell find . -mindepth 2 -name 'Makefile')
  5. DIRS = $(patsubst %/Makefile, %, $(MAKEFILES))
  6. # The sets of directories to do various things in
  7. BUILDDIRS = $(DIRS:%=build-%)
  8. CLEANDIRS = $(DIRS:%=clean-%)
  9. all: $(BUILDDIRS)
  10. $(DIRS): $(BUILDDIRS)
  11. $(BUILDDIRS):
  12. $(MAKE) -C $(@:build-%=%)
  13. clean: $(CLEANDIRS)
  14. $(CLEANDIRS):
  15. $(MAKE) -C $(@:clean-%=%) clean
  16. .PHONY: subdirs $(DIRS)
  17. .PHONY: subdirs $(BUILDDIRS)
  18. .PHONY: subdirs $(CLEANDIRS)
  19. .PHONY: all clean