-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathMakefile
95 lines (66 loc) · 2.29 KB
/
Makefile
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
OCAMLC=ocamlc
OCAMLOPT=ocamlfind ocamlopt
OCAMLLEX=ocamllex
OCAMLYACC=ocamlyacc -v
OCAMLDEP=ocamldep
OPTCOMPFLAGS =-package zip,bigarray,unix,cairo2-gtk -inline 3 -g \
$(DIRS)
COMPFLAGS = $(DIRS)
DEPFLAGS= $(DIRS)
OPTLINKFLAGS=$(OPTCOMPFLAGS) -linkpkg #-unsafe
#####
GENERIC=\
util.cmx debug.cmx bitvect.cmx \
bytearray_stubs.o bytearray.cmx mapped_file.cmx task_stubs.o task.cmx \
binary_heap.cmx pqueue.cmx data_stream.cmx protobuf.cmx \
lru_cache.cmx
DATABASE=\
column_opt.o column.cmx sort.o sorting.cmx join.cmx \
projection.cmx table.cmx dictionary.cmx column_ops.cmx rtree.cmx
OSM=\
geometry.cmx
ROUTING=\
routing_profile.cmx profile_car.cmx profile_pedestrian.cmx
DIRS=-I generic -I database -I osm -I osm/lib
OBJS= $(addprefix generic/,$(GENERIC)) $(addprefix database/,$(DATABASE)) \
$(addprefix osm/,$(OSM))
BINARIES=query load multipolygons linear surfaces highway contraction display coastline
all: $(BINARIES)
query: $(OBJS) database/query.cmx
$(OCAMLOPT) $(OPTLINKFLAGS) -o $@ $^
load: $(OBJS) osm/parser.cmx osm/prepare.cmx
$(OCAMLOPT) $(OPTLINKFLAGS) -o $@ $^
multipolygons: $(OBJS) osm/multipolygons.cmx
$(OCAMLOPT) $(OPTLINKFLAGS) -o $@ $^
linear: $(OBJS) osm/category.cmx osm/linear.cmx
$(OCAMLOPT) $(OPTLINKFLAGS) -o $@ $^
surfaces: $(OBJS) osm/douglas_peucker.cmx osm/category.cmx osm/surfaces.cmx
$(OCAMLOPT) $(OPTLINKFLAGS) -o $@ $^
highway: $(OBJS) $(addprefix osm/, $(ROUTING)) osm/highway.cmx
$(OCAMLOPT) $(OPTLINKFLAGS) -o $@ $^
contraction: $(OBJS) osm/contraction.cmx
$(OCAMLOPT) $(OPTLINKFLAGS) -o $@ $^
display: $(OBJS) osm/routing.cmx osm/line_smoothing.cmx osm/douglas_peucker.cmx osm/category.cmx osm/lib/osm_display.cmx osm/display.cmx
$(OCAMLOPT) $(OPTLINKFLAGS) -o $@ $^
coastline: $(OBJS) osm/category.cmx osm/douglas_peucker.cmx osm/clipping.cmx osm/coastline.cmx
$(OCAMLOPT) $(OPTLINKFLAGS) -o $@ $^
clean::
rm -f $(BINARIES)
#####
clean::
find . -regex ".*\\.\(cm[oix]\|o\)" | xargs rm -f
realclean:: clean
.SUFFIXES: .cmo .cmi .cmx .ml .mli .o .c
.ml.cmo:
$(OCAMLC) $(BYTECOMPFLAGS) -c $<
.ml.cmx:
$(OCAMLOPT) $(OPTCOMPFLAGS) -c $<
.mli.cmi:
$(OCAMLC) $(COMPFLAGS) -c $<
.c.o:
$(OCAMLC) -ccopt -O3 -c -ccopt "-o $@" $<
depend:
find . -regex ".*\\.mli?" | LC_ALL=C sort | xargs \
$(OCAMLDEP) $(DEPFLAGS) $$i \
> .depend
include .depend