# Inclusion of Makefile.conf may fail when cleaning up:

-include $(TOP_DIR)/Makefile.conf

# How to invoke compilers and tools:

OCAMLC    = $(OCAMLFIND) ocamlc -g $(STRING_OPTS) $(OCAMLC_OPTIONS) -package "$(PACKAGES)"
OCAMLOPT  = $(OCAMLFIND) ocamlopt $(STRING_OPTS) $(OCAMLOPT_OPTIONS) -package "$(PACKAGES)"
OCAMLDEP  = ocamldep $(OCAMLDEP_OPTIONS)
OCAMLFIND = ocamlfind
OCAMLYACC = ocamlyacc
OCAMLLEX  = ocamllex$(LEX_OPT)
WLEX      = wlex

TOOLS_DIR = $(TOP_DIR)/tools

M2PARSERGEN    = $(TOOLS_DIR)/m2parsergen
LEXPP	       = $(TOOLS_DIR)/lexpp
COLLECT_FILES  = $(TOOLS_DIR)/collect_files
IFDEF	       = $(TOOLS_DIR)/ifdef

# Files to remove everywhere by "make clean":

CLEAN_LIST = *.cmi *.cmo *.cma *.cmx *.o *.a *.cmxa

# Generic build rules:

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

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

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

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

.mll.ml:
	$(OCAMLLEX) $<

.mly.ml:
	$(OCAMLYACC) $<

.m2y.ml:
	$(M2PARSERGEN) $<

