[04/10] make: Don't export ccflags-y

Submitted by Dmitry Safonov on May 17, 2019, 10:53 p.m.

Details

Message ID 20190517225309.16082-5-dima@arista.com
State Accepted
Series "pie/build: Cleaning up PIE/compel"
Commit 3485e37312006b48d44ea823c5058c524a611123
Headers show

Commit Message

Dmitry Safonov May 17, 2019, 10:53 p.m.
As far as I know, difference between CFLAGS and ccflags-y in kernel is
that CFLAGS are global and exported and ccflags-y are per-Makefile.
So, exporting ccflags-y should be omitted.

While at it, remove COMPEL_UAPI_INCLUDES - they're added to CFLAGS
straight away and exported to sub-makes, so no-one need to include them
twice.

Also, remove from sub-Makefiles -iquote(s) for includes those are already
added in criu/Makefile

Signed-off-by: Dmitry Safonov <dima@arista.com>
---
 criu/Makefile              | 24 ++++++++++--------------
 criu/Makefile.crtools      |  1 -
 criu/arch/aarch64/Makefile |  3 ---
 criu/arch/arm/Makefile     |  4 ----
 criu/arch/ppc64/Makefile   |  3 ---
 criu/arch/s390/Makefile    |  3 ---
 criu/arch/x86/Makefile     |  4 ----
 criu/pie/Makefile          |  1 -
 criu/pie/Makefile.library  |  2 --
 9 files changed, 10 insertions(+), 35 deletions(-)

Patch hide | download patch | download mbox

diff --git a/criu/Makefile b/criu/Makefile
index 7978781760eb..1e9a167895ad 100644
--- a/criu/Makefile
+++ b/criu/Makefile
@@ -7,9 +7,8 @@  PIE_DIR			:= criu/pie
 export ARCH_DIR PIE_DIR
 
 ifeq ($(filter clean mrproper,$(MAKECMDGOALS)),)
-	COMPEL_UAPI_INCLUDES	:= $(shell $(COMPEL_BIN) includes)
-	export COMPEL_UAPI_INCLUDES
-	COMPEL_LIBS		:= $(shell $(COMPEL_BIN) --static libs)
+        CFLAGS		+= $(shell $(COMPEL_BIN) includes)
+        COMPEL_LIBS	:= $(shell $(COMPEL_BIN) --static libs)
 endif
 
 #
@@ -20,17 +19,14 @@  CONFIG-DEFINES		+= -DUSER_CONFIG_DIR='".criu/"'
 
 #
 # General flags.
-ccflags-y		+= -fno-strict-aliasing
-ccflags-y		+= -iquote criu/include
-ccflags-y		+= -iquote include
-ccflags-y		+= -iquote images
-ccflags-y		+= -iquote $(ARCH_DIR)/include
-ccflags-y		+= -iquote .
-ccflags-y		+= $(shell pkg-config --cflags libnl-3.0)
-ccflags-y		+= $(COMPEL_UAPI_INCLUDES)
-ccflags-y		+= $(CONFIG-DEFINES)
-
-export ccflags-y
+CFLAGS			+= -fno-strict-aliasing
+CFLAGS			+= -iquote criu/include
+CFLAGS			+= -iquote include
+CFLAGS			+= -iquote images
+CFLAGS			+= -iquote $(ARCH_DIR)/include
+CFLAGS			+= -iquote .
+CFLAGS			+= $(shell pkg-config --cflags libnl-3.0)
+CFLAGS			+= $(CONFIG-DEFINES)
 
 ifeq ($(GMON),1)
 	CFLAGS		+= -pg
diff --git a/criu/Makefile.crtools b/criu/Makefile.crtools
index b598f0ef58d8..140436abf26f 100644
--- a/criu/Makefile.crtools
+++ b/criu/Makefile.crtools
@@ -1,5 +1,4 @@ 
 ccflags-y		+= -iquote criu/$(ARCH)
-ccflags-y		+= $(COMPEL_UAPI_INCLUDES)
 CFLAGS_REMOVE_clone-noasan.o += $(CFLAGS-ASAN)
 CFLAGS_kerndat.o	+= -DKDAT_MAGIC_2=${shell echo $${SOURCE_DATE_EPOCH:-$$(date +%s)}} -DKDAT_RUNDIR=\"$(RUNDIR)\"
 ldflags-y		+= -r
diff --git a/criu/arch/aarch64/Makefile b/criu/arch/aarch64/Makefile
index fd721d12fead..b26487367c22 100644
--- a/criu/arch/aarch64/Makefile
+++ b/criu/arch/aarch64/Makefile
@@ -1,8 +1,5 @@ 
 builtin-name		:= crtools.built-in.o
 
-ccflags-y		+= -iquote $(obj)/include -iquote criu/include
-ccflags-y		+= -iquote include
-ccflags-y		+= $(COMPEL_UAPI_INCLUDES)
 ldflags-y		+= -r
 
 obj-y			+= cpu.o
diff --git a/criu/arch/arm/Makefile b/criu/arch/arm/Makefile
index 5142fbe12859..b111e5959b9b 100644
--- a/criu/arch/arm/Makefile
+++ b/criu/arch/arm/Makefile
@@ -1,9 +1,5 @@ 
 builtin-name		:= crtools.built-in.o
 
-ccflags-y		+= -iquote $(obj)/include
-ccflags-y		+= -iquote criu/include -iquote include
-ccflags-y		+= $(COMPEL_UAPI_INCLUDES)
-
 ldflags-y		+= -r -z noexecstack
 
 obj-y			+= cpu.o
diff --git a/criu/arch/ppc64/Makefile b/criu/arch/ppc64/Makefile
index ff0a71207e16..f37337f7474a 100644
--- a/criu/arch/ppc64/Makefile
+++ b/criu/arch/ppc64/Makefile
@@ -1,8 +1,5 @@ 
 builtin-name		:= crtools.built-in.o
 
-ccflags-y		+= -iquote $(obj)/include
-ccflags-y		+= -iquote criu/include -iquote include
-ccflags-y		+= $(COMPEL_UAPI_INCLUDES)
 ldflags-y		+= -r
 
 obj-y			+= cpu.o
diff --git a/criu/arch/s390/Makefile b/criu/arch/s390/Makefile
index ff0a71207e16..f37337f7474a 100644
--- a/criu/arch/s390/Makefile
+++ b/criu/arch/s390/Makefile
@@ -1,8 +1,5 @@ 
 builtin-name		:= crtools.built-in.o
 
-ccflags-y		+= -iquote $(obj)/include
-ccflags-y		+= -iquote criu/include -iquote include
-ccflags-y		+= $(COMPEL_UAPI_INCLUDES)
 ldflags-y		+= -r
 
 obj-y			+= cpu.o
diff --git a/criu/arch/x86/Makefile b/criu/arch/x86/Makefile
index ca92a241c160..618e85bb3eb7 100644
--- a/criu/arch/x86/Makefile
+++ b/criu/arch/x86/Makefile
@@ -1,9 +1,5 @@ 
 builtin-name		:= crtools.built-in.o
 
-ccflags-y		+= -iquote $(obj)/include
-ccflags-y		+= -iquote criu/include -iquote include
-ccflags-y		+= $(COMPEL_UAPI_INCLUDES)
-
 asflags-y		+= -Wstrict-prototypes
 asflags-y		+= -nostdlib -fomit-frame-pointer
 asflags-y		+= -iquote $(obj)/include
diff --git a/criu/pie/Makefile b/criu/pie/Makefile
index 5c06067861eb..526e4e1ad451 100644
--- a/criu/pie/Makefile
+++ b/criu/pie/Makefile
@@ -5,7 +5,6 @@ 
 target		:= parasite restorer
 
 CFLAGS		:= $(filter-out -pg $(CFLAGS-GCOV) $(CFLAGS-ASAN),$(CFLAGS))
-ccflags-y	+= $(COMPEL_UAPI_INCLUDES)
 ccflags-y	+= $(CFLAGS_PIE)
 ccflags-y	+= -DCR_NOGLIBC
 ccflags-y	+= -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=0
diff --git a/criu/pie/Makefile.library b/criu/pie/Makefile.library
index 577497f5af43..467dfd6b6524 100644
--- a/criu/pie/Makefile.library
+++ b/criu/pie/Makefile.library
@@ -34,6 +34,4 @@  ifeq ($(SRCARCH),x86)
 endif
 
 CFLAGS		:= $(filter-out -pg $(CFLAGS-GCOV) $(CFLAGS-ASAN),$(CFLAGS))
-
-ccflags-y		+= $(COMPEL_UAPI_INCLUDES)
 ccflags-y		+= $(CFLAGS_PIE)