Makefile 957 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. cpu := $(shell uname -m)
  2. os := $(shell uname -s)
  3. ver := 0.1
  4. dst := _build/html2broadcast-br-v${ver}-$(os)-$(cpu)
  5. final: build $(dst)
  6. $(dst): _build/default/bin/html2broadcast.exe
  7. cp $^ $@
  8. chmod u+w $@
  9. strip $@
  10. file $@
  11. ls -Al $@
  12. test/assert.ml:
  13. curl --location --output $@ https://raw.githubusercontent.com/benjenkinsv95/ocaml-unit-testing-helpers/master/assert.ml
  14. #
  15. # https://github.com/ocaml/dune/tree/master/example/sample-projects/hello_world
  16. # via https://stackoverflow.com/a/54712669
  17. #
  18. .PHONY: all build clean test install uninstall doc examples
  19. bin/version.ml:
  20. @echo "let git_sha = \""`git rev-parse --short HEAD`"\"" > $@
  21. @echo "let date = \""`date +'%FT%T%z'`"\"" >> $@
  22. build: bin/version.ml
  23. dune build bin/html2broadcast.exe
  24. all: build
  25. test: test/assert.ml
  26. dune runtest
  27. examples:
  28. dune build @examples
  29. install:
  30. dune install
  31. uninstall:
  32. dune uninstall
  33. doc:
  34. dune build @doc
  35. clean:
  36. rm -rf _build bin/version.ml