Makefile 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. # Copyright (c) 2013-2016, 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. export LC_COLLATE=C; \
  21. awk 'FNR==1 && NR!=1{print ""}1' $(patsubst %,%.mk,$(BUILD_CONFIG)) \
  22. | sed 's/^ERLANG_MK_VERSION = .*/ERLANG_MK_VERSION = $(ERLANG_MK_VERSION)/' > $(ERLANG_MK)
  23. ifdef p
  24. # Remove p from the list of variables since that conflicts with bootstrapping.
  25. MAKEOVERRIDES := $(filter-out p=$p,$(MAKEOVERRIDES))
  26. check:
  27. $(MAKE) -C test pkg-$p KEEP_BUILDS=1
  28. else
  29. ifdef c
  30. check:
  31. $(MAKE) -C test $c
  32. else
  33. check:
  34. $(MAKE) -C test
  35. endif
  36. endif
  37. packages:
  38. $(MAKE) -C test packages
  39. summary:
  40. @mkdir -p test/logs/
  41. @touch test/logs/latest.log test/packages/errors.log
  42. -@sort test/packages/errors.log | diff test/logs/latest.log -
  43. @sort test/packages/errors.log > test/logs/latest.log
  44. @cp test/logs/latest.log "test/logs/$(shell date '+%F_%T%z')"
  45. search:
  46. @$(MAKE) --no-print-directory \
  47. -f core/core.mk $(addprefix -f,$(wildcard index/*.mk)) -f core/index.mk \
  48. search
  49. clean:
  50. $(MAKE) -C test clean
  51. rm -rf doc/guide.pdf doc/html
  52. git checkout erlang.mk
  53. docs:
  54. $(MAKE) -f core/core.mk -f core/docs.mk -f plugins/asciidoc.mk asciidoc DEPS=asciideck
  55. up:
  56. git clone git@github.com:ninenines/erlang.mk.git gh-pages
  57. cd gh-pages && git checkout gh-pages
  58. cd gh-pages && make
  59. cd gh-pages && git push origin gh-pages
  60. rm -rf gh-pages