blob: 342c78f0f116030cf2a0f2b815d8c8e0282a35ae [file] [log] [blame]
Andrew Geissler595f6302022-01-24 19:11:47 +00001From 223de708552b1ab00ac1a119e82e13deed573036 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Sat, 30 Oct 2021 10:22:38 -0700
4Subject: [PATCH] make: Make CC weak assignment
5
6This ensures that if environment overrrides it then its respected, this
7helps cross-compiling cases
8
9Upstream-Status: Pending
10
11Signed-off-by: Khem Raj <raj.khem@gmail.com>
12---
13 Makefile | 2 +-
14 1 file changed, 1 insertion(+), 1 deletion(-)
15
16--- a/Makefile
17+++ b/Makefile
18@@ -18,14 +18,14 @@ VERSION-FILE: FORCE
19 @$(SHELL_PATH) ./GEN-VERSION-FILE
20 -include VERSION-FILE
21
22-CFLAGS = -g -O2 -Wall -W -Werror=format-security
23-LDFLAGS =
24+CFLAGS += -g -O2 -Wall -W -Werror=format-security
25+LDFLAGS ?=
26 IPTRAF_CFLAGS := -std=gnu99 -D_GNU_SOURCE
27 ALL_CFLAGS = $(CPPFLAGS) $(CFLAGS) $(IPTRAF_CFLAGS)
28 ALL_LDFLAGS = $(LDFLAGS)
29 STRIP ?= strip
30
31-prefix = $(HOME)
32+prefix ?= $(HOME)
33 sbindir_relative = sbin
34 sbindir = $(prefix)/$(sbindir_relative)
35 mandir = $(prefix)/share/man
36@@ -39,7 +39,7 @@ pathsep = :
37
38 export prefix bindir sharedir sysconfdir gitwebdir localedir
39
40-CC = cc
41+CC ?= cc
42 RM = rm -f
43 INSTALL = install
44 RPMBUILD = rpmbuild