Makefile 768 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. cpu := $(shell uname -m)
  2. os := $(shell uname -s)
  3. ver := 0.1
  4. dst := _build/geohash-$(os)-$(cpu)-$(ver).cgi
  5. final: build $(dst)
  6. $(dst): _build/default/bin/main.exe
  7. cp $< $@
  8. chmod u+w $@
  9. strip $@
  10. ls -l $@
  11. test/assert.ml:
  12. curl --location --output $@ https://raw.githubusercontent.com/benjenkinsv95/ocaml-unit-testing-helpers/master/assert.ml
  13. #
  14. # https://github.com/ocaml/dune/tree/master/example/sample-projects/hello_world
  15. # via https://stackoverflow.com/a/54712669
  16. #
  17. .PHONY: all build clean test install uninstall doc examples
  18. build:
  19. dune build bin/main.exe
  20. all: build
  21. test: test/assert.ml
  22. dune runtest
  23. examples:
  24. dune build @examples
  25. install:
  26. dune install
  27. uninstall:
  28. dune uninstall
  29. doc:
  30. dune build @doc
  31. clean:
  32. rm -rf lib/res.ml _build *.install