ocaml/lex/Makefile.nt

84 lines
2.4 KiB
Makefile

#**************************************************************************
#* *
#* OCaml *
#* *
#* Xavier Leroy, projet Cristal, INRIA Rocquencourt *
#* *
#* Copyright 1999 Institut National de Recherche en Informatique et *
#* en Automatique. *
#* *
#* All rights reserved. This file is distributed under the terms of *
#* the GNU Lesser General Public License version 2.1, with the *
#* special exception on linking described in the file LICENSE. *
#* *
#**************************************************************************
# The lexer generator
include ../config/Makefile
CAMLRUN ?= ../boot/ocamlrun
CAMLYACC ?= ../boot/ocamlyacc
CAMLC=$(CAMLRUN) ../boot/ocamlc -I ../boot -use-prims ../byterun/primitives
ifeq "$(wildcard ../flexdll/Makefile)" ""
FLEXLINK_ENV=
else
FLEXLINK_ENV=OCAML_FLEXLINK="../boot/ocamlrun ../flexdll/flexlink.exe"
endif
CAMLOPT=$(FLEXLINK_ENV) $(CAMLRUN) ../ocamlopt -I ../stdlib
COMPFLAGS=-warn-error A
LINKFLAGS=
YACCFLAGS=-v
CAMLLEX=$(CAMLRUN) ../boot/ocamllex
CAMLDEP=$(CAMLRUN) ../tools/ocamldep
DEPFLAGS=
OBJS=cset.cmo syntax.cmo parser.cmo lexer.cmo table.cmo lexgen.cmo \
compact.cmo common.cmo output.cmo outputbis.cmo main.cmo
all: ocamllex syntax.cmo
allopt: ocamllex.opt
ocamllex: $(OBJS)
$(CAMLC) $(LINKFLAGS) -compat-32 -o ocamllex $(OBJS)
ocamllex.opt: $(OBJS:.cmo=.cmx)
$(CAMLOPT) -o ocamllex.opt $(OBJS:.cmo=.cmx)
clean::
rm -f ocamllex ocamllex.opt
rm -f *.cmo *.cmi *.cmx *.$(O)
parser.ml parser.mli: parser.mly
$(CAMLYACC) $(YACCFLAGS) parser.mly
clean::
rm -f parser.ml parser.mli parser.output
beforedepend:: parser.ml parser.mli
lexer.ml: lexer.mll
$(CAMLLEX) lexer.mll
clean::
rm -f lexer.ml
beforedepend:: lexer.ml
.SUFFIXES:
.SUFFIXES: .ml .cmo .mli .cmi .cmx
.ml.cmo:
$(CAMLC) -c $(COMPFLAGS) $<
.mli.cmi:
$(CAMLC) -c $(COMPFLAGS) $<
.ml.cmx:
$(CAMLOPT) -c $(COMPFLAGS) $<
depend: beforedepend
$(CAMLDEP) *.mli *.ml > .depend
include .depend