2
0

Makefile 1.0 KB

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