Add support for passing CPPFLAGS to Makefiles

This is required in order to add Hardening support.
See https://wiki.debian.org/Hardening

Earlier version of the patch by Thorsten Alteholz <debian@alteholz.de>
This commit is contained in:
Lucas Nussbaum 2015-11-07 09:35:23 +01:00
parent 695402d288
commit 47ab75eb66
4 changed files with 9 additions and 8 deletions

View file

@ -17,8 +17,8 @@ PREFIX ?= /usr/local
export PREFIX
all:
$(MAKE) -C $(top_srcdir)/cpp/build/ -$(MAKEFLAGS)
$(MAKE) -C $(top_srcdir)/cpp/examples/MinOZW/ -$(MAKEFLAGS)
CPPFLAGS=$(CPPFLAGS) $(MAKE) -C $(top_srcdir)/cpp/build/ -$(MAKEFLAGS)
CPPFLAGS=$(CPPFLAGS) $(MAKE) -C $(top_srcdir)/cpp/examples/MinOZW/ -$(MAKEFLAGS)
install:
$(MAKE) -C $(top_srcdir)/cpp/build/ -$(MAKEFLAGS) $(MAKECMDGOALS)
@ -29,7 +29,7 @@ clean:
$(MAKE) -C $(top_srcdir)/cpp/examples/MinOZW/ -$(MAKEFLAGS) $(MAKECMDGOALS)
cpp/src/vers.cpp:
$(MAKE) -C $(top_srcdir)/cpp/build/ -$(MAKEFLAGS) cpp/src/vers.cpp
CPPFLAGS=$(CPPFLAGS) $(MAKE) -C $(top_srcdir)/cpp/build/ -$(MAKEFLAGS) cpp/src/vers.cpp
check: xmltest
@ -55,4 +55,4 @@ dist-update:
DIST_FORMATS ?= gzip
include $(top_srcdir)/distfiles.mk
include $(top_srcdir)/dist.mk
include $(top_srcdir)/dist.mk

View file

@ -50,6 +50,7 @@ else
LDFLAGS += -shared -Wl,-soname,libopenzwave.so.$(VERSION)
LIBS += -ludev
endif
CFLAGS += $(CPPFLAGS)
#where to put the temporary library
LIBDIR ?= $(top_builddir)

View file

@ -10,8 +10,8 @@
.PHONY: default clean
DEBUG_CFLAGS := -Wall -Wno-format -ggdb -DDEBUG
RELEASE_CFLAGS := -Wall -Wno-unknown-pragmas -Wno-format -O3
DEBUG_CFLAGS := -Wall -Wno-format -ggdb -DDEBUG $(CPPFLAGS)
RELEASE_CFLAGS := -Wall -Wno-unknown-pragmas -Wno-format -O3 $(CPPFLAGS)
DEBUG_LDFLAGS := -g

View file

@ -25,8 +25,8 @@ LD := g++
AR := ar rc
RANLIB := ranlib
DEBUG_CFLAGS := -Wall -Wno-format -g -DDEBUG
RELEASE_CFLAGS := -Wall -Wno-unknown-pragmas -Wno-format -O3
DEBUG_CFLAGS := -Wall -Wno-format -g -DDEBUG $(CPPFLAGS)
RELEASE_CFLAGS := -Wall -Wno-unknown-pragmas -Wno-format -O3 $(CPPFLAGS)
LIBS :=