File: 0001-make-CFLAGS-LDFLAGS-and-CPPFLAGS-customizable.patch

package info (click to toggle)
usbrelay 0.4-2
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 472 kB
  • sloc: ansic: 180; makefile: 43
file content (30 lines) | stat: -rw-r--r-- 759 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
Description: allow overriding LDFLAGS, CFLAGS, CPPFLAGS
 This patch adds the possibility to provide custom CFLAGS, CPPFLAGS and
 LDFLAGS at build time. This is required to apply hardening and debug
 flags.
Author: Jan Dittberner <jandd@debian.org>

From: Logan Rosen <logan@ubuntu.com>
Date: Fri, 16 Oct 2015 19:53:06 +0200
Bug-Debian: https://bugs.debian.org/772430
---
 Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/Makefile
+++ b/Makefile
@@ -1,11 +1,11 @@
-CFLAGS = -O2 -Wall
+CFLAGS += -O2 -Wall
 HIDAPI = hidraw
-LDFLAGS = -lhidapi-$(HIDAPI)
+LDFLAGS += -lhidapi-$(HIDAPI)
 
 all: usbrelay
 
 usbrelay: usbrelay.c
-	$(CC) $(CFLAGS) -o $@ $< $(LDFLAGS)
+	$(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -o $@ $<
 
 clean:
 	rm -f usbrelay