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 (101 lines) | stat: -rw-r--r-- 2,896 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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
VERSION=1.01
COINST=coinst
UPGRADE=coinst-upgrades
TRANS=comigrate

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

TASK = bytearray_stubs.o bytearray.cmx task_stubs.o task.cmx
SVG=viewer/scene.cmx viewer/dot_parser.cmx viewer/dot_lexer.cmx \
    viewer/dot_graph.cmx viewer/dot_render.cmx viewer/scene_svg.cmx \
    viewer/dot_file.cmx
OBJS = ptset.cmx util.cmx file.cmx debug.cmx common.cmx cache.cmx layout.cmx \
       solver.cmx api.cmx deb_lib.cmx rpm_lib.cmx \
       repository.cmx quotient.cmx conflicts.cmx graph.cmx coinst_common.cmx
COMPFLAGS=-package unix,str,bigarray,cudf -g -I viewer
OPTLINKFLAGS=$(COMPFLAGS) -linkpkg
BYTELINKFLAGS=$(OPTLINKFLAGS) -dllib -lbytearray_stubs -cclib -lbytearray_stubs -dllib -ltask_stubs -cclib -ltask_stubs

OCAMLDEP=ocamlfind ocamldep
DEPFLAGS = -package js_of_ocaml,js_of_ocaml.syntax -syntax camlp4o -I viewer

all: $(COINST) $(UPGRADE) $(TRANS)
opt: all
byte: dllbytearray_stubs.so dlltask_stubs.so $(COINST).byte $(UPGRADE).byte $(TRANS).byte

dllbytearray_stubs.so: bytearray_stubs.o
	ocamlmklib -o bytearray_stubs $^

dlltask_stubs.so: task_stubs.o
	ocamlmklib -o task_stubs $^

$(COINST): $(OBJS) cudf_lib.cmx coinst_json.cmx coinst.cmx
	$(OCAMLOPT) -o $@  $(OPTLINKFLAGS) $^ $(LINKFLAGS)

$(COINST).byte: $(OBJS:.cmx=.cmo) cudf_lib.cmo coinst_json.cmo coinst.cmo
	$(OCAMLC) -o $@  $(BYTELINKFLAGS) $^ $(LINKFLAGS)
	cp $@ $(COINST)


$(UPGRADE): $(OBJS) $(TASK) $(SVG) upgrade_common.cmx upgrade.cmx upgrade_main.cmx
	$(OCAMLOPT) -o $@  $(OPTLINKFLAGS) $^ $(LINKFLAGS)

$(UPGRADE).byte: $(OBJS:.cmx=.cmo) $(TASK:.cmx=.cmo) $(SVG:.cmx=.cmo)  upgrade_common.cmo upgrade.cmo upgrade_main.cmo
	$(OCAMLC) -o $@  $(BYTELINKFLAGS) $^ $(LINKFLAGS)
	cp $@ $(UPGRADE)

$(TRANS): $(OBJS) $(TASK) $(SVG) update_data.cmx upgrade_common.cmx upgrade.cmx horn.cmx transition.cmx
	$(OCAMLOPT) -o $@  $(OPTLINKFLAGS) $^ $(LINKFLAGS)

$(TRANS).byte: $(OBJS:.cmx=.cmo) $(TASK:.cmx=.cmo) $(SVG:.cmx=.cmo) update_data.cmo upgrade_common.cmo upgrade.cmo horn.cmo transition.cmo
	$(OCAMLC) -o $@  $(BYTELINKFLAGS) $^ $(LINKFLAGS)
	cp $@ $(TRANS)

clean::
	rm -f $(COINST) $(UPGRADE) $(TRANS) $(COINST).byte $(UPGRADE).byte $(TRANS).byte

#####

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

.SUFFIXES: .cmo .cmi .cmx .ml .mli .mly .mll .idl .o .c

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

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

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

.idl.ml:
	$(OCAMLIDL) $<

.mly.ml:
	$(OCAMLYACC) $<

.mly.mli:
	$(OCAMLYACC) $<

.mll.ml:
	$(OCAMLLEX) $<

.c.o:
	$(OCAMLC) -ccopt "-o $@" $(COMPFLAGS) -ccopt "$(CFLAGS)" -c $<

depend: viewer/dot_parser.ml viewer/dot_lexer.ml
	ls *.ml *.mli viewer/*.ml viewer/*.mli | \
        xargs $(OCAMLDEP) $(DEPFLAGS) > .depend

include .depend

####

release:
	darcs dist -d coinst-$(VERSION)