Makefile 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. cpu := $(shell uname -m)
  2. os := $(shell uname -s)
  3. ver := $(shell grep -hoE "\(version +[^ \)]+" dune-project | cut -d " " -f2)
  4. ver := $(ver)-alpha+$(shell date +%Y%m%d)
  5. dst := _build/seppo-$(os)-$(cpu)-$(ver).cgi
  6. cver := 0.1
  7. cdst := _build/apchk-$(os)-$(cpu)-$(cver).cgi
  8. # %.ttl: %.rdf
  9. # rapper -i rdfxml -o turtle $< > $@
  10. %.rdf: %.ttl
  11. rapper -i turtle -o rdfxml-abbrev $< > $@
  12. final: build $(dst) $(cdst) doap.rdf
  13. pull:
  14. git pull
  15. deps:
  16. opam install . --deps-only --with-test --with-doc --yes
  17. deploy: final
  18. rsync -avPz $(dst) $(cdst) seppo.social:~/seppo.social/_bin/`date +%FT%H%M%S`/
  19. $(dst): _build/default/bin/seppo_bin.exe
  20. cp $< $@
  21. chmod u+w $@
  22. strip $@
  23. ls -l $@
  24. $(cdst): _build/default/chkr/apchk.exe
  25. cp $< $@
  26. chmod u+w $@
  27. strip $@
  28. ls -l $@
  29. test/assert.ml:
  30. curl --location --output $@ https://raw.githubusercontent.com/benjenkinsv95/ocaml-unit-testing-helpers/master/assert.ml
  31. #
  32. # https://github.com/ocaml/dune/tree/master/example/sample-projects/hello_world
  33. # via https://stackoverflow.com/a/54712669
  34. #
  35. .PHONY: all deps pull build clean test doc
  36. build:
  37. dune build --profile release bin/seppo_bin.exe
  38. dune build --profile release chkr/apchk.exe
  39. all: build
  40. test: test/assert.ml
  41. dune runtest
  42. doc: _build/post.svg _build/auth.svg
  43. dune build @doc
  44. clean:
  45. # rm -rf _build *.install
  46. dune clean
  47. _build/%.svg: %.msc
  48. mscgen -T svg -o $@ -i $^
  49. _build/%.svg: %.dot
  50. dot -Tsvg $^ > $@
  51. _build/%.pdf: %.dot
  52. dot -Tpdf $^ > $@