/Makefile

http://github.com/petar/GoHTTP · Makefile · 70 lines · 42 code · 18 blank · 10 comment · 5 complexity · 2b5b1169a016cf4d91aff8cd8bcacf40 MD5 · raw file

  1. # Copyright 2009 The Go Authors. All rights reserved.
  2. # Use of this source code is governed by a BSD-style
  3. # license that can be found in the LICENSE file.
  4. #
  5. # After editing the DIRS= list or adding imports to any Go files
  6. # in any of those directories, run:
  7. #
  8. # ./deps.bash
  9. #
  10. # to rebuild the dependency information in Make.deps.
  11. nullstring :=
  12. space := $(nullstring) # a space at the end
  13. ifndef GOBIN
  14. QUOTED_HOME=$(subst $(space),\ ,$(HOME))
  15. GOBIN=$(QUOTED_HOME)/bin
  16. endif
  17. QUOTED_GOBIN=$(subst $(space),\ ,$(GOBIN))
  18. all: install
  19. DIRS=\
  20. util\
  21. http\
  22. cache\
  23. server\
  24. server/static\
  25. server/rpc\
  26. TEST=\
  27. $(filter-out $(NOTEST),$(DIRS))
  28. BENCH=\
  29. $(filter-out $(NOBENCH),$(TEST))
  30. clean.dirs: $(addsuffix .clean, $(DIRS))
  31. install.dirs: $(addsuffix .install, $(DIRS))
  32. nuke.dirs: $(addsuffix .nuke, $(DIRS))
  33. test.dirs: $(addsuffix .test, $(TEST))
  34. bench.dirs: $(addsuffix .bench, $(BENCH))
  35. %.clean:
  36. +cd $* && $(QUOTED_GOBIN)/gomake clean
  37. %.install:
  38. +cd $* && $(QUOTED_GOBIN)/gomake install
  39. %.nuke:
  40. +cd $* && $(QUOTED_GOBIN)/gomake nuke
  41. %.test:
  42. +cd $* && $(QUOTED_GOBIN)/gomake test
  43. %.bench:
  44. +cd $* && $(QUOTED_GOBIN)/gomake bench
  45. clean: clean.dirs
  46. install: install.dirs
  47. test: test.dirs
  48. bench: bench.dirs
  49. nuke: nuke.dirs
  50. deps:
  51. ./deps.bash
  52. -include Make.deps