blob: 9608b7e753685656712df9e10fdb3828ebf6af04 (
plain)
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
|
From 2cc2315eecaa48fd24792aaa889dc7d9fb96978b Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Mon, 20 Mar 2017 22:18:44 -0700
Subject: [PATCH] Makefiles: Respect environment variables and add LDFLAGS to
linker cmdline
Fixes QA errors about GNU_HASH
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
mib-modules/Makefile | 10 +++++-----
tools/Makefile | 2 +-
2 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/mib-modules/Makefile b/mib-modules/Makefile
index 0d54c9b..051d4d2 100644
--- a/mib-modules/Makefile
+++ b/mib-modules/Makefile
@@ -17,13 +17,13 @@ TARG = iscsiTargetMib.so
OBJS = iscsiTargetMib.o iscsiMib.o scsiMib.o ipsAuthMib.o \
iscsiAuthData.o
-CC = gcc
-CFLAGS = -I$(INCLDIR) -I$(INCLDIR)/agent -I$(INCLDIR)/agent/mibgroup -shared -fPIC
+CC ?= gcc
+CFLAGS += -I$(INCLDIR) -I$(INCLDIR)/agent -I$(INCLDIR)/agent/mibgroup -shared -fPIC
CFLAGS += -I../include -Wall -Werror
#CFLAGS +=$(AUTO_CFLAGS)
-LD = gcc -shared
-
+LD ?= gcc
+LDFLAGS += -shared
INSTALL = install
all: $(TARG)
@@ -32,7 +32,7 @@ all: $(TARG)
$(CC) $(CFLAGS) -o $@ -c $<
$(TARG): $(OBJS)
- $(LD) -o $@ $(OBJS)
+ $(LD) -o $@ $(OBJS) $(LDFLAGS)
clean:
rm -f $(OBJS) $(TARG)
diff --git a/tools/Makefile b/tools/Makefile
index 79ed3cd..ffd9bf3 100644
--- a/tools/Makefile
+++ b/tools/Makefile
@@ -6,7 +6,7 @@ ISCSI_NAME_OBJS = $(ISCSI_NAME_SRCS:.c=.o)
all:: $(ISCSI_NAME)
$(ISCSI_NAME): $(ISCSI_NAME_OBJS)
- $(CC) -o $@ $(CFLAGS) $(ISCSI_NAME_OBJS)
+ $(CC) -o $@ $(CFLAGS) $(LDFLAGS) $(ISCSI_NAME_OBJS)
clean:
rm -f $(ISCSI_NAME_OBJS) $(ISCSI_NAME)
--
2.12.0
|