1
0

Makefile 896 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. # Makefile for sub directories
  2. AMBER = st
  3. SERVER = server
  4. REPL = repl
  5. # REST is all except AMBER
  6. REST = $(SERVER) $(REPL)
  7. # And these are all
  8. DIRS = $(AMBER) $(REST)
  9. # The sets of directories to do various things in
  10. BUILDDIRS = $(DIRS:%=build-%)
  11. INSTALLDIRS = $(AMBER:%=install-%)
  12. CLEANDIRS = $(REST:%=clean-%)
  13. CLEANALLDIRS = $(DIRS:%=clean-%)
  14. all: $(BUILDDIRS)
  15. $(DIRS): $(BUILDDIRS)
  16. $(BUILDDIRS):
  17. $(MAKE) -C $(@:build-%=%)
  18. amber: build-st
  19. # server needs Amber first
  20. build-server: build-st
  21. install: $(INSTALLDIRS)
  22. $(INSTALLDIRS):
  23. $(MAKE) -C $(@:install-%=%) install
  24. clean: $(CLEANDIRS)
  25. $(CLEANDIRS):
  26. $(MAKE) -C $(@:clean-%=%) clean
  27. cleanall: $(CLEANALLDIRS)
  28. $(CLEANALLDIRS):
  29. $(MAKE) -C $(@:clean-%=%) clean
  30. .PHONY: subdirs $(DIRS)
  31. .PHONY: subdirs $(BUILDDIRS)
  32. .PHONY: subdirs $(INSTALLDIRS)
  33. .PHONY: subdirs $(CLEANDIRS)
  34. .PHONY: subdirs $(CLEANALLDIRS)
  35. .PHONY: all install clean