Makefile 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. # Copyright (c) 2013-2015, Loïc Hoguin <essen@ninenines.eu>
  2. #
  3. # Permission to use, copy, modify, and/or distribute this software for any
  4. # purpose with or without fee is hereby granted, provided that the above
  5. # copyright notice and this permission notice appear in all copies.
  6. #
  7. # THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
  8. # WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
  9. # MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
  10. # ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
  11. # WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
  12. # ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
  13. # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  14. BUILD_CONFIG_FILE ?= $(CURDIR)/build.config
  15. BUILD_CONFIG = $(shell sed "s/\#.*//" $(BUILD_CONFIG_FILE))
  16. ERLANG_MK = erlang.mk
  17. ERLANG_MK_VERSION = $(shell git describe --tags --dirty)
  18. .PHONY: all check
  19. all:
  20. awk 'FNR==1 && NR!=1{print ""}1' $(patsubst %,%.mk,$(BUILD_CONFIG)) \
  21. | sed 's/^ERLANG_MK_VERSION = .*/ERLANG_MK_VERSION = $(ERLANG_MK_VERSION)/' > $(ERLANG_MK)
  22. ifdef p
  23. # Remove p from the list of variables since that conflicts with bootstrapping.
  24. MAKEOVERRIDES := $(filter-out p=$p,$(MAKEOVERRIDES))
  25. check:
  26. $(MAKE) -C test pkg-$p KEEP_BUILDS=1
  27. else
  28. ifdef c
  29. check:
  30. $(MAKE) -C test $c
  31. else
  32. check:
  33. $(MAKE) -C test
  34. endif
  35. endif
  36. packages:
  37. $(MAKE) -C test packages
  38. summary:
  39. @mkdir -p test/logs/
  40. @touch test/logs/latest.log test/packages/errors.log
  41. -@sort test/packages/errors.log | diff test/logs/latest.log -
  42. @sort test/packages/errors.log > test/logs/latest.log
  43. @cp test/logs/latest.log "test/logs/$(shell date '+%F_%T%z')"
  44. search:
  45. @$(MAKE) --no-print-directory \
  46. -f core/core.mk $(addprefix -f,$(wildcard index/*.mk)) -f core/index.mk \
  47. search
  48. clean:
  49. $(MAKE) -C test clean
  50. rm -rf doc/guide.pdf doc/html
  51. docs:
  52. $(MAKE) -f core/core.mk -f core/docs.mk -f plugins/asciidoc.mk asciidoc