1From a2021f0bc0f029dfa05dcca5db3d2ec77904d41a Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Thu, 30 Mar 2017 12:33:51 -0700
4Subject: [PATCH] Use ARPCFLAGS for package specific compiler flags
5
6This leaves room for setting CFLAGS in environment
7which OE uses to pass tweaks
8
9Signed-off-by: Khem Raj <raj.khem@gmail.com>
10---
11 Makefile            | 10 ++++------
12 extensions/Makefile |  4 ++++
13 2 files changed, 8 insertions(+), 6 deletions(-)
14
15diff --git a/Makefile b/Makefile
16index 62ebdf2..cd06813 100644
17--- a/Makefile
18+++ b/Makefile
19@@ -12,9 +12,7 @@ DESTDIR:=
20
21 MANS = arptables-legacy.8 arptables-save.8 arptables-restore.8
22
23-COPT_FLAGS:=-O2
24-CFLAGS:=$(COPT_FLAGS) -Wall -Wunused -I$(KERNEL_DIR)/include/ -Iinclude/ -DARPTABLES_VERSION=\"$(ARPTABLES_VERSION)\" #-g -DDEBUG #-pg # -DARPTC_DEBUG
25-
26+ARPCFLAGS:=-Wall -Wunused -I$(KERNEL_DIR)/include/ -Iinclude/ -DARPTABLES_VERSION=\"$(ARPTABLES_VERSION)\"
27 ifndef ARPT_LIBDIR
28 ARPT_LIBDIR:=$(LIBDIR)/arptables
29 endif
30@@ -24,13 +22,13 @@ include extensions/Makefile
31 all: arptables-legacy libarptc/libarptc.a
32
33 arptables.o: arptables.c
34-	$(CC) $(CFLAGS) -c -o $@ $<
35+	$(CC) $(ARPCFLAGS) $(CFLAGS) -c -o $@ $<
36
37 arptables-standalone.o: arptables-standalone.c
38-	$(CC) $(CFLAGS) -c -o $@ $<
39+	$(CC) $(ARPCFLAGS) $(CFLAGS) -c -o $@ $<
40
41 libarptc/libarptc.o: libarptc/libarptc.c libarptc/libarptc_incl.c
42-	$(CC) $(CFLAGS) -c -o $@ $<
43+	$(CC) $(ARPCFLAGS) $(CFLAGS) -c -o $@ $<
44
45 libarptc/libarptc.a: libarptc/libarptc.o
46 	$(AR) rcs $@ $<
47diff --git a/extensions/Makefile b/extensions/Makefile
48index 0189cc9..e8af782 100644
49--- a/extensions/Makefile
50+++ b/extensions/Makefile
51@@ -5,3 +5,7 @@ EXT_OBJS+=$(foreach T,$(EXT_FUNC), extensions/arpt_$(T).o)
52
53 extensions/ebt_%.o: extensions/arpt_%.c include/arptables.h include/arptables_common.h
54 	$(CC) $(CFLAGS) $(PROGSPECS) -c -o $@ $<
55+	$(CC) $(CFLAGS) $(ARPCFLAGS) $(PROGSPECS) -c -o $@ $<
56+
57+extensions/arpt_%.o: extensions/arpt_%.c include/arptables.h include/arptables_common.h
58+	$(CC) $(CFLAGS) $(ARPCFLAGS) $(PROGSPECS) -c -o $@ $<
59--
602.17.1
61
62