From 15f74101a4fda10ac4c0cc5ae644e4fe23ad7678 Mon Sep 17 00:00:00 2001 From: Jochen Topf Date: Wed, 13 Apr 2011 21:45:20 +0200 Subject: [PATCH] Add Makefile to build .h files and lib --- .gitignore | 3 +++ src/Makefile | 24 ++++++++++++++++++++++++ 2 files changed, 27 insertions(+) create mode 100644 .gitignore create mode 100644 src/Makefile diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..c016218 --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +src/*.pb.h +src/*.pb.o +src/libosmpbf.a diff --git a/src/Makefile b/src/Makefile new file mode 100644 index 0000000..116d6ca --- /dev/null +++ b/src/Makefile @@ -0,0 +1,24 @@ + +CXX = g++ +CXXFLAGS = -O3 +AR = ar + +all: libosmpbf.a fileformat.pb.h osmformat.pb.h + +libosmpbf.a: fileformat.pb.o osmformat.pb.o + $(AR) -cr $@ fileformat.pb.o osmformat.pb.o + +%.pb.o: %.pb.cc + $(CXX) $(CXXFLAGS) -c -o $@ $< + +%.pb.cc %.pb.h: %.proto + protoc --proto_path=. --cpp_out=. $< + +install: + install -m 644 -g root -o root libosmpbf.a $(DESTDIR)/usr/lib + install -m 755 -g root -o root -d $(DESTDIR)/usr/include/osmpbf + install -m 644 -g root -o root fileformat.pb.h osmformat.pb.h $(DESTDIR)/usr/include/osmpbf + +clean: + rm -f *.pb.h *.pb.cc *.pb.o libosmpbf.a +