Merge commit 'ocaml3102'
[ocaml.git] / lex / Makefile
blob2e593133f272c0cb1a323e9ae97957647f2d9051
1 #########################################################################
2 # #
3 # Objective Caml #
4 # #
5 # Xavier Leroy, projet Cristal, INRIA Rocquencourt #
6 # #
7 # Copyright 1999 Institut National de Recherche en Informatique et #
8 # en Automatique. All rights reserved. This file is distributed #
9 # under the terms of the Q Public License version 1.0. #
10 # #
11 #########################################################################
13 # $Id$
15 # The lexer generator
16 CAMLC=../boot/ocamlrun ../boot/ocamlc -nostdlib -I ../boot
17 CAMLOPT=../boot/ocamlrun ../ocamlopt -nostdlib -I ../stdlib
18 COMPFLAGS=-warn-error A
19 CAMLYACC=../boot/ocamlyacc
20 YACCFLAGS=-v
21 CAMLLEX=../boot/ocamlrun ../boot/ocamllex
22 CAMLDEP=../boot/ocamlrun ../tools/ocamldep
25 OBJS=cset.cmo syntax.cmo parser.cmo lexer.cmo table.cmo lexgen.cmo compact.cmo common.cmo output.cmo outputbis.cmo main.cmo
27 all: ocamllex
28 allopt: ocamllex.opt
30 ocamllex: $(OBJS)
31 $(CAMLC) $(LINKFLAGS) -o ocamllex $(OBJS)
33 ocamllex.opt: $(OBJS:.cmo=.cmx)
34 $(CAMLOPT) -o ocamllex.opt $(OBJS:.cmo=.cmx)
36 clean::
37 rm -f ocamllex ocamllex.opt
38 rm -f *.cmo *.cmi *.cmx *.o *~
40 parser.ml parser.mli: parser.mly
41 $(CAMLYACC) $(YACCFLAGS) parser.mly
43 clean::
44 rm -f parser.ml parser.mli parser.output
46 beforedepend:: parser.ml parser.mli
48 lexer.ml: lexer.mll
49 $(CAMLLEX) lexer.mll
51 clean::
52 rm -f lexer.ml
54 beforedepend:: lexer.ml
56 .SUFFIXES:
57 .SUFFIXES: .ml .cmo .mli .cmi .cmx
59 .ml.cmo:
60 $(CAMLC) -c $(COMPFLAGS) $<
62 .mli.cmi:
63 $(CAMLC) -c $(COMPFLAGS) $<
65 .ml.cmx:
66 $(CAMLOPT) -c $(COMPFLAGS) $<
68 depend: beforedepend
69 $(CAMLDEP) *.mli *.ml > .depend
71 include .depend