1
0

Makefile 1.0 KB

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