From c4ee5d3e6972045d65a70aa4a1b146f211911551 Mon Sep 17 00:00:00 2001 From: Eric Fischer Date: Wed, 12 Oct 2016 13:21:29 -0700 Subject: [PATCH 1/2] Autogenerate header dependencies Following http://scottmcpeak.com/autodepend/autodepend.html --- Makefile | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index faa4274..aeea12a 100644 --- a/Makefile +++ b/Makefile @@ -37,7 +37,6 @@ man/tippecanoe.1: README.md PG= -ALL_H = $(shell find . '(' -name '*.h' -o -name '*.hpp' ')') H = $(wildcard *.h) $(wildcard *.hpp) C = $(wildcard *.c) $(wildcard *.cpp) @@ -59,14 +58,16 @@ tile-join: tile-join.o projection.o pool.o mbtiles.o mvt.o memfile.o unit: unit.o text.o $(CXX) $(PG) $(LIBS) $(FINAL_FLAGS) $(CXXFLAGS) -o $@ $^ $(LDFLAGS) -lm -lz -lsqlite3 -lpthread -%.o: %.c $(ALL_H) - $(CC) $(PG) $(INCLUDES) $(FINAL_FLAGS) $(CFLAGS) -c -o $@ $< +-include $(wildcard *.d) -%.o: %.cpp $(ALL_H) - $(CXX) $(PG) $(INCLUDES) $(FINAL_FLAGS) $(CXXFLAGS) -c -o $@ $< +%.o: %.c + $(CC) -MMD $(PG) $(INCLUDES) $(FINAL_FLAGS) $(CFLAGS) -c -o $@ $< + +%.o: %.cpp + $(CXX) -MMD $(PG) $(INCLUDES) $(FINAL_FLAGS) $(CXXFLAGS) -c -o $@ $< clean: - rm -f tippecanoe *.o + rm -f tippecanoe *.o *.d indent: clang-format -i -style="{BasedOnStyle: Google, IndentWidth: 8, UseTab: Always, AllowShortIfStatementsOnASingleLine: false, ColumnLimit: 0, ContinuationIndentWidth: 8, SpaceAfterCStyleCast: true, IndentCaseLabels: false, AllowShortBlocksOnASingleLine: false, AllowShortFunctionsOnASingleLine: false, SortIncludes: false}" $(C) $(H) From b26e6a5a4e7af4462a86bc4a155cb07fe47b7d27 Mon Sep 17 00:00:00 2001 From: Eric Fischer Date: Wed, 12 Oct 2016 14:07:41 -0700 Subject: [PATCH 2/2] This should have been linking as C++, not C --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index aeea12a..ae4a02a 100644 --- a/Makefile +++ b/Makefile @@ -47,7 +47,7 @@ tippecanoe: geojson.o jsonpull/jsonpull.o tile.o pool.o mbtiles.o geometry.o pro $(CXX) $(PG) $(LIBS) $(FINAL_FLAGS) $(CXXFLAGS) -o $@ $^ $(LDFLAGS) -lm -lz -lsqlite3 -lpthread tippecanoe-enumerate: enumerate.o - $(CC) $(PG) $(LIBS) $(FINAL_FLAGS) $(CFLAGS) -o $@ $^ $(LDFLAGS) -lsqlite3 + $(CXX) $(PG) $(LIBS) $(FINAL_FLAGS) $(CFLAGS) -o $@ $^ $(LDFLAGS) -lsqlite3 tippecanoe-decode: decode.o projection.o mvt.o $(CXX) $(PG) $(LIBS) $(FINAL_FLAGS) $(CXXFLAGS) -o $@ $^ $(LDFLAGS) -lm -lz -lsqlite3