Skip to contentSkip to conversation

A few Makefile clean-ups

PATCH In review John Kacur 2 participants 5 messages Feb 8, 2013 Kbuild

lore
Share & tools
lore

John Kacur

author
#0 lore raw

cover A few Makefile clean-ups

From: John Kacur <[email protected]>

I have few simple build clean-ups, which should be uncontroversial for the rt-tests suite

John Kacur (3):
Makefile: Don't tag tmp files created when making a release
Makefile: Add tmp dir to distclean and "make release" call distclean
Makefile: Add BUILDROOT and SPECS to the dirs to remove for distclean

 Makefile | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)
Signature · 1 line
1.7.11.7
author
#1 lore raw

PATCH 1/3 Makefile: Don't tag tmp files created when making a release

From: John Kacur <[email protected]>

Don't tag the copies of the source files placed in the tmp directory during the creation of a release.
Without this change tags finds both copies, eg: for tag cyclictest.c

  # pri kind tag               file
  1 F C F    cyclictest.c      src/cyclictest/cyclictest.c
               1
  2 F   F    cyclictest.c      tmp/rt-tests/src/cyclictest/cyclictest.c
               1

With this change only the first one is found.

---
 Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Makefile +1 -1
index fd3cdb3..3b637c5 100644
@@ -192,4 +192,4 @@ help:
 
 .PHONY: tags
 tags:
-	ctags -R --extra=+f --c-kinds=+p *
+	ctags -R --extra=+f --c-kinds=+p --exclude=tmp *
Signature · 1 line
1.7.11.7
author
#2 lore raw

PATCH 2/3 Makefile: Add tmp dir to distclean and "make release" call distclean

In reply to John Kacur

From: John Kacur <[email protected]>

The files in the tmp dir are generated during make release. These are the kind of generated files that should be removed for distclean, So add tmp. make release can be slightly simplified by then depending on distclean instead of clean.

---
 Makefile | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
Makefile +3 -3
index 3b637c5..ecc7386 100644
@@ -113,7 +113,7 @@ clean:
 
 .PHONY: distclean
 distclean: clean
-	rm -rf BUILD RPMS SRPMS releases *.tar.gz rt-tests.spec
+	rm -rf BUILD RPMS SRPMS releases *.tar.gz rt-tests.spec tmp
 
 .PHONY: changelog
 changelog:
@@ -143,9 +143,9 @@ install: all
 	gzip src/hackbench/hackbench.8 -c >"$(DESTDIR)$(mandir)/man8/hackbench.8.gz"
 
 .PHONY: release
-release: clean changelog
+release: distclean changelog
 	mkdir -p releases
-	rm -rf tmp && mkdir -p tmp/rt-tests
+	mkdir -p tmp/rt-tests
 	cp -r Makefile COPYING ChangeLog src tmp/rt-tests
 	tar -C tmp -czf rt-tests-$(VERSION_STRING).tar.gz rt-tests
 	rm -f ChangeLog
Signature · 1 line
1.7.11.7
author
#3 lore raw

PATCH 3/3 Makefile: Add BUILDROOT and SPECS to the dirs to remove for distclean

In reply to John Kacur

From: John Kacur <[email protected]>

make rpm creates the dirs BUILDROOT and SPECS that are missed by distclean. Gather all rpm related DIRS to the RPMDIRS and add that to distclean.

---
 Makefile | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
Makefile +2 -1
index ecc7386..25cfbfb 100644
@@ -111,9 +111,10 @@ clean:
 	rm -f hwlatdetect
 	rm -f tags
 
+RPMDIRS = BUILD BUILDROOT RPMS SRPMS SPECS
 .PHONY: distclean
 distclean: clean
-	rm -rf BUILD RPMS SRPMS releases *.tar.gz rt-tests.spec tmp
+	rm -rf $(RPMDIRS) releases *.tar.gz rt-tests.spec tmp
 
 .PHONY: changelog
 changelog:
Signature · 1 line
1.7.11.7
Reviewed-by Tested-by on the v1 series
#4 lore raw
In reply to John Kacur
Quoted 5 lines · John Kacur

From: John Kacur <[email protected]>

I have few simple build clean-ups, which should be uncontroversial for the rt-tests suite

Quoted 8 lines

John Kacur (3):
Makefile: Don't tag tmp files created when making a release
Makefile: Add tmp dir to distclean and "make release" call distclean
Makefile: Add BUILDROOT and SPECS to the dirs to remove for distclean

 Makefile | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

All three patches:

With the caveat that "make rpm" does not complete on my build system due to a missing numactl-devel dependency.

Even without "make rpm" completing, it creates the extra objects that patch 3 removes, so I think my testing is still valid.

-Frank