File: Makefile

package info (click to toggle)
coinst 1.9.1-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 1,628 kB
  • ctags: 2,683
  • sloc: ml: 15,681; makefile: 149; ansic: 52
file content (81 lines) | stat: -rw-r--r-- 1,881 bytes parent folder | download
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
74
75
76
77
78
79
80
81

OCAMLC=ocamlfind ocamlc
OCAMLOPT=ocamlfind ocamlopt
OCAMLDEP=ocamlfind ocamldep
OCAMLYACC=ocamlyacc
OCAMLLEX=ocamllex

COMPFLAGS=-package str,cairo.lablgtk2,js_of_ocaml,js_of_ocaml.syntax -syntax camlp4o
DEPFLAGS=$(COMPFLAGS)

GENERATED=dot_parser.ml dot_lexer.ml
OBJS=scene.cmx scene_extents.cmx viewer_common.cmx viewer.cmx \
     dot_file.cmx dot_parser.cmx dot_lexer.cmx dot_graph.cmx dot_render.cmx \
     main.cmx
CONVERTER=scene.cmx scene_extents.cmx scene_json.cmx \
     dot_file.cmx dot_parser.cmx dot_lexer.cmx dot_graph.cmx dot_render.cmx \
     converter.cmx
OPTLINKFLAGS=-package str,cairo.lablgtk2 -linkpkg

JSOBJS=scene.cmo viewer_common.cmo viewer_js.cmo
LINKFLAGS=-package js_of_ocaml -linkpkg

all: coinst_viewer jsviewer.js coinst_converter
opt: all
byte: coinst_viewer.byte jsviewer.js coinst_converter.byte

coinst_viewer: $(OBJS)
	$(OCAMLOPT) -o $@  $(OPTLINKFLAGS) $^

coinst_viewer.byte: $(OBJS:.cmx=.cmo)
	$(OCAMLC) -o $@  $(OPTLINKFLAGS) $^

coinst_converter: $(CONVERTER)
	$(OCAMLOPT) -o $@  $(OPTLINKFLAGS) $^

coinst_converter.byte: $(CONVERTER:.cmx=.cmo)
	$(OCAMLC) -o $@  $(OPTLINKFLAGS) $^

jsviewer.js: jsviewer.byte
	js_of_ocaml $^ -pretty

jsviewer.byte: $(JSOBJS)
	$(OCAMLC) -o $@ $(LINKFLAGS) $^

realclean:: clean
	rm -f dot_parser.ml dot_parser.mli dot_lexer.ml

clean::
	rm -f coinst_converter coinst_viewer coinst_viewer.byte coinst_converter.byte
	rm -f jsviewer.js jsviewer.byte
	rm -f dot_lexer.ml dot_parser.ml

#####

clean::
	find . -regex ".*\\.\(cm[oix]\|o\)" | xargs rm -f

%.cmx: %.ml
	$(OCAMLOPT) $(OPTCOMPFLAGS) $(COMPFLAGS) -c $<

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

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

%.ml: %.mly
	$(OCAMLYACC) $<

%.mli: %.mly
	$(OCAMLYACC) $<

%.ml: %.mll
	$(OCAMLLEX) $<

depend: $(GENERATED)
	find . -regex ".*\\.mli?" | xargs \
	$(OCAMLDEP) $(DEPFLAGS) $$i \
	> .depend

include .depend