##########################################################################
#                                                                        #
#  This file is part of WP plug-in of Frama-C.                           #
#                                                                        #
#  Copyright (C) 2007-2013                                               #
#    CEA (Commissariat a l'energie atomique et aux energies              #
#         alternatives)                                                  #
#                                                                        #
#  you can redistribute it and/or modify it under the terms of the GNU   #
#  Lesser General Public License as published by the Free Software       #
#  Foundation, version 2.1.                                              #
#                                                                        #
#  It is distributed in the hope that it will be useful,                 #
#  but WITHOUT ANY WARRANTY; without even the implied warranty of        #
#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         #
#  GNU Lesser General Public License for more details.                   #
#                                                                        #
#  See the GNU Lesser General Public License version 2.1                 #
#  for more details (enclosed in the file licenses/LGPLv2.1).            #
#                                                                        #
##########################################################################

help:
	@cat README.txt

depend:
	$(OCAMLDEP) $(INCLUDES) *.ml *.mli *.mll *.mly > .depend

clean::
	rm -f *~ *.cmi *.cmo *.cma *.cmx *.o *.a *.so *.cmxa

.SUFFIXES: .ml .mli .mll .mly .cmo .cmi .cmx

.ml.cmo:
	$(OCAMLC) $(OPTCMO) -c $(INCLUDES) $<

.mli.cmi:
	$(OCAMLC) $(OPTCMI) -c $(INCLUDES) $<

.ml.cmx:
	$(OCAMLOPT) $(OPTCMX) -c $(INCLUDES) $<

.mll.ml:
	@rm -f $@
	$(OCAMLLEX) $<
	@chmod a-w $@

.mly.ml:
	$(OCAMLYACC) $<

sinclude .depend

#######################################################

#OPTC=$(shell if which ocamlc.opt > /dev/null; then echo -n .opt; else echo -n ""; fi)
OPTC?=.opt
OCAMLC?=$(OCAMLROOT)ocamlc$(OPTC)
OCAMLOPT?=$(OCAMLROOT)ocamlopt$(OPTC)
# [JS 2013/04/17] fix bug #1385
#OCAMLLEX?=$(OCAMLROOT)ocamllex$(OPTC)
OCAMLLEX?=$(OCAMLROOT)ocamllex
OCAMLYACC?=$(OCAMLROOT)ocamlyacc
OCAMLDOC?=$(OCAMLROOT)ocamldoc
OCAMLDEP?=$(OCAMLROOT)ocamldep
OCAMLMKLIB?=$(OCAMLROOT)ocamlmklib
#OCAMLLIB=$(shell $(OCAMLC) -where)

#######################################################
