Skip to contentSkip to conversation

rt-tests: Makefile fixes for PYLIB and hwlatdetect

PATCH New Darren Hart 1 participant 3 messages Sep 12, 2012 Kbuild

lore
Share & tools
lore
#0 lore raw

cover rt-tests: Makefile fixes for PYLIB and hwlatdetect

For cross-build-systems, it is necessary to specify the PYLIB path. It is also useful to treat hwlatdetect separately from the rest of the tests as it pulls in a number of python dependencies.

#1 lore raw

PATCH 1/2 rt-tests: Allow for user-specified PYLIB

Allow users (build systems) to specify PYLIB. This allows for a cross-build-system to specify the target PYLIB rather than the host PYLIB.

CC Clark Williams <[email protected]>
CC John Kacur <[email protected]>
---
 Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Makefile +1 -1
index 3a82407..61e2f9f 100644
@@ -23,7 +23,7 @@ endif
 CFLAGS ?= -D_GNU_SOURCE -Wall -Wno-nonnull -Isrc/include
 LDFLAGS ?=
 
-PYLIB  := $(shell python -c 'import distutils.sysconfig;  print distutils.sysconfig.get_python_lib()')
+PYLIB  ?= $(shell python -c 'import distutils.sysconfig;  print distutils.sysconfig.get_python_lib()')
 
 ifndef DEBUG
 	CFLAGS	+= -O2
Signature · 1 line
1.7.11.4
#2 lore raw

PATCH 2/2 rt-tests: Break out install_hwlatdetect

In reply to Darren Hart

Allow hwlatdetect to be installed independently of the rest of the tests. This is convenient for build systems that package it separately due to the python dependency.

CC Clark Williams <[email protected]>
CC John Kacur <[email protected]>
---
 Makefile | 18 +++++++++++-------
 1 file changed, 11 insertions(+), 7 deletions(-)
Makefile +11 -7
index 61e2f9f..636e63b 100644
@@ -119,21 +119,15 @@ changelog:
 	git log >ChangeLog
 
 .PHONY: install
-install: all
+install: all install_hwlatdetect
 	mkdir -p "$(DESTDIR)$(bindir)" "$(DESTDIR)$(mandir)/man4"
 	mkdir -p "$(DESTDIR)$(srcdir)" "$(DESTDIR)$(mandir)/man8"
 	cp $(TARGETS) "$(DESTDIR)$(bindir)"
-	if test -n "$(PYLIB)" ; then \
-		install -D -m 755 src/hwlatdetect/hwlatdetect.py $(DESTDIR)$(PYLIB)/hwlatdetect.py ; \
-		rm -f "$(DESTDIR)$(bindir)/hwlatdetect" ; \
-		ln -s $(PYLIB)/hwlatdetect.py "$(DESTDIR)$(bindir)/hwlatdetect" ; \
-	fi
 	install -D -m 644 src/backfire/backfire.c "$(DESTDIR)$(srcdir)/backfire/backfire.c"
 	install -m 644 src/backfire/Makefile "$(DESTDIR)$(srcdir)/backfire/Makefile"
 	gzip src/backfire/backfire.4 -c >"$(DESTDIR)$(mandir)/man4/backfire.4.gz"
 	gzip src/cyclictest/cyclictest.8 -c >"$(DESTDIR)$(mandir)/man8/cyclictest.8.gz"
 	gzip src/pi_tests/pi_stress.8 -c >"$(DESTDIR)$(mandir)/man8/pi_stress.8.gz"
-	gzip src/hwlatdetect/hwlatdetect.8 -c >"$(DESTDIR)$(mandir)/man8/hwlatdetect.8.gz"
 	gzip src/ptsematest/ptsematest.8 -c >"$(DESTDIR)$(mandir)/man8/ptsematest.8.gz"
 	gzip src/sigwaittest/sigwaittest.8 -c >"$(DESTDIR)$(mandir)/man8/sigwaittest.8.gz"
 	gzip src/svsematest/svsematest.8 -c >"$(DESTDIR)$(mandir)/man8/svsematest.8.gz"
@@ -141,6 +135,16 @@ install: all
 	gzip src/backfire/sendme.8 -c >"$(DESTDIR)$(mandir)/man8/sendme.8.gz"
 	gzip src/hackbench/hackbench.8 -c >"$(DESTDIR)$(mandir)/man8/hackbench.8.gz"
 
+.PHONY: install_hwlatdetect
+install_hwlatdetect: hwlatdetect
+	if test -n "$(PYLIB)" ; then \
+		mkdir -p "$(DESTDIR)$(bindir)" "$(DESTDIR)$(mandir)/man8" ; \
+		install -D -m 755 src/hwlatdetect/hwlatdetect.py $(DESTDIR)$(PYLIB)/hwlatdetect.py ; \
+		rm -f "$(DESTDIR)$(bindir)/hwlatdetect" ; \
+		ln -s $(PYLIB)/hwlatdetect.py "$(DESTDIR)$(bindir)/hwlatdetect" ; \
+		gzip src/hwlatdetect/hwlatdetect.8 -c >"$(DESTDIR)$(mandir)/man8/hwlatdetect.8.gz" ; \
+	fi
+
 .PHONY: release
 release: clean changelog
 	mkdir -p releases
Signature · 1 line
1.7.11.4