summaryrefslogtreecommitdiff
path: root/Makefile
blob: 4a4c22a9c25e909f520f6532a6b52d6dcc09cae9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
.PHONY: all sail language clean archs isabelle-lib apply_header docker

INSTALL_DIR ?= .

all: sail

sail:
	$(MAKE) -C src sail
	ln -f -s src/sail.native sail

isail:
	$(MAKE) -C src isail
	ln -f -s src/isail.native sail

coverage:
	$(MAKE) -C src coverage
	ln -f -s src/isail.native sail

install:
	if [ -z "$(SHARE_DIR)" ]; then echo SHARE_DIR is unset; false; fi
	mkdir -p $(INSTALL_DIR)/bin
	cp src/isail.native $(INSTALL_DIR)/bin/sail
	mkdir -p $(SHARE_DIR)
	make -C lib/isabelle all
	make -C lib/hol all-scripts
	cp -r lib $(SHARE_DIR)
	mkdir -p $(SHARE_DIR)/src
	cp src/elf_loader.ml $(SHARE_DIR)/src
	cp src/sail_lib.ml $(SHARE_DIR)/src
	cp src/util.ml $(SHARE_DIR)/src
	cp -r src/gen_lib $(SHARE_DIR)/src
	cp -r src/lem_interp $(SHARE_DIR)/src
	$(MAKE) install_libsail

install_libsail:
	-$(MAKE) uninstall_libsail
	ocamlfind install sail src/META src/_build/libsail.* $$(find src/_build \( -name '*.mli' -or -name '*.cmi' -or -name '*.cmx' \) -and -not -name 'myocamlbuild.*')

uninstall:
	if [ -z "$(SHARE_DIR)" ]; then echo SHARE_DIR is unset; false; else rm -rf $(SHARE_DIR); fi
	rm -f $(INSTALL_DIR)/bin/sail
	$(MAKE) uninstall_libsail

uninstall_libsail:
	ocamlfind remove sail

language:
	$(MAKE) -C language

interpreter:
	$(MAKE) -C src interpreter

apply_header:
	$(MAKE) clean
	headache -c etc/headache_config -h LICENCE `ls src/Makefile*`
	headache -c etc/headache_config -h LICENCE `ls src/*.ml*`
	headache -c etc/headache_config -h LICENCE `ls src/lem_interp/*.ml`
	headache -c etc/headache_config -h LICENCE `ls src/lem_interp/*.lem`

anon_dist:
	headache -c etc/headache_config -h etc/anon_header `ls lib/*.ml`
	headache -c etc/headache_config -h etc/anon_header `ls lib/coq/*.v`
	headache -c etc/headache_config -h etc/anon_header `ls src/Makefile*`
	headache -c etc/headache_config -h etc/anon_header `ls src/*.ml*`
	headache -c etc/headache_config -h etc/anon_header `ls src/*.lem`
	headache -c etc/headache_config -h etc/anon_header `ls src/lem_interp/*.ml`
	headache -c etc/headache_config -h etc/anon_header `ls src/lem_interp/*.lem`
	headache -c etc/headache_config -h etc/anon_header `ls snapshots/isabelle/lib/sail/*.thy`
	headache -c etc/headache_config -h etc/anon_header `ls snapshots/isabelle/lib/lem/*.thy`
	headache -c etc/headache_config -h etc/anon_header `ls snapshots/hol4/lem/hol-lib/*.sml`

clean:
	for subdir in src ; do\
	  $(MAKE) -C "$$subdir" clean;\
	done
	rm -f sail

docker:
	docker build --tag sail:0.1 .
	@echo 'for example: docker run --volume `PWD`:/data/ sail:0.1 --help'