summaryrefslogtreecommitdiff
path: root/arm/Makefile
diff options
context:
space:
mode:
authorShaked Flur2017-12-04 14:54:54 +0000
committerShaked Flur2017-12-04 14:54:54 +0000
commit5fa993caef3c48da36f641bf3608a9515ecc40cf (patch)
tree1d4e4b9a2bb390744708f4fd4486616fd7d1b4b2 /arm/Makefile
parent748318f8af7b82a01bb151f1bfcb466d0fc8291f (diff)
match what rmem expects from sail/arm
Diffstat (limited to 'arm/Makefile')
-rw-r--r--arm/Makefile59
1 files changed, 20 insertions, 39 deletions
diff --git a/arm/Makefile b/arm/Makefile
index 18eba393..d7124df6 100644
--- a/arm/Makefile
+++ b/arm/Makefile
@@ -1,16 +1,5 @@
-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/
+SAIL:=../src/sail.native
+LEM:=../../lem/lem
# the order of the files is important
SOURCES=armV8.h.sail\
@@ -23,39 +12,28 @@ SOURCES=armV8.h.sail\
armV8_A64_lib.sail\
armV8.sail
-all: $(BUILDDIR)/armv8.ml
-
-clean:
- rm -rf $(BUILDDIR)
-
-ocaml: $(BUILDDIR)/armv8_embed.ml
+all: armV8.lem armV8.ml armV8_embed.lem
-.PHONY: all clean ocaml
+armV8.lem: $(SOURCES)
+ $(SAIL) -lem_ast -o armV8 $(SOURCES)
-$(BUILDDIR):
- mkdir -p $@
+armV8.ml: armV8.lem ../src/lem_interp/interp_ast.lem
+ $(LEM) -ocaml -lib ../src/lem_interp/ $<
-$(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) $<
-
-$(BUILDDIR)/armv8_embed.ml: $(SOURCES) | $(BUILDDIR)
- $(SAIL) -ocaml $(SOURCES) -o $(basename $@)
-# sail generates the .lem file in pwd
- mv $(notdir $@) $@
+armV8_embed.lem: $(SOURCES) ../etc/regfp.sail aarch64_regfp.sail
+# also generates armV8_embed_sequential.lem, armV8_embed_types.lem, armV8_toFromInterp.lem
+ $(SAIL) -lem -lem_lib ArmV8_extras_embed -o armV8 $^
+clean:
+ rm -f armV8.lem armV8.ml
+ rm -f armV8_embed*.lem armV8_toFromInterp.lem
######################################################################
ETCDIR=../etc
apply_header:
- -chmod u+w *.sail
headache -c $(ETCDIR)/headache_config -h $(ETCDIR)/arm_header *.sail
- chmod a-w *.sail
.PHONY: apply_header
@@ -63,10 +41,13 @@ apply_header:
IDLARM=../../../rsem/idlarm
pull_from_idlarm:
- svn up $(IDLARM)
- $(MAKE) -C $(IDLARM)
- -chmod u+w *.sail
+ $(MAKE) -C $(IDLARM) clean
+ $(MAKE) -C $(IDLARM) san_sail
rm -f *.sail
cp -a $(IDLARM)/build/*.sail ./
- chmod a-w *.sail
+ cp -a $(IDLARM)/armV8_extras_embed.lem ./
+ cp -a $(IDLARM)/armV8_extras_embed_sequential.lem ./
+ cp -a $(IDLARM)/armV8_extras.lem ./
+ mkdir -p gen
+ cp -a $(IDLARM)/*.hgen gen/
$(MAKE) apply_header