######################################################################
# Copyright (C) 2019-2020 Alain Giorgetti and Clotilde Erard         #
# FEMTO-ST institute                                                 #
######################################################################

######################################################################
#  This software is distributed under the terms of the GNU Lesser    #
#  General Public License version 2.1                                #
######################################################################

# why3/enum/generator/endo/Makefile

# Used file path list
DIRS?= -L . -L .. -L ../..  -L ../fact -L ../permutation

.PHONY: test run ide prove extract clean

# Test session
test:
	@echo "1. Boolean function b_is_endo is sound? (with small_check)"
	bash ../../bet.sh "$(DIRS)" Endo.mlw Endo__EndoBEToracle.test1
	# @echo "2. Boolean function b_is_endo is sound? (with small_check_list)"
	# bash ../../bet.sh "$(DIRS)" Endo.mlw Endo__EndoSound.test1
	# @echo "3. Boolean function b_is_endo_wrong is sound? (with small_check_list)"
	# bash ../../bet.sh "$(DIRS)" Endo.mlw Endo__EndoSound.test2

run:
	why3 execute --debug interp $(DIRS) Endo.mlw Main.run

# Start Why3 IDE with Endo.mlw
ide:
	why3 ide $(DIRS) Endo.mlw

prove:
	why3 prove $(DIRS) -P alt-ergo Endo.mlw

# Extract WhyML code to OCaml. Folder OCaml/enum/generator/endo is assumed to exist.
extract:
	why3 extract --modular --recursive -F whyml -D ocaml64 $(DIRS) Endo.Enum -o ../../../../OCaml/enum/generator/endo/

# Cleaning
clean:
	cd Endo; rm -f *.bak
