From 09845ca4087c7404b1de33914233dbf53f9de4c3 Mon Sep 17 00:00:00 2001 From: Bas Couwenberg Date: Sun, 25 Oct 2020 06:36:32 +0100 Subject: [PATCH] Support hardening buildflags set in the environment. --- src/Makefile | 4 ++-- tools/Makefile | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Makefile b/src/Makefile index f2e053c..67c745a 100644 --- a/src/Makefile +++ b/src/Makefile @@ -19,10 +19,10 @@ libosmpbf.a: fileformat.pb.o osmformat.pb.o $(AR) -cr $@ fileformat.pb.o osmformat.pb.o libosmpbf.so: fileformat.pb.o osmformat.pb.o - $(CXX) -shared -Wl,-soname,$(SONAME) -o $@ fileformat.pb.o osmformat.pb.o + $(CXX) $(CPPFLAGS) $(LDFLAGS) -shared -Wl,-soname,$(SONAME) -o $@ fileformat.pb.o osmformat.pb.o %.pb.o: %.pb.cc - $(CXX) $(CXXFLAGS) -fPIC -c -o $@ $< + $(CXX) $(CPPFLAGS) $(CXXFLAGS) -fPIC -c -o $@ $< %.pb.cc ../include/osmpbf/%.pb.h: %.proto $(PROTOC) --proto_path=. --cpp_out=. $< diff --git a/tools/Makefile b/tools/Makefile index 1c8f2da..daa3a8a 100644 --- a/tools/Makefile +++ b/tools/Makefile @@ -12,7 +12,7 @@ LDFLAGS += -L../src -pthread -lz -lprotobuf -losmpbf all: osmpbf-outline osmpbf-outline: osmpbf-outline.cpp - $(CXX) $(CXXFLAGS) -o $@ $< $(LDFLAGS) + $(CXX) $(CPPFLAGS) $(CXXFLAGS) -o $@ $< $(LDFLAGS) install: install -m 755 -d $(DESTDIR)$(PREFIX)/bin