Skip to contentSkip to conversation

Fix clean target warnings

PATCH In review Shuah Khan 5 participants 27 messages Apr 21, 2017 – Apr 27, 2017

Subsystems (6)
x86 PowerPC Kselftest GPIO +2 more subsystems
lore
Share & tools
lore

Shuah Khan

author
#0 lore raw

cover Fix clean target warnings

This patch series consists of changes to lib.mk to allow overriding common clean target from Makefiles. This fixes warnings when clean overriding and ignoring warnings. Also fixes splice clean target removing a script that runs the test from its clean target.

Shuah Khan (8):
selftests: splice: fix clean target to not remove
default_file_splice_read.sh
selftests: lib.mk: define CLEAN macro to allow Makefiles to override
clean
selftests: futex: override clean in lib.mk to fix warnings
selftests: gpio: override clean in lib.mk to fix warnings
selftests: powerpc: override clean in lib.mk to fix warnings
selftests: splice: override clean in lib.mk to fix warnings
selftests: sync: override clean in lib.mk to fix warnings
selftests: x86: override clean in lib.mk to fix warnings

 tools/testing/selftests/futex/Makefile   | 3 ++-
 tools/testing/selftests/gpio/Makefile    | 3 ++-
 tools/testing/selftests/lib.mk           | 6 +++++-
 tools/testing/selftests/powerpc/Makefile | 3 ++-
 tools/testing/selftests/splice/Makefile  | 5 +++--
 tools/testing/selftests/sync/Makefile    | 3 ++-
 tools/testing/selftests/x86/Makefile     | 3 ++-
 7 files changed, 18 insertions(+), 8 deletions(-)
Signature · 1 line
2.9.3
author
#1 lore raw

PATCH 1/8 selftests: splice: fix clean target to not remove default_file_splice_read.sh

splice clean target removes the shell script default_file_splice_read.sh that runs the splice test. Fix it to not remove this file.

---
 tools/testing/selftests/splice/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/testing/selftests/splice/Makefile +1 -1
index de51f43..559512c 100644
@@ -5,4 +5,4 @@ all: $(TEST_PROGS) $(EXTRA)
 include ../lib.mk
 
 clean:
-	rm -fr $(TEST_PROGS) $(EXTRA)
+	rm -fr $(EXTRA)
Signature · 1 line
2.9.3
author
#2 lore raw

PATCH 2/8 selftests: lib.mk: define CLEAN macro to allow Makefiles to override clean

In reply to Shuah Khan

Define CLEAN macro to allow Makefiles to override common clean target in lib.mk. This will help fix the following failures:

warning: overriding recipe for target 'clean' ../lib.mk:55: warning: ignoring old recipe for target 'clean'

---
 tools/testing/selftests/lib.mk | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
tools/testing/selftests/lib.mk +5 -1
index 775c589..959273c 100644
@@ -51,8 +51,12 @@ endef
 emit_tests:
 	$(EMIT_TESTS)
 
-clean:
+define CLEAN
 	$(RM) -r $(TEST_GEN_PROGS) $(TEST_GEN_PROGS_EXTENDED) $(TEST_GEN_FILES) $(EXTRA_CLEAN)
+endef
+
+clean:
+	$(CLEAN)
 
 $(OUTPUT)/%:%.c
 	$(LINK.c) $^ $(LDLIBS) -o $@
Signature · 1 line
2.9.3
reviewer Acked-by on v1 2/8
#3 lore raw

Re: [PATCH 2/8] selftests: lib.mk: define CLEAN macro to allow Makefiles to override clean

Quoted 7 lines · Shuah Khan

Define CLEAN macro to allow Makefiles to override common clean target in lib.mk. This will help fix the following failures:

warning: overriding recipe for target 'clean' ../lib.mk:55: warning: ignoring old recipe for target 'clean'

Should probably have:

Fixes 88baa78d1f31 ("selftests: remove duplicated all and clean target")

In hindsight I'm not sure moving the clean target into lib.mk was the best idea, but anyway it's a bit late to change our mind on that.

This patch is a good solution to fix the warnings.

cheers

author
#4 lore raw

Re: [PATCH 2/8] selftests: lib.mk: define CLEAN macro to allow Makefiles to override clean

Quoted 5 lines · Michael Ellerman
Quoted 3 lines · Shuah Khan

Define CLEAN macro to allow Makefiles to override common clean target in lib.mk. This will help fix the following failures:

Quoted 8 lines
Quoted 4 lines

warning: overriding recipe for target 'clean' ../lib.mk:55: warning: ignoring old recipe for target 'clean'

Should probably have:

Fixes 88baa78d1f31 ("selftests: remove duplicated all and clean target")

Amended the change log to add the above.

Quoted 4 lines

In hindsight I'm not sure moving the clean target into lib.mk was the best idea, but anyway it's a bit late to change our mind on that.

Yeah. Moving clean target to lib.mk ended up to be problematic. However, there are some advantages as well. It will simplify some Makefiles. One thing that was missed was that not finding the Makefiles that require overrides. Anyway live and learn.

Quoted 5 lines

This patch is a good solution to fix the warnings.

Thanks. I plan to apply the patch with the amended changelog and your Ack. Please let me know if you want to see v2 with the change sent out.

thanks,
-- Shuah

#5 lore raw

Re: [PATCH 2/8] selftests: lib.mk: define CLEAN macro to allow Makefiles to override clean

Quoted 9 lines · Shuah Khan
Quoted 5 lines · Michael Ellerman

Shuah Khan <[email protected]> writes:

This patch is a good solution to fix the warnings.

Thanks. I plan to apply the patch with the amended changelog and your Ack. Please let me know if you want to see v2 with the change sent out.

I don't really mind if you send it or not.

cheers

#6 lore raw

RE: [PATCH 2/8] selftests: lib.mk: define CLEAN macro to allow Makefiles to override clean

In reply to Shuah Khan

From: Shuah Khan

Quoted 17 lines

Sent: 22 April 2017 00:15
Define CLEAN macro to allow Makefiles to override common clean target in lib.mk. This will help fix the following failures:

warning: overriding recipe for target 'clean' ../lib.mk:55: warning: ignoring old recipe for target 'clean'

---
 tools/testing/selftests/lib.mk | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
tools/testing/selftests/lib.mk +0 -0
index 775c589..959273c 100644

tools/testing/selftests/lib.mk endef · line 59

Quoted 10 lines
tools/testing/selftests/lib.mk +5 -1
@@ -51,8 +51,12 @@ endef
 emit_tests:
 	$(EMIT_TESTS)
 
-clean:
+define CLEAN
 	$(RM) -r $(TEST_GEN_PROGS) $(TEST_GEN_PROGS_EXTENDED) $(TEST_GEN_FILES) $(EXTRA_CLEAN)
+endef
+
+clean:
+	$(CLEAN)

If might be easier to do something like:

ifneq($(NO_CLEAN),y)
clean:

	$(RM) -r $(TEST_GEN_PROGS) $(TEST_GEN_PROGS_EXTENDED) $(TEST_GEN_FILES) $(EXTRA_CLEAN)

endif

David

maintainer
#7 lore raw

Re: [PATCH 2/8] selftests: lib.mk: define CLEAN macro to allow Makefiles to override clean

Quoted 31 lines · David Laight

From: Shuah Khan

Quoted 17 lines

Sent: 22 April 2017 00:15
Define CLEAN macro to allow Makefiles to override common clean target in lib.mk. This will help fix the following failures:

warning: overriding recipe for target 'clean' ../lib.mk:55: warning: ignoring old recipe for target 'clean'

---
 tools/testing/selftests/lib.mk | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
tools/testing/selftests/lib.mk +0 -0
index 775c589..959273c 100644

tools/testing/selftests/lib.mk endef · line 59

Quoted 10 lines
tools/testing/selftests/lib.mk +5 -1
@@ -51,8 +51,12 @@ endef
 emit_tests:
 	$(EMIT_TESTS)
 
-clean:
+define CLEAN
 	$(RM) -r $(TEST_GEN_PROGS) $(TEST_GEN_PROGS_EXTENDED) $(TEST_GEN_FILES) $(EXTRA_CLEAN)
+endef
+
+clean:
+	$(CLEAN)

If might be easier to do something like:

Quoted 7 lines

ifneq($(NO_CLEAN),y)
clean:

	$(RM) -r $(TEST_GEN_PROGS) $(TEST_GEN_PROGS_EXTENDED) $(TEST_GEN_FILES) $(EXTRA_CLEAN)

endif

David

I am not sure that it is easier. Defining a macro would work well in this case to override and also works well with what we are doing for other overrides we already have such as EMIT_TESTS.

thanks,
-- Shuah

author
#8 lore raw

PATCH 3/8 selftests: futex: override clean in lib.mk to fix warnings

In reply to Shuah Khan

Add override for lib.mk clean to fix the following warnings from clean target run.

Makefile:36: warning: overriding recipe for target 'clean' ../lib.mk:55: warning: ignoring old recipe for target 'clean'

---
 tools/testing/selftests/futex/Makefile | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
tools/testing/selftests/futex/Makefile +2 -1
index c8095e6..e2fbb89 100644
@@ -32,9 +32,10 @@ override define EMIT_TESTS
 	echo "./run.sh"
 endef
 
-clean:
+override define CLEAN
 	for DIR in $(SUBDIRS); do		\
 		BUILD_TARGET=$(OUTPUT)/$$DIR;	\
 		mkdir $$BUILD_TARGET  -p;	\
 		make OUTPUT=$$BUILD_TARGET -C $$DIR $@;\
 	done
+endef
Signature · 1 line
2.9.3
reviewer Acked-by on v1 3/8
#9 lore raw

Re: [PATCH 3/8] selftests: futex: override clean in lib.mk to fix warnings

Quoted 17 lines · Shuah Khan

Add override for lib.mk clean to fix the following warnings from clean target run.

Makefile:36: warning: overriding recipe for target 'clean' ../lib.mk:55: warning: ignoring old recipe for target 'clean'

---
 tools/testing/selftests/futex/Makefile | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
tools/testing/selftests/futex/Makefile +0 -0
index c8095e6..e2fbb89 100644
@@ -32,9 +32,10 @@ override define EMIT_TESTS
 	echo "./run.sh"

tools/testing/selftests/futex/Makefile override define EMIT_TESTS · line 41

Quoted 10 lines
tools/testing/selftests/futex/Makefile +2 -1
 endef
 
-clean:
+override define CLEAN
 	for DIR in $(SUBDIRS); do		\
 		BUILD_TARGET=$(OUTPUT)/$$DIR;	\
 		mkdir $$BUILD_TARGET  -p;	\
 		make OUTPUT=$$BUILD_TARGET -C $$DIR $@;\
 	done
+endef

Taking the move of clean into lib.mk as a given,

Signature · 2 lines
Darren Hart
VMware Open Source Technology Center
author
#10 lore raw

Re: [PATCH 3/8] selftests: futex: override clean in lib.mk to fix warnings

Quoted 20 lines · Darren Hart
Quoted 19 lines · Shuah Khan

Add override for lib.mk clean to fix the following warnings from clean target run.

Makefile:36: warning: overriding recipe for target 'clean' ../lib.mk:55: warning: ignoring old recipe for target 'clean'

---
 tools/testing/selftests/futex/Makefile | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
tools/testing/selftests/futex/Makefile +0 -0
index c8095e6..e2fbb89 100644
@@ -32,9 +32,10 @@ override define EMIT_TESTS
 	echo "./run.sh"
 endef
 
Quoted 10 lines

tools/testing/selftests/futex/Makefile override define EMIT_TESTS · line 41

Quoted 8 lines
tools/testing/selftests/futex/Makefile +2 -1
-clean:
+override define CLEAN
 	for DIR in $(SUBDIRS); do		\
 		BUILD_TARGET=$(OUTPUT)/$$DIR;	\
 		mkdir $$BUILD_TARGET  -p;	\
 		make OUTPUT=$$BUILD_TARGET -C $$DIR $@;\
 	done
+endef

Taking the move of clean into lib.mk as a given,

Yeah I considered undoing that, and chose to fix the missed issues instead.

Quoted 3 lines

thanks,
-- Shuah

author
#11 lore raw

PATCH 4/8 selftests: gpio: override clean in lib.mk to fix warnings

In reply to Shuah Khan

Add override for lib.mk clean to fix the following warnings from clean target run.

Makefile:11: warning: overriding recipe for target 'clean' ../lib.mk:55: warning: ignoring old recipe for target 'clean'

---
 tools/testing/selftests/gpio/Makefile | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
tools/testing/selftests/gpio/Makefile +2 -1
index 205e4d1..4f6d9e0 100644
@@ -7,8 +7,9 @@ include ../lib.mk
 
 all: $(BINARIES)
 
-clean:
+override define CLEAN
 	$(RM) $(BINARIES)
+endef
 
 CFLAGS += -O2 -g -std=gnu99 -Wall -I../../../../usr/include/
 LDLIBS += -lmount -I/usr/include/libmount
Signature · 1 line
2.9.3
#12 lore raw

Re: [PATCH 4/8] selftests: gpio: override clean in lib.mk to fix warnings

Quoted 16 lines · Shuah Khan

Add override for lib.mk clean to fix the following warnings from clean target run.

Makefile:11: warning: overriding recipe for target 'clean' ../lib.mk:55: warning: ignoring old recipe for target 'clean'

---
 tools/testing/selftests/gpio/Makefile | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
tools/testing/selftests/gpio/Makefile +0 -0
index 205e4d1..4f6d9e0 100644

tools/testing/selftests/gpio/Makefile include ../lib.mk · line 12

Quoted 7 lines
tools/testing/selftests/gpio/Makefile +2 -1
@@ -7,8 +7,9 @@ include ../lib.mk
 
 all: $(BINARIES)
 
-clean:
+override define CLEAN
 	$(RM) $(BINARIES)
+endef

This could be achieved more simply with:

EXTRA_CLEAN := $(BINARIES)

cheers

author
#13 lore raw

Re: [PATCH 4/8] selftests: gpio: override clean in lib.mk to fix warnings

Quoted 21 lines · Michael Ellerman
Quoted 19 lines · Shuah Khan

Add override for lib.mk clean to fix the following warnings from clean target run.

Makefile:11: warning: overriding recipe for target 'clean' ../lib.mk:55: warning: ignoring old recipe for target 'clean'

---
 tools/testing/selftests/gpio/Makefile | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
tools/testing/selftests/gpio/Makefile +0 -0
index 205e4d1..4f6d9e0 100644
@@ -7,8 +7,9 @@ include ../lib.mk
 
 all: $(BINARIES)
 
Quoted 9 lines

tools/testing/selftests/gpio/Makefile include ../lib.mk · line 12

Quoted 4 lines
tools/testing/selftests/gpio/Makefile +2 -1
-clean:
+override define CLEAN
 	$(RM) $(BINARIES)
+endef

This could be achieved more simply with:

EXTRA_CLEAN := $(BINARIES)

gpio clean requires special handling. I have one more patch I sent out that handles that. So I am going to leave this patch the way with override.

thanks,
-- Shuah

author
#14 lore raw

PATCH 5/8 selftests: powerpc: override clean in lib.mk to fix warnings

In reply to Shuah Khan

Add override for lib.mk clean to fix the following warnings from clean target run.

Makefile:63: warning: overriding recipe for target 'clean' ../lib.mk:55: warning: ignoring old recipe for target 'clean'

---
 tools/testing/selftests/powerpc/Makefile | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
tools/testing/selftests/powerpc/Makefile +2 -1
index 1c5d057..8d9fc64 100644
@@ -59,12 +59,13 @@ override define EMIT_TESTS
 	done;
 endef
 
-clean:
+override define CLEAN
 	@for TARGET in $(SUB_DIRS); do \
 		BUILD_TARGET=$$OUTPUT/$$TARGET;	\
 		$(MAKE) OUTPUT=$$BUILD_TARGET -C $$TARGET clean; \
 	done;
 	rm -f tags
+endef
 
 tags:
 	find . -name '*.c' -o -name '*.h' | xargs ctags
Signature · 1 line
2.9.3
author
#15 lore raw

PATCH 6/8 selftests: splice: override clean in lib.mk to fix warnings

In reply to Shuah Khan

Add override for lib.mk clean to fix the following warnings from clean target run.

Makefile:8: warning: overriding recipe for target 'clean' ../lib.mk:55: warning: ignoring old recipe for target 'clean'

---
 tools/testing/selftests/splice/Makefile | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
tools/testing/selftests/splice/Makefile +2 -1
index 559512c..3f967ba 100644
@@ -4,5 +4,6 @@ all: $(TEST_PROGS) $(EXTRA)
 
 include ../lib.mk
 
-clean:
+override define CLEAN
 	rm -fr $(EXTRA)
+endef
Signature · 1 line
2.9.3
#16 lore raw

Re: [PATCH 6/8] selftests: splice: override clean in lib.mk to fix warnings

Quoted 16 lines · Shuah Khan

Add override for lib.mk clean to fix the following warnings from clean target run.

Makefile:8: warning: overriding recipe for target 'clean' ../lib.mk:55: warning: ignoring old recipe for target 'clean'

---
 tools/testing/selftests/splice/Makefile | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
tools/testing/selftests/splice/Makefile +0 -0
index 559512c..3f967ba 100644

tools/testing/selftests/splice/Makefile all: $(TEST_PROGS) $(EXTRA) · line 9

Quoted 7 lines
tools/testing/selftests/splice/Makefile +2 -1
@@ -4,5 +4,6 @@ all: $(TEST_PROGS) $(EXTRA)
 
 include ../lib.mk
 
-clean:
+override define CLEAN
 	rm -fr $(EXTRA)
+endef

Could just be:

EXTRA_CLEAN := $(EXTRA)

cheers

author
#17 lore raw

Re: [PATCH 6/8] selftests: splice: override clean in lib.mk to fix warnings

Quoted 21 lines · Michael Ellerman
Quoted 19 lines · Shuah Khan

Add override for lib.mk clean to fix the following warnings from clean target run.

Makefile:8: warning: overriding recipe for target 'clean' ../lib.mk:55: warning: ignoring old recipe for target 'clean'

---
 tools/testing/selftests/splice/Makefile | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
tools/testing/selftests/splice/Makefile +0 -0
index 559512c..3f967ba 100644
@@ -4,5 +4,6 @@ all: $(TEST_PROGS) $(EXTRA)
 
 include ../lib.mk
 
Quoted 9 lines

tools/testing/selftests/splice/Makefile all: $(TEST_PROGS) $(EXTRA) · line 9

Quoted 4 lines
tools/testing/selftests/splice/Makefile +2 -1
-clean:
+override define CLEAN
 	rm -fr $(EXTRA)
+endef

Could just be:

EXTRA_CLEAN := $(EXTRA)

Will send v2 with this change.

-- Shuah

author
#18 lore raw

PATCH 7/8 selftests: sync: override clean in lib.mk to fix warnings

In reply to Shuah Khan

Add override for lib.mk clean to fix the following warnings from clean target run.

Makefile:24: warning: overriding recipe for target 'clean' ../lib.mk:55: warning: ignoring old recipe for target 'clean'

---
 tools/testing/selftests/sync/Makefile | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
tools/testing/selftests/sync/Makefile +2 -1
index 87ac400..f7d250d 100644
@@ -20,5 +20,6 @@ TESTS += sync_stress_merge.o
 
 sync_test: $(OBJS) $(TESTS)
 
-clean:
+override define CLEAN
 	$(RM) sync_test $(OBJS) $(TESTS)
+endef
Signature · 1 line
2.9.3
#19 lore raw

Re: [PATCH 7/8] selftests: sync: override clean in lib.mk to fix warnings

Quoted 16 lines · Shuah Khan

Add override for lib.mk clean to fix the following warnings from clean target run.

Makefile:24: warning: overriding recipe for target 'clean' ../lib.mk:55: warning: ignoring old recipe for target 'clean'

---
 tools/testing/selftests/sync/Makefile | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
tools/testing/selftests/sync/Makefile +0 -0
index 87ac400..f7d250d 100644

tools/testing/selftests/sync/Makefile TESTS += sync_stress_merge.o · line 25

Quoted 7 lines
tools/testing/selftests/sync/Makefile +2 -1
@@ -20,5 +20,6 @@ TESTS += sync_stress_merge.o
 
 sync_test: $(OBJS) $(TESTS)
 
-clean:
+override define CLEAN
 	$(RM) sync_test $(OBJS) $(TESTS)
+endef

EXTRA_CLEAN := sync_test $(OBJS) $(TESTS)

cheers

author
#20 lore raw

Re: [PATCH 7/8] selftests: sync: override clean in lib.mk to fix warnings

Quoted 19 lines · Michael Ellerman
Quoted 17 lines · Shuah Khan

Add override for lib.mk clean to fix the following warnings from clean target run.

Makefile:24: warning: overriding recipe for target 'clean' ../lib.mk:55: warning: ignoring old recipe for target 'clean'

---
 tools/testing/selftests/sync/Makefile | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
tools/testing/selftests/sync/Makefile +0 -0
index 87ac400..f7d250d 100644
@@ -20,5 +20,6 @@ TESTS += sync_stress_merge.o
 
Quoted 9 lines

tools/testing/selftests/sync/Makefile TESTS += sync_stress_merge.o · line 25

Quoted 6 lines
tools/testing/selftests/sync/Makefile +2 -1
 sync_test: $(OBJS) $(TESTS)
 
-clean:
+override define CLEAN
 	$(RM) sync_test $(OBJS) $(TESTS)
+endef

EXTRA_CLEAN := sync_test $(OBJS) $(TESTS)

Will send v2 with this change.

-- Shuah

author
#21 lore raw

PATCH 8/8 selftests: x86: override clean in lib.mk to fix warnings

In reply to Shuah Khan

Add override for lib.mk clean to fix the following warnings from clean target run.

Makefile:44: warning: overriding recipe for target 'clean' ../lib.mk:55: warning: ignoring old recipe for target 'clean'

---
 tools/testing/selftests/x86/Makefile | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
tools/testing/selftests/x86/Makefile +2 -1
index 38e0a9c..4d27550 100644
@@ -40,8 +40,9 @@ all_32: $(BINARIES_32)
 
 all_64: $(BINARIES_64)
 
-clean:
+override define CLEAN
 	$(RM) $(BINARIES_32) $(BINARIES_64)
+endef
 
 $(BINARIES_32): $(OUTPUT)/%_32: %.c
 	$(CC) -m32 -o $@ $(CFLAGS) $(EXTRA_CFLAGS) $^ -lrt -ldl -lm
Signature · 1 line
2.9.3
#22 lore raw

Re: [PATCH 8/8] selftests: x86: override clean in lib.mk to fix warnings

Quoted 16 lines · Shuah Khan

Add override for lib.mk clean to fix the following warnings from clean target run.

Makefile:44: warning: overriding recipe for target 'clean' ../lib.mk:55: warning: ignoring old recipe for target 'clean'

---
 tools/testing/selftests/x86/Makefile | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
tools/testing/selftests/x86/Makefile +0 -0
index 38e0a9c..4d27550 100644

tools/testing/selftests/x86/Makefile all_32: $(BINARIES_32) · line 45

Quoted 7 lines
tools/testing/selftests/x86/Makefile +2 -1
@@ -40,8 +40,9 @@ all_32: $(BINARIES_32)
 
 all_64: $(BINARIES_64)
 
-clean:
+override define CLEAN
 	$(RM) $(BINARIES_32) $(BINARIES_64)
+endef

Simpler as:

EXTRA_CLEAN := $(BINARIES_32) $(BINARIES_64)

cheers

#23 lore raw

RE: [PATCH 8/8] selftests: x86: override clean in lib.mk to fix warnings

From: Linuxppc-dev Michael Ellerman

Quoted 21 lines
Quoted 19 lines · Shuah Khan

Add override for lib.mk clean to fix the following warnings from clean target run.

Makefile:44: warning: overriding recipe for target 'clean' ../lib.mk:55: warning: ignoring old recipe for target 'clean'

---
 tools/testing/selftests/x86/Makefile | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
tools/testing/selftests/x86/Makefile +0 -0
index 38e0a9c..4d27550 100644
@@ -40,8 +40,9 @@ all_32: $(BINARIES_32)
 
 all_64: $(BINARIES_64)
 
Quoted 8 lines

tools/testing/selftests/x86/Makefile all_32: $(BINARIES_32) · line 45

Quoted 4 lines
tools/testing/selftests/x86/Makefile +2 -1
-clean:
+override define CLEAN
 	$(RM) $(BINARIES_32) $(BINARIES_64)
+endef

Simpler as:

EXTRA_CLEAN := $(BINARIES_32) $(BINARIES_64)

Actually for builds that insist on crapping all over the source tree I've used:

clean:
rm -rf cat .cvsignore 2>/dev/null

David

maintainer
#24 lore raw

Re: [PATCH 8/8] selftests: x86: override clean in lib.mk to fix warnings

Quoted 29 lines · David Laight

From: Linuxppc-dev Michael Ellerman

Quoted 28 lines
Quoted 16 lines · Shuah Khan

Add override for lib.mk clean to fix the following warnings from clean target run.

Makefile:44: warning: overriding recipe for target 'clean' ../lib.mk:55: warning: ignoring old recipe for target 'clean'

---
 tools/testing/selftests/x86/Makefile | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
tools/testing/selftests/x86/Makefile +0 -0
index 38e0a9c..4d27550 100644

tools/testing/selftests/x86/Makefile all_32: $(BINARIES_32) · line 45

Quoted 7 lines
tools/testing/selftests/x86/Makefile +2 -1
@@ -40,8 +40,9 @@ all_32: $(BINARIES_32)
 
 all_64: $(BINARIES_64)
 
-clean:
+override define CLEAN
 	$(RM) $(BINARIES_32) $(BINARIES_64)
+endef

Simpler as:

Quoted 8 lines
Quoted 1 line

EXTRA_CLEAN := $(BINARIES_32) $(BINARIES_64)

Actually for builds that insist on crapping all over the source tree I've used:

clean:
rm -rf cat .cvsignore 2>/dev/null

David

This will have to be done as a separate change. The warnings I am fixing are related to common clean target in lib.mk and the need to override.

thanks,
-- Shuah

author
#25 lore raw

Re: [PATCH 8/8] selftests: x86: override clean in lib.mk to fix warnings

In reply to Michael Ellerman
Quoted 21 lines · Michael Ellerman
Quoted 19 lines · Shuah Khan

Add override for lib.mk clean to fix the following warnings from clean target run.

Makefile:44: warning: overriding recipe for target 'clean' ../lib.mk:55: warning: ignoring old recipe for target 'clean'

---
 tools/testing/selftests/x86/Makefile | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
tools/testing/selftests/x86/Makefile +0 -0
index 38e0a9c..4d27550 100644
@@ -40,8 +40,9 @@ all_32: $(BINARIES_32)
 
 all_64: $(BINARIES_64)
 
Quoted 9 lines

tools/testing/selftests/x86/Makefile all_32: $(BINARIES_32) · line 45

Quoted 4 lines
tools/testing/selftests/x86/Makefile +2 -1
-clean:
+override define CLEAN
 	$(RM) $(BINARIES_32) $(BINARIES_64)
+endef

Simpler as:

EXTRA_CLEAN := $(BINARIES_32) $(BINARIES_64)

Will send v2 with this change.

thanks,
-- Shuah

author
#26 lore raw
In reply to Shuah Khan
Quoted 10 lines · Shuah Khan

This patch series consists of changes to lib.mk to allow overriding common clean target from Makefiles. This fixes warnings when clean overriding and ignoring warnings. Also fixes splice clean target removing a script that runs the test from its clean target.

Shuah Khan (8):
selftests: splice: fix clean target to not remove
default_file_splice_read.sh
selftests: lib.mk: define CLEAN macro to allow Makefiles to override
clean

Applied with amended change log and Michael's ack to linux-kselftest next

Quoted 3 lines

selftests: futex: override clean in lib.mk to fix warnings
selftests: gpio: override clean in lib.mk to fix warnings
selftests: powerpc: override clean in lib.mk to fix warnings

Applied all of the above to linux-kseltftest next

Quoted 3 lines

selftests: splice: override clean in lib.mk to fix warnings
selftests: sync: override clean in lib.mk to fix warnings
selftests: x86: override clean in lib.mk to fix warnings

Applied v2s addressing Michael's comments to linux-kselftest next x86 fix also addresses not being able to build ldt_gdt

make -C tools/testing/selftests/x86 ldt_gdt

thanks,
-- Shuah