blob: 16ad6ab4a72e5e108166b8159f4a7a25254f7958 (
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
|
BUILDDIR=./build
SAIL=../sail
ifeq ("$(wildcard $(SAIL))","")
$(warning can not find Sail)
endif
LEM=../../lem/lem
ifeq ("$(wildcard $(LEM))","")
$(warning can not find Lem)
endif
LEMINTERPDIR=../src/lem_interp/
# the order of the files is important
SOURCES=armv8.h.sail\
armv8_A64_sys_regs.sail\
armv8_A64_special_purpose_regs.sail\
armv8_A32_sys_regs.sail\
armv8_pstate.sail\
armv8_lib.h.sail\
armv8_common_lib.sail\
armv8_A64_lib.sail\
armv8.sail
all: $(BUILDDIR)/armv8.ml
clean:
rm -rf $(BUILDDIR)
.PHONY: all clean
$(BUILDDIR):
mkdir -p $@
$(BUILDDIR)/armv8.lem: $(SOURCES) | $(BUILDDIR)
$(SAIL) -lem_ast $(SOURCES) -o $(basename $@)
# sail generates the .lem file in pwd
mv $(notdir $@) $@
$(BUILDDIR)/armv8.ml: $(BUILDDIR)/armv8.lem
$(LEM) -ocaml -lib $(LEMINTERPDIR) $<
######################################################################
ETCDIR=../etc
SAIL_FILES=$(wildcard *.sail)
apply_header:
headache -c $(ETCDIR)/headache_config -h $(ETCDIR)/arm_header $(SAIL_FILES)
.PHONY: apply_header
|