-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfig.in
73 lines (55 loc) · 1.75 KB
/
config.in
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
# programs used
OCAML ?= ocaml
OCAMLC ?= ocamlc
OCAMLLEX ?= ocamllex
OCAMLYACC ?= ocamlyacc
OCAMLOPT ?= ocamlopt
OCAMLDEP ?= ocamldep
OCAMLRUN ?= ocamlrun
OCAMLFIND ?= ocamlfind
MENHIR ?= menhir
OTAGS ?= otags
ZLLIB = `ocamlfind query zelus`
ZLLIBGTK = `ocamlfind query zelus-gtk`
ZELUC = zeluc
#ZELUCFLAGS = -I $(ZLLIB) -I $(ZLLIBGTK)
LABLGTKLIB = `ocamlfind query lablgtk2`
FADBADLIB = `ocamlfind query fadbadml`
CHECKLIB = @curdir@/lib
INCLUDES ?=
OCAMLFLAGS ?= unix.cma bigarray.cma \
-I $(LABLGTKLIB) lablgtk.cma \
-I $(ZLLIB) -I $(ZLLIBGTK) zlstdlib.cma \
-I $(FADBADLIB) fadbad.cma
OCAMLOPTFLAGS ?= unix.cmxa bigarray.cmxa \
-I $(LABLGTKLIB) lablgtk.cmxa \
-I $(ZLLIB) -I $(ZLLIBGTK) zlstdlib.cmxa \
-I $(FADBADLIB) fadbad.cmxa
# implicit rules
.SUFFIXES : .mli .ml .cmi .cmo .cmx .mll .mly .zli .zli .byte .opt
%.cmi: %.mli
$(OCAMLC) $(OCAMLFLAGS) -c $(INCLUDES) $<
%.cmo %.cmi: %.ml
$(OCAMLC) $(OCAMLFLAGS) -c $(INCLUDES) $<
%.cmx %.cmi: %.ml
$(OCAMLOPT) $(OCAMLOPTFLAGS) -c $(patsubst %.cma,%.cmxa,$(patsubst %.cmo,%.cmx,$(INCLUDES))) $<
%.zci: %.zli
$(ZELUC) $(ZELUCFLAGS) $<
%.ml %.zci: %.zls
$(ZELUC) $(ZELUCFLAGS) $<
%.ml: %.mll
$(OCAMLLEX) $<
%.ml %.mli: %.mly
$(MENHIR) $(MENHIRFLAGS) $<
# set ZLEXTRALIBS to ZLGTKLIBS to compile examples that use gtk
%.byte: %.ml
$(OCAMLC) $(OCAMLFLAGS) -o $@ $(ZLSTDLIBS) $(ZLEXTRALIBS) \
$(INCLUDES) \
$< $(<:.ml=_main.ml)
# set ZLEXTRALIBS to ZLGTKLIBS to compile examples that use gtk
%.opt: %.ml
$(OCAMLOPT) $(OCAMLOPTFLAGS) -o $@ \
$(patsubst %.cma,%.cmxa,$(patsubst %.cmo,%.cmx,$(ZLSTDLIBS)))\
$(patsubst %.cma,%.cmxa,$(patsubst %.cmo,%.cmx,$(ZLEXTRALIBS)))\
$(patsubst %.cma,%.cmxa,$(patsubst %.cmo,%.cmx,$(INCLUDES)))\
$< $(<:.ml=_main.ml)