@ -11,8 +11,17 @@ INSTALLS = sledge
FMTS = @_build/dbg/src/fmt
DBG_TARGETS = $( patsubst %,_build/dbg/%.exe,$( EXES) ) $( patsubst %,_build/dbg/%.install,$( INSTALLS) ) _build/dbg/sledge-help.txt
OPT_TARGETS = $( patsubst %,_build/opt/%.exe,$( EXES) ) $( patsubst %,_build/opt/%.install,$( INSTALLS) ) _build/opt/sledge-help.txt
DBG_OPT_TARGETS = $( patsubst %,_build/dbg-opt/%.exe,$( EXES) ) $( patsubst %,_build/dbg-opt/%.install,$( INSTALLS) ) _build/dbg-opt/sledge-help.txt
TARGETS = $( DBG_TARGETS) $( subst dbg,dbg-opt,$( DBG_TARGETS) ) $( subst dbg,opt,$( DBG_TARGETS) )
dune_build_dbg = dune build $( DBG_TARGETS)
dune_install_dbg = dune install --context= dbg --prefix= _build/_install/dbg sledge 2>/dev/null
dune_build_dbg_opt = $( subst dbg,dbg-opt,$( dune_build_dbg) )
dune_install_dbg_opt = $( subst dbg,dbg-opt,$( dune_install_dbg) )
dune_build_opt = $( subst dbg,opt,$( dune_build_dbg) )
dune_install_opt = $( subst dbg,opt,$( dune_install_dbg) )
DUNEINS = $( shell find src model -name dune.in)
DUNES = $( patsubst %.in,%,$( DUNEINS) )
@ -21,7 +30,7 @@ DUNES = $(patsubst %.in,%,$(DUNEINS))
dunes : $( DUNES )
%/dune : dune -common .in %/dune .in
@ cat $+ > $@
cat $+ > $@
.PHONY : setup
setup : dunes
@ -32,23 +41,29 @@ check: setup
.PHONY : exes
exes : setup
dune build $( DBG_TARGETS) $( DBG_OPT_TARGETS) $( OPT_TARGETS)
dune build $( TARGETS)
$( dune_install_dbg)
$( dune_install_dbg_opt)
$( dune_install_opt)
.PHONY : dbg
dbg : setup
dune build $( DBG_TARGETS)
$( dune_build_dbg)
$( dune_install_dbg)
.PHONY : do
do : setup
dune build $( DBG_OPT_TARGETS)
$( dune_build_dbg_opt)
$( dune_install_dbg_opt)
.PHONY : opt
opt : setup
dune build $( OPT_TARGETS)
$( dune_build_opt)
$( dune_install_opt)
.PHONY : watch
watch : setup
dune build --watch $( DBG_TARGETS) $( DBG_OPT_TARGETS) $( OPT_ TARGETS)
dune build --watch $( TARGETS)
.PHONY : test
test : setup
@ -62,10 +77,10 @@ BISECT_DIR = $(CURDIR)/_coverage/out
.PHONY : coverage
coverage : setup
@ rm -rf _coverage
@ mkdir -p $( BISECT_DIR)
@BISECT_FILE = $( BISECT_DIR) /bisect dune build --force @_build/coverage/runtest
@ find $( BISECT_DIR) -type f | xargs bisect-ppx-report -I _build/coverage/ -text _coverage/summary.txt -html _coverage/
rm -rf _coverage
mkdir -p $( BISECT_DIR)
BISECT_FILE = $( BISECT_DIR) /bisect dune build --force @_build/coverage/runtest
find $( BISECT_DIR) -type f | xargs bisect-ppx-report -I _build/coverage/ -text _coverage/summary.txt -html _coverage/
@echo "open _coverage/index.html"
.PHONY : clean
@ -76,7 +91,7 @@ clean:
.PHONY : fmt
fmt :
dune build $( FMTS) --auto-promote
ocamlformat -i src/version.ml.in $( DUNEINS)
ocamlformat -i $( DUNEINS)
clang-format -i model/llair_intrinsics.h model/cxxabi.cpp
${ MAKE } -C test fmt