Add Makefile to build .h files and lib

This commit is contained in:
Jochen Topf 2011-04-13 21:45:20 +02:00
parent 155c54ce62
commit 15f74101a4
2 changed files with 27 additions and 0 deletions

3
.gitignore vendored Normal file
View File

@ -0,0 +1,3 @@
src/*.pb.h
src/*.pb.o
src/libosmpbf.a

24
src/Makefile Normal file
View File

@ -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