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