# Makefile for tactics/programs/EXAMPLES

include ../../../config

COQDEP = $(COQTOP)/bin/$(ARCH)/coqdep -c

LIBS = -I .. -I ../../../theories/ZARITH -I ../../contrib/omega -I ../../contrib/polynom

COQ = ../../../bin/$(ARCH)/coqtop -q -bindir ../../../bin/$(ARCH) \
       -libdir ../../.. $(LIBS) -I ../../../states -is ../programs.coq
COQC = ../../../bin/$(ARCH)/coqc -q -bindir ../../../bin/$(ARCH) \
       -libdir ../../.. $(LIBS) -I ../../../states -is ../programs.coq

VO = fact.vo fact_int.vo exp.vo exp_int.vo Handbook.vo

VFILES = $(VO:.vo=.v)

all: prog-state $(VO) test-extr

prog-state:
	(cd ..; make programs.coq)

test-extr:
	$(COQ) -batch -load-vernac-source make_extr.v
	make $(VO:.vo=.cmo)

install-library:
	$(INSTALL) -d $(VFILES) $(COQLIB)/tactics/programs/EXAMPLES

# clean, depend and generic rules ########################

clean:
	rm -f *~ *.v? *.cm[io] $(VO:.vo=.ml)

archclean:
	rm -f *~ *.v?

.SUFFIXES: .v .vo .ml .cmo

.v.vo:
	$(COQC) $(OPT) $*

.ml.cmo:
	$(CAMLC) -i $<

depend:
	$(COQDEP) $(LIBS) *.v > .depend

include .depend
