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