summaryrefslogtreecommitdiff
path: root/Makefile
blob: a22e19df79c0b2b8646eedb8f1c9bd9ff39b05dc (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
.PHONY: all sail language clean archs isabelle-lib apply_header

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

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)
	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

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

language:
	$(MAKE) -C language

interpreter:
	$(MAKE) -C src interpreter

archs:
	for arch in arm mips cheri; do\
	  $(MAKE) -C "$$arch" || exit;\
	done

isabelle-lib:
	$(MAKE) -C isabelle-lib

apply_header:
	$(MAKE) clean
	headache -c etc/headache_config -h etc/mips_header `ls mips/*.sail`
	headache -c etc/headache_config -h etc/mips_header `ls cheri/*.sail`
	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`
	$(MAKE) -C arm apply_header

anon_dist:
	headache -c etc/headache_config -h etc/anon_header `ls mips/*.sail`
	headache -c etc/headache_config -h etc/anon_header `ls cheri/*.sail`
	headache -c etc/headache_config -h etc/anon_header `ls riscv/*.sail`
	headache -c etc/headache_config -h etc/anon_header `ls riscv/*.ml`
	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 arm/*.sail`
	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 arm ; do\
	  $(MAKE) -C "$$subdir" clean;\
	done
	-rm sail