Skip to content
Snippets Groups Projects
Makefile 967 B
Newer Older
hondet's avatar
hondet committed
PVS2DK    = ../scripts/pvs2dk.sh
THYSELECT = psnj thyselect
LP        = lambdapi
Gabriel's avatar
Gabriel committed

hondet's avatar
hondet committed
PVSPATH  ?=
Gabriel's avatar
Gabriel committed

hondet's avatar
hondet committed
_THEORIES != ${THYSELECT} -p < theories.json
_DUMMIES  != ${THYSELECT} -n < theories.json
hondet's avatar
hondet committed
# We cannot cat _THEORIES and _DUMMIES because order is important
hondet's avatar
hondet committed
_ALL      != ${THYSELECT} < theories.json
Gabriel's avatar
Gabriel committed

hondet's avatar
hondet committed
all: ${_ALL:C/$/.lpo/}
translate: ${_ALL:C/$/.lp/}
Gabriel's avatar
Gabriel committed

hondet's avatar
hondet committed
.for d in ${_DUMMIES}
${d}.lp:
	set -o noclobber && printf '// Dummy theory\n' > ${d}.lp
${d}.lisp:
	set -o noclobber && printf '(:context nil :decls nil)' > ${d}.lisp
.endfor
Gabriel's avatar
Gabriel committed

# For each theory, translate it and apply a patch if it exists
hondet's avatar
hondet committed
.for th in ${_THEORIES}
Gabriel's avatar
Gabriel committed
${th}.lp:
	PVSPATH=${PVSPATH} ${PVS2DK} -f ${PVSPATH}/lib/prelude.pvs -t ${.TARGET:R} \
-o ${PWD}/${.TARGET} > /dev/null
Gabriel's avatar
Gabriel committed
	-[ -r "${.TARGET}.patch" ] && patch < "${.TARGET}.patch"
	-[ -r "${.TARGET}.sh" ] && sh "${.TARGET}.sh"
.endfor

hondet's avatar
hondet committed
clean-translation:
	rm -rf *.lp *.lisp

clean: clean-translation

.PHONY: clean-translation

hondet's avatar
hondet committed
.include "../mk/lambdapi.mk"