1 #**************************************************************************
2 #* *
3 #* OCaml *
4 #* *
5 #* Xavier Leroy, projet Cristal, INRIA Rocquencourt *
6 #* *
7 #* Copyright 1999 Institut National de Recherche en Informatique et *
8 #* en Automatique. *
9 #* *
10 #* All rights reserved. This file is distributed under the terms of *
11 #* the GNU Lesser General Public License version 2.1, with the *
12 #* special exception on linking described in the file LICENSE. *
13 #* *
14 #**************************************************************************
15
16 # Makefile for the parser generator.
17
18 ROOTDIR = ..
19
20 include $(ROOTDIR)/Makefile.config
21 include $(ROOTDIR)/Makefile.common
22
23 OC_CPPFLAGS += -I$(ROOTDIR)/runtime
24
25 ifeq "$(UNIX_OR_WIN32)" "win32"
26 WSTR_OBJ = wstr
27 else
28 WSTR_OBJ =
29 endif
30
31 ocamlyacc_SOURCES := $(addsuffix .c,\
32 $(WSTR_OBJ) closure error lalr lr0 main mkpar output reader skeleton \
33 symtab verbose warshall)
34
35 ocamlyacc_OBJECTS := $(ocamlyacc_SOURCES:.c=.$(O))
36
37 generated_files := ocamlyacc$(EXE) $(ocamlyacc_OBJECTS) version.h
38
39 all: ocamlyacc$(EXE)
40
41 ocamlyacc$(EXE): $(ocamlyacc_OBJECTS)
42 $(MKEXE) -o $@ $^ $(EXTRALIBS)
43
44 version.h : $(ROOTDIR)/VERSION
45 echo "#define OCAML_VERSION \"`sed -e 1q $< | tr -d '\r'`\"" > $@
46
47 clean:
48 rm -f $(generated_files)
49
50 depend:
51
52 closure.$(O): defs.h
53 error.$(O): defs.h
54 lalr.$(O): defs.h
55 lr0.$(O): defs.h
56 main.$(O): defs.h version.h
57 mkpar.$(O): defs.h
58 output.$(O): defs.h
59 reader.$(O): defs.h
60 skeleton.$(O): defs.h
61 symtab.$(O): defs.h
62 verbose.$(O): defs.h
63 warshall.$(O): defs.h
64