Makefile 3.11 KB
Newer Older
Jean-Benoist Leger's avatar
Jean-Benoist Leger committed
1 2 3 4 5
CC=g++
#CXXFLAGS=-g -Wall -std=c++11
CXXFLAGS=-O2 -std=c++11
#LDFLAGS=-g -Wall
LDFLAGS=-O2 -fwhole-program -flto
Jean-Benoist Leger's avatar
Jean-Benoist Leger committed
6 7 8
LDLIBS_LMDB=-llmdb -lpthread
LDLIBS_OSMPBF=-L../../osmpbf/osmpbf -losmpbf -lprotobuf -lz
INCLUDE_OSMPBF=-I../../osmpbf -I../../osmpbf/osmpbf/include
Jean-Benoist Leger's avatar
Jean-Benoist Leger committed
9 10 11

.PHONY: clean

Jean-Benoist Leger's avatar
Jean-Benoist Leger committed
12
all: elevation_create_database elevation_query_database route_query_nodes_database route_query_lookup_database route route_create_databases_from_pbf lmdb_rewriter analyze_pbf
Jean-Benoist Leger's avatar
Jean-Benoist Leger committed
13 14

lmdb_rewriter: lmdb_rewriter.o
15
	$(CC) $(LDFLAGS) -o $@ $+ $(LDLIBS_LMDB)
Jean-Benoist Leger's avatar
Jean-Benoist Leger committed
16 17 18 19 20 21 22 23 24 25 26 27 28

elevation_create_database: elevation.o elevation_create_database.o
	$(CC) $(LDFLAGS) -o $@ $+ $(LDLIBS_LMDB)

elevation_query_database: elevation.o elevation_query_database.o
	$(CC) $(LDFLAGS) -o $@ $+ $(LDLIBS_LMDB)

route_query_nodes_database: route_query_nodes_database.o nodes_db.o conv_functions.o
	$(CC) $(LDFLAGS) -o $@ $+ $(LDLIBS_LMDB)

route_query_lookup_database: route_query_lookup_database.o lookup.o functions.o nodes_db.o lookup_db.o conv_functions.o
	$(CC) $(LDFLAGS) -o $@ $+ $(LDLIBS_LMDB)

29
route: route.o route_db.o lookup.o functions.o nodes_db.o lookup_db.o conv_functions.o get_route.o read_from_stdin.o write_to_stdout.o
Jean-Benoist Leger's avatar
Jean-Benoist Leger committed
30 31
	$(CC) $(LDFLAGS) -o $@ $+ $(LDLIBS_LMDB)

32 33 34
route_create_databases_from_pbf: route_create_databases_from_pbf.o lookup_db.o nodes_db.o elevation.o parse_way.o conv_functions.o
	$(CC) $(LDFLAGS) -o $@ $+ $(LDLIBS_LMDB) $(LDLIBS_OSMPBF)

Jean-Benoist Leger's avatar
Jean-Benoist Leger committed
35 36 37
analyze_pbf: analyze_pbf.o parse_way.o
	$(CC) $(LDFLAGS) -o $@ $+ $(LDLIBS_OSMPBF)

Jean-Benoist Leger's avatar
Jean-Benoist Leger committed
38 39 40
lmdb_rewriter.o: lmdb_rewriter.cc conf.h
	$(CC) $(CXXFLAGS) -c $< -o $@

Jean-Benoist Leger's avatar
Jean-Benoist Leger committed
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
elevation.o: elevation.cc elevation.h conf.h
	$(CC) $(CXXFLAGS) -c $< -o $@

elevation_query_database.o: elevation_query_database.cc conf.h elevation.h
	$(CC) $(CXXFLAGS) -c $< -o $@

elevation_create_database.o: elevation_create_database.cc conf.h elevation.h
	$(CC) $(CXXFLAGS) -c $< -o $@

conv_functions.o: conv_functions.cc conf.h elevation.h types.h conv_functions.h
	$(CC) $(CXXFLAGS) -c $< -o $@

nodes_db.o: nodes_db.cc elevation.h types.h conv_functions.h conf.h nodes_db.h
	$(CC) $(CXXFLAGS) -c $< -o $@

lookup_db.o: lookup_db.cc lookup_db.h conf.h types.h
	$(CC) $(CXXFLAGS) -c $< -o $@

route_query_nodes_database.o: route_query_nodes_database.cc nodes_db.h conf.h
	$(CC) $(CXXFLAGS) -c $< -o $@

functions.o: functions.cc functions.h
	$(CC) $(CXXFLAGS) -c $< -o $@

lookup.o: lookup.cc lookup.h lookup_db.h types.h conf.h nodes_db.h
	$(CC) $(CXXFLAGS) -c $< -o $@

route_query_lookup_database.o: route_query_lookup_database.cc lookup.h conf.h
	$(CC) $(CXXFLAGS) -c $< -o $@

route_db.o: route_db.cc route_db.h conf.h lookup.h lookup_db.h nodes_db.h types.h
	$(CC) $(CXXFLAGS) -c $< -o $@

get_route.o: get_route.cc get_route.h
	$(CC) $(CXXFLAGS) -c $< -o $@

route.o: route.cc
	$(CC) $(CXXFLAGS) -c $< -o $@

80 81 82
route_create_databases_from_pbf.o: route_create_databases_from_pbf.cc
	$(CC) $(CXXFLAGS) $(INCLUDE_OSMPBF) -c $< -o $@

Jean-Benoist Leger's avatar
Jean-Benoist Leger committed
83 84 85
analyze_pbf.o: analyze_pbf.cc
	$(CC) $(CXXFLAGS) $(INCLUDE_OSMPBF) -c $< -o $@

86 87 88 89 90 91 92
read_from_stdin.o: read_from_stdin.cc conf.h types.h
	$(CC) $(CXXFLAGS) -c $< -o $@

write_to_stdout.o: write_to_stdout.cc conf.h types.h route_db.h
	$(CC) $(CXXFLAGS) -c $< -o $@


Jean-Benoist Leger's avatar
Jean-Benoist Leger committed
93 94
clean:
	rm -f *.o