From 367f72900fd24bf51b135f04f6fd301f3e8efb15 Mon Sep 17 00:00:00 2001 From: Alasdair Armstrong Date: Thu, 20 Dec 2018 22:58:44 +0000 Subject: Make sure sail -v prints useful version info --- src/Makefile | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) (limited to 'src/Makefile') diff --git a/src/Makefile b/src/Makefile index 3e9d6f63..b658d90d 100644 --- a/src/Makefile +++ b/src/Makefile @@ -62,7 +62,7 @@ endif endif -.PHONY: all sail sail.native sail.byte test clean doc lib power test_power test_idempotence +.PHONY: all sail sail.native sail.byte manifest.ml test clean doc lib power test_power test_idempotence # set to -p on command line to enable gprof profiling OCAML_OPTS?= @@ -90,19 +90,22 @@ bytecode.ml: bytecode.lem lem_interp/interp_ast.lem: ../language/l2.ott ott -sort false -generate_aux_rules true -o lem_interp/interp_ast.lem -picky_multiple_parses true ../language/l2.ott -share_directory.ml: - echo "(* Generated file -- do not edit. *)" > share_directory.ml - echo let d=\"$(SHARE_DIR)\" >> share_directory.ml +manifest.ml: + echo "(* Generated file -- do not edit. *)" > manifest.ml + echo let dir=\"$(SHARE_DIR)\" >> manifest.ml + echo let commit=\"$(shell git rev-parse HEAD)\" >> manifest.ml + echo let branch=\"$(shell git rev-parse --abbrev-ref HEAD)\" >> manifest.ml + echo let version=\"$(shell git describe)\" >> manifest.ml -sail: ast.ml bytecode.ml share_directory.ml +sail: ast.ml bytecode.ml manifest.ml ocamlbuild -use-ocamlfind sail.native sail_lib.cma sail_lib.cmxa -isail: ast.ml bytecode.ml share_directory.ml +isail: ast.ml bytecode.ml manifest.ml ocamlbuild -use-ocamlfind isail.native sail.native: sail -sail.byte: ast.ml bytecode.ml share_directory.ml +sail.byte: ast.ml bytecode.ml manifest.ml ocamlbuild -use-ocamlfind -cflag -g sail.byte interpreter: lem_interp/interp_ast.lem @@ -148,7 +151,7 @@ clean: -rm -f bytecode.ml -rm -f bytecode.lem -rm -f bytecode.ml.bak - -rm -f share_directory.ml + -rm -f manifest.ml doc: ocamlbuild -use-ocamlfind sail.docdir/index.html -- cgit v1.2.3 From e0479ea3c479547c093ade9f675e5a0a652e8a34 Mon Sep 17 00:00:00 2001 From: Alasdair Armstrong Date: Wed, 26 Dec 2018 15:24:55 +0000 Subject: Add makefile target for building with Bisect coverage --- src/Makefile | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/Makefile') diff --git a/src/Makefile b/src/Makefile index b658d90d..aeb23b9e 100644 --- a/src/Makefile +++ b/src/Makefile @@ -62,7 +62,7 @@ endif endif -.PHONY: all sail sail.native sail.byte manifest.ml test clean doc lib power test_power test_idempotence +.PHONY: all sail coverage sail.native sail.byte manifest.ml test clean doc lib power test_power test_idempotence # set to -p on command line to enable gprof profiling OCAML_OPTS?= @@ -103,6 +103,9 @@ sail: ast.ml bytecode.ml manifest.ml isail: ast.ml bytecode.ml manifest.ml ocamlbuild -use-ocamlfind isail.native +coverage: ast.ml bytecode.ml manifest.ml + BISECT_COVERAGE=YES ocamlbuild -use-ocamlfind -plugin-tag 'package(bisect_ppx-ocamlbuild)' isail.native + sail.native: sail sail.byte: ast.ml bytecode.ml manifest.ml -- cgit v1.2.3 From ee2eb2bad10ad8d7c730538f239474ce103efa16 Mon Sep 17 00:00:00 2001 From: Alasdair Date: Fri, 8 Feb 2019 23:06:47 +0000 Subject: Cleanup src Makefile When we are building from git, we put the git version info in manifest.ml, so we'll get the following from sail -v Sail $last_git_tag ($branch @ $commit_sha) If we are be built from opam we can't assume we are in a git repository as opam downloads specific tags as tarballs, so instead we check for the precense of SHARE_DIR which is set by our opam build script, and instead output Sail 0.8 (sail2 @ opam) which is the next git tag (current is 0.7.1, this must be updated by hand), the branch name from which opam releases are generated and then opam rather than the commit SHA. I also removed the Makefile-non-opam file as it's bitrotted and unused --- src/Makefile | 39 ++++++++++----------------------------- 1 file changed, 10 insertions(+), 29 deletions(-) (limited to 'src/Makefile') diff --git a/src/Makefile b/src/Makefile index aeb23b9e..b0b22f77 100644 --- a/src/Makefile +++ b/src/Makefile @@ -62,16 +62,14 @@ endif endif -.PHONY: all sail coverage sail.native sail.byte manifest.ml test clean doc lib power test_power test_idempotence +.PHONY: all sail isail coverage sail.native sail.byte manifest.ml clean doc lib # set to -p on command line to enable gprof profiling OCAML_OPTS?= -SHARE_DIR?=$(realpath ..) - all: sail lib doc -full: sail lib power doc test +full: sail lib doc ast.lem: ../language/sail.ott ott -sort false -generate_aux_rules true -o ast.lem -picky_multiple_parses true ../language/sail.ott @@ -87,15 +85,19 @@ bytecode.ml: bytecode.lem lem -ocaml bytecode.lem -lib . -lib gen_lib/ sed -i.bak -f ast.sed bytecode.ml -lem_interp/interp_ast.lem: ../language/l2.ott - ott -sort false -generate_aux_rules true -o lem_interp/interp_ast.lem -picky_multiple_parses true ../language/l2.ott - manifest.ml: echo "(* Generated file -- do not edit. *)" > manifest.ml - echo let dir=\"$(SHARE_DIR)\" >> manifest.ml +ifndef SHARE_DIR + echo let dir=\"$(realpath ..)\" >> manifest.ml echo let commit=\"$(shell git rev-parse HEAD)\" >> manifest.ml echo let branch=\"$(shell git rev-parse --abbrev-ref HEAD)\" >> manifest.ml echo let version=\"$(shell git describe)\" >> manifest.ml +else + echo let dir=\"$(SHARE_DIR)\" >> manifest.ml + echo let commit=\"opam\" >> manifest.ml + echo let branch=\"sail2\" >> manifest.ml + echo let version=\"0.8\" >> manifest.ml +endif sail: ast.ml bytecode.ml manifest.ml ocamlbuild -use-ocamlfind sail.native sail_lib.cma sail_lib.cmxa @@ -115,31 +117,10 @@ interpreter: lem_interp/interp_ast.lem ocamlbuild -use-ocamlfind lem_interp/extract.cmxa ocamlbuild -use-ocamlfind lem_interp/extract.cma -test: sail interpreter - ocamlbuild -use-ocamlfind test/run_tests.native - ./run_tests.native - THIS_MAKEFILE := $(realpath $(lastword $(MAKEFILE_LIST))) SAIL_DIR:=$(realpath $(dir $(THIS_MAKEFILE))..) PROJECT_ROOT=$(realpath $(dir $(THIS_MAKEFILE))../..) -_build/sail_values.ml: gen_lib/sail_values.ml - $(CP_TO_BUILD) - -_build/power.ml: $(SAIL_DIR)/src/test/power.sail sail.native - cd _build; \ - ./sail.native -lem_ast -ocaml $< -o $(basename $(@)) - -_build/power.native: _build/sail_values.ml _build/power.ml - env OCAMLRUNPARAM=l=100M ocamlfind ocamlopt $(OCAML_OPTS) -g -package zarith -package unix -I _build -linkpkg $^ -o $@ - -_build/armv8_embed.ml: sail.native - make -C ../arm ocaml - cp ../arm/build/armv8_embed.ml $@ - -_build/arm.native: _build/sail_values.ml _build/armv8_embed.ml - env OCAMLRUNPARAM=l=100M ocamlfind ocamlopt $(OCAML_OPTS) -g -package zarith -package unix -I _build -linkpkg $^ -o $@ - clean: -ocamlbuild -clean -rm -rf _build *.native -- cgit v1.2.3