1From 014a8e04a0fa775b2ade78e5f7655a1453375884 Mon Sep 17 00:00:00 2001
2From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
3Date: Wed, 10 Feb 2016 23:31:12 +0100
4Subject: [PATCH] Makefile: allow passing custom CFLAGS/CPPFLAGS
5
6vpnc's Makefile specifies some CFLAGS and CPPFLAGS value, but it may
7be needed to pass additional custom flags on the make command line. To
8make this possible, we switch from a plain += operator to the
9"override ... +=" operator.
10
11Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
12---
13
14 Makefile | 8 ++++----
15 1 file changed, 4 insertions(+), 4 deletions(-)
16
17diff --git a/Makefile b/Makefile
18index e80ef17..7ac225a 100644
19--- a/Makefile
20+++ b/Makefile
21@@ -62,9 +62,9 @@ RELEASE_VERSION := $(shell cat VERSION)
22
23 CC ?= gcc
24 CFLAGS ?= -O3 -g
25-CFLAGS += -W -Wall -Wmissing-declarations -Wwrite-strings
26-CFLAGS +=  $(shell libgcrypt-config --cflags) $(CRYPTO_CFLAGS)
27-CPPFLAGS += -DVERSION=\"$(VERSION)\"
28+override CFLAGS += -W -Wall -Wmissing-declarations -Wwrite-strings
29+override CFLAGS +=  $(shell libgcrypt-config --cflags) $(CRYPTO_CFLAGS)
30+override CPPFLAGS += -DVERSION=\"$(VERSION)\"
31 LDFLAGS ?= -g
32 LIBS += $(shell libgcrypt-config --libs) $(CRYPTO_LDADD)
33
34@@ -73,7 +73,7 @@ LIBS += -lnsl -lresolv -lsocket
35 endif
36 ifneq (,$(findstring Apple,$(shell $(CC) --version)))
37 # enabled in FSF GCC, disabled by default in Apple GCC
38-CFLAGS += -fstrict-aliasing -freorder-blocks -fsched-interblock
39+override CFLAGS += -fstrict-aliasing -freorder-blocks -fsched-interblock
40 endif
41
42 all : $(BINS) vpnc.8
43--
442.6.4
45
46