tools/python: Improve .gitgnore and clean Makefile rule
PATCH v2 1/1 tools/python: Improve .gitgnore and clean Makefile rule
Ignore all intermediate python files, and use find in the clean rule as there are no Makefiles in subdirectories to participate in a recursive clean.
--
v2: Actually send the latest version of the patch
--- .gitignore | 1 + tools/python/Makefile | 8 +++----- 2 files changed, 4 insertions(+), 5 deletions(-)
.gitignore +1 -0
@@ -16,6 +16,7 @@ *.spit *.gcno *.gcda +*.py[ocd] TAGS GTAGS GRTAGS
tools/python/Makefile +3 -5
@@ -29,10 +29,8 @@ test: .PHONY: clean clean: - rm -f $(XENPATH) - rm -rf build/ *.pyc *.pyo *.o *.a *~ xen/util/auxbin.pyc - rm -f xen/lowlevel/xl/_pyxl_types.h - rm -f xen/lowlevel/xl/_pyxl_types.c - rm -f $(DEPS) + find . \( -name "*.py[ocd]" -o -name "*~" -o -name "_*.[hc]" \) -delete + rm -rf build/ + rm -f $(XENPATH) $(DEPS) -include $(DEPS)
Signature · 1 line
1.7.10.4
Quoted 12 lines · Andrew Cooper
Ignore all intermediate python files, and use find in the clean rule as there are no Makefiles in subdirectories to participate in a recursive clean.
Signed-off-by Andrew Cooper <[email protected]>CC Ian Campbell <[email protected]>CC Ian Jackson <[email protected]>.gitignore +0
-0
.gitignore line 19
Quoted 4 lines
.gitignore +1
-0@@ -16,6 +16,7 @@ *.spit *.gcno *.gcda +*.py[ocd]
FWIW there are a bunch of explicit foo.pyc listed which could now be removed I guess.
.gitignore
Quoted 6 lines
.gitignore +1
-5- rm -f $(XENPATH) - rm -rf build/ *.pyc *.pyo *.o *.a *~ xen/util/auxbin.pyc - rm -f xen/lowlevel/xl/_pyxl_types.h - rm -f xen/lowlevel/xl/_pyxl_types.c - rm -f $(DEPS) + find . \( -name "*.py[ocd]" -o -name "*~" -o -name "_*.[hc]" \) -delete
I've assumed the lack of *.a in here is deliberate but *.o?
Ian.
Quoted 4 lines · Ian Campbell
Quoted 3 lines · Andrew Cooper
Ignore all intermediate python files, and use find in the clean rule as there are no Makefiles in subdirectories to participate in a recursive clean.
Quoted 14 lines
.gitignore line 19
Quoted 12 lines
Signed-off-by Andrew Cooper <[email protected]>CC Ian Campbell <[email protected]>CC Ian Jackson <[email protected]>.gitignore +1
-0@@ -16,6 +16,7 @@ *.spit *.gcno *.gcda +*.py[ocd]FWIW there are a bunch of explicit foo.pyc listed which could now be removed I guess.
True.
Quoted 11 lines
.gitignore
Quoted 7 lines
.gitignore +1
-5- rm -f $(XENPATH) - rm -rf build/ *.pyc *.pyo *.o *.a *~ xen/util/auxbin.pyc - rm -f xen/lowlevel/xl/_pyxl_types.h - rm -f xen/lowlevel/xl/_pyxl_types.c - rm -f $(DEPS) + find . \( -name "*.py[ocd]" -o -name "*~" -o -name "_*.[hc]" \) -deleteI've assumed the lack of *.a in here is deliberate but *.o?
Ian.
No object files or libraries will be generated outside of build/
If we wish to cater to devs doing out-of-band builds in subdirectires then more than .o and .a should be included in this find.
~Andrew
Quoted 31 lines · Andrew Cooper
Quoted 4 lines · Ian Campbell
Quoted 3 lines · Andrew Cooper
Ignore all intermediate python files, and use find in the clean rule as there are no Makefiles in subdirectories to participate in a recursive clean.
Quoted 14 lines
.gitignore line 19
Quoted 12 lines
Signed-off-by Andrew Cooper <[email protected]>CC Ian Campbell <[email protected]>CC Ian Jackson <[email protected]>.gitignore +1
-0@@ -16,6 +16,7 @@ *.spit *.gcno *.gcda +*.py[ocd]FWIW there are a bunch of explicit foo.pyc listed which could now be removed I guess.
True.
Quoted 9 lines
.gitignore
Quoted 7 lines
.gitignore +1
-5- rm -f $(XENPATH) - rm -rf build/ *.pyc *.pyo *.o *.a *~ xen/util/auxbin.pyc - rm -f xen/lowlevel/xl/_pyxl_types.h - rm -f xen/lowlevel/xl/_pyxl_types.c - rm -f $(DEPS) + find . \( -name "*.py[ocd]" -o -name "*~" -o -name "_*.[hc]" \) -deleteI've assumed the lack of *.a in here is deliberate but *.o?
Quoted 4 lines
Quoted 2 lines
Ian.
No object files or libraries will be generated outside of build/
Ah, right.
Quoted 2 lines
If we wish to cater to devs doing out-of-band builds in subdirectires then more than .o and .a should be included in this find.
no need: Acked-by: Ian Campbell <[email protected]>
Quoted 4 lines · Ian Campbell
Quoted 2 lines
If we wish to cater to devs doing out-of-band builds in subdirectires then more than .o and .a should be included in this find.
no need: Acked-by: Ian Campbell <[email protected]>
and applied, thanks.