Add Makefile to build .h files and lib
This commit is contained in:
parent
155c54ce62
commit
15f74101a4
|
|
@ -0,0 +1,3 @@
|
|||
src/*.pb.h
|
||||
src/*.pb.o
|
||||
src/libosmpbf.a
|
||||
|
|
@ -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
|
||||
|
||||
Loading…
Reference in New Issue