## == A few words on build system ==
## RefactorErl can be released with many different options
##  - yaws is now bundled with the tool; more information about this in the
##    deps section of rebar.config
##  - property based checking defaults to `proper`, QuickCheck can be used with 
##    the `release-eqc` rule
##	- igraph !! CURRENTLY NOT SUPPORTED !! can be compiled to RefactorErl
##    with the `release-igraph` rule
##  - you can combine the rules: `release-eqc-igraph` and `release-igraph-eqc`
##    equivalent


# INTERFACE RULES

# Regular release, without eqc and igraph
default: release scannertab

release: 
	rebar3 release

doc: 
	rebar3 release
	rebar3 edoc

# Release with eqc
release-eqc:
	rebar3 as quickcheck release

# Release with igraph
release-igraph: compile-igraph-cpp
	IGRAPH_COMPILE=true rebar3 release 

# Releasw with eqc and igraph
release-igraph-eqc: release-eqc-igraph
release-eqc-igraph: compile-igraph-cpp
	IGRAPH_COMPILE=true rebar3 as quickcheck release

compile-igraph-cpp:
	./tool/scripts/get_and_compile_igraph.sh

clean:
	rebar3 clean

db-clean:
	./tool/scripts/referl dclean

scannertab:
	 @erl -eval 'ok=refcore_erl_scanner:create_tab(), halt(0).' -noshell -pa "_build/default/lib/referl_core/ebin" -pa "_build/default/lib/referl_gen/ebin"


## CONTAINERISATION

docker:
	docker build -t refactorerl --no-cache .

docker-base: 
	docker build -t refactorerl:base -f Dockerfile.base --no-cache .

docker-run:
	docker run -it --tty refactorerl