* [PATCH 0/3] rt-tests: Makefile changes
@ 2009-11-16 18:40 John Kacur
2009-11-16 18:40 ` [PATCH 1/3] rt-tests: Makefile - Change FLAGS to CFLAGS John Kacur
0 siblings, 1 reply; 4+ messages in thread
From: John Kacur @ 2009-11-16 18:40 UTC (permalink / raw)
To: Clark Williams; +Cc: John Kacur, rt-users
Here are a few simple Makefile changes to the rt-tests suite.
The DEBUG option is especially useful for debugging problems.
For example, it allows you to do:
make DEBUG=0 pi_stress
That will compile a version of pi_stress with -O0 -g
You can also pull
e2a22de97709513b3d541f65280db51e44431a3e
14806d13a0b84220fa17d38bdb32559610434794
7ea849f942f7e5b02d2be9ee50e2584635cd7be4
from git://git.kernel.org/pub/scm/linux/kernel/git/jkacur/rt-tests.git
(branch rt-tests-dev)
John Kacur (3):
rt-tests: Makefile - Change FLAGS to CFLAGS
rt-tests: Makefile - Specify when a target is a PHONY target.
rt-tests: Makefile - Add a DEBUG option to the Makefile
Makefile | 31 +++++++++++++++++++++++++------
1 files changed, 25 insertions(+), 6 deletions(-)
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH 1/3] rt-tests: Makefile - Change FLAGS to CFLAGS
2009-11-16 18:40 [PATCH 0/3] rt-tests: Makefile changes John Kacur
@ 2009-11-16 18:40 ` John Kacur
2009-11-16 18:40 ` [PATCH 2/3] rt-tests: Makefile - Specify when a target is a PHONY target John Kacur
0 siblings, 1 reply; 4+ messages in thread
From: John Kacur @ 2009-11-16 18:40 UTC (permalink / raw)
To: Clark Williams; +Cc: John Kacur, rt-users
Change FLAGS to CFLAGS as this is the standard
Signed-off-by: John Kacur <jkacur@redhat.com>
---
Makefile | 12 ++++++------
1 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/Makefile b/Makefile
index 6a56a65..9685587 100644
--- a/Makefile
+++ b/Makefile
@@ -2,7 +2,7 @@ VERSION_STRING = 0.53
TARGETS = cyclictest signaltest classic_pi pi_stress \
hwlatdetect rt-migrate-test
-FLAGS = -Wall -Wno-nonnull -O2
+CFLAGS = -Wall -Wno-nonnull -O2
LIBS = -lpthread -lrt
DESTDIR ?=
prefix ?= /usr/local
@@ -12,23 +12,23 @@ mandir ?= $(prefix)/share/man/man8
all: $(TARGETS)
cyclictest: src/cyclictest/cyclictest.c
- $(CC) $(FLAGS) -D VERSION_STRING=$(VERSION_STRING) $^ -o $@ $(LIBS)
+ $(CC) $(CFLAGS) -D VERSION_STRING=$(VERSION_STRING) $^ -o $@ $(LIBS)
signaltest: src/signaltest/signaltest.c
- $(CC) $(FLAGS) -D VERSION_STRING=$(VERSION_STRING) $^ -o $@ $(LIBS)
+ $(CC) $(CFLAGS) -D VERSION_STRING=$(VERSION_STRING) $^ -o $@ $(LIBS)
classic_pi: src/pi_tests/classic_pi.c
- $(CC) $(FLAGS) -D_GNU_SOURCE -D VERSION_STRING=\"$(VERSION_STRING)\" $^ -o $@ $(LIBS)
+ $(CC) $(CFLAGS) -D_GNU_SOURCE -D VERSION_STRING=\"$(VERSION_STRING)\" $^ -o $@ $(LIBS)
pi_stress: src/pi_tests/pi_stress.c
- $(CC) $(FLAGS) -D_GNU_SOURCE -D VERSION_STRING=\"$(VERSION_STRING)\" $^ -o $@ $(LIBS)
+ $(CC) $(CFLAGS) -D_GNU_SOURCE -D VERSION_STRING=\"$(VERSION_STRING)\" $^ -o $@ $(LIBS)
hwlatdetect: src/hwlatdetect/hwlatdetect.py
chmod +x src/hwlatdetect/hwlatdetect.py
ln -s src/hwlatdetect/hwlatdetect.py hwlatdetect
rt-migrate-test: src/rt-migrate-test/rt-migrate-test.c
- $(CC) $(FLAGS) -D_GNU_SOURCE -D VERSION_STRING=\"$(VERSION_STRING)\" $^ -o $@ $(LIBS)
+ $(CC) $(CFLAGS) -D_GNU_SOURCE -D VERSION_STRING=\"$(VERSION_STRING)\" $^ -o $@ $(LIBS)
CLEANUP = $(TARGETS) *.o .depend *.*~ *.orig *.rej rt-tests.spec
CLEANUP += $(if $(wildcard .git), ChangeLog)
--
1.6.2.5
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH 2/3] rt-tests: Makefile - Specify when a target is a PHONY target.
2009-11-16 18:40 ` [PATCH 1/3] rt-tests: Makefile - Change FLAGS to CFLAGS John Kacur
@ 2009-11-16 18:40 ` John Kacur
2009-11-16 18:40 ` [PATCH 3/3] rt-tests: Makefile - Add a DEBUG option to the Makefile John Kacur
0 siblings, 1 reply; 4+ messages in thread
From: John Kacur @ 2009-11-16 18:40 UTC (permalink / raw)
To: Clark Williams; +Cc: John Kacur, rt-users
Signed-off-by: John Kacur: <jkacur@redhat.com>
---
Makefile | 13 +++++++++++++
1 files changed, 13 insertions(+), 0 deletions(-)
diff --git a/Makefile b/Makefile
index 9685587..96c7bca 100644
--- a/Makefile
+++ b/Makefile
@@ -9,6 +9,7 @@ prefix ?= /usr/local
bindir ?= $(prefix)/bin
mandir ?= $(prefix)/share/man/man8
+.PHONY: all
all: $(TARGETS)
cyclictest: src/cyclictest/cyclictest.c
@@ -33,16 +34,20 @@ rt-migrate-test: src/rt-migrate-test/rt-migrate-test.c
CLEANUP = $(TARGETS) *.o .depend *.*~ *.orig *.rej rt-tests.spec
CLEANUP += $(if $(wildcard .git), ChangeLog)
+.PHONY: clean
clean:
for F in $(CLEANUP); do find -type f -name $$F | xargs rm -f; done
rm -f hwlatdetect
+.PHONY: distclean
distclean: clean
rm -rf BUILD RPMS SRPMS releases *.tar.gz rt-tests.spec
+.PHONY: changelog
changelog:
git log >ChangeLog
+.PHONY: all
install: all
mkdir -p "$(DESTDIR)$(bindir)" "$(DESTDIR)$(mandir)"
cp $(TARGETS) "$(DESTDIR)$(bindir)"
@@ -50,6 +55,7 @@ install: all
gzip src/pi_tests/pi_stress.8 -c >"$(DESTDIR)$(mandir)/pi_stress.8.gz"
gzip src/hwlatdetect/hwlatdetect.8 -c >"$(DESTDIR)$(mandir)/hwlatdetect.8.gz"
+.PHONY: release
release: clean changelog
mkdir -p releases
rm -rf tmp && mkdir -p tmp/rt-tests
@@ -58,12 +64,16 @@ release: clean changelog
rm -f ChangeLog
cp rt-tests-$(VERSION_STRING).tar.gz releases
+.PHONY: push
push: release
scripts/do-git-push $(VERSION_STRING)
+.PHONY: pushtest
pushtest: release
scripts/do-git-push --test $(VERSION_STRING)
+# Note although rt-tests.spec is a file, it is okay to remake it every time.
+.PHONY: rt-tests.spec
rt-tests.spec: Makefile rt-tests.spec-in
sed s/__VERSION__/$(VERSION_STRING)/ <$@-in >$@
@@ -72,14 +82,17 @@ RPMARGS := --define "_topdir $(HERE)" \
--define "_sourcedir $(HERE)/releases" \
--define "_builddir $(HERE)/BUILD" \
+.PHONY: rpm
rpm: rpmdirs release rt-tests.spec
rpmbuild -ba $(RPMARGS) rt-tests.spec
+.PHONY: rpmdirs
rpmdirs:
@[ -d BUILD ] || mkdir BUILD
@[ -d RPMS ] || mkdir RPMS
@[ -d SRPMS ] || mkdir SRPMS
+.PHONY: help
help:
@echo ""
@echo " rt-tests useful Makefile targets:"
--
1.6.2.5
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH 3/3] rt-tests: Makefile - Add a DEBUG option to the Makefile
2009-11-16 18:40 ` [PATCH 2/3] rt-tests: Makefile - Specify when a target is a PHONY target John Kacur
@ 2009-11-16 18:40 ` John Kacur
0 siblings, 0 replies; 4+ messages in thread
From: John Kacur @ 2009-11-16 18:40 UTC (permalink / raw)
To: Clark Williams; +Cc: John Kacur, rt-users
This allows you to do
make DEBUG=0
which changes CFLAGS from -Wall -Wno-nonnull -O2
to -Wall -Wno-nonnull -O0 -g
Signed-off-by: John Kacur <jkacur@redhat.com>
---
Makefile | 8 +++++++-
1 files changed, 7 insertions(+), 1 deletions(-)
diff --git a/Makefile b/Makefile
index 96c7bca..7414a68 100644
--- a/Makefile
+++ b/Makefile
@@ -2,13 +2,19 @@ VERSION_STRING = 0.53
TARGETS = cyclictest signaltest classic_pi pi_stress \
hwlatdetect rt-migrate-test
-CFLAGS = -Wall -Wno-nonnull -O2
LIBS = -lpthread -lrt
DESTDIR ?=
prefix ?= /usr/local
bindir ?= $(prefix)/bin
mandir ?= $(prefix)/share/man/man8
+CFLAGS = -Wall -Wno-nonnull
+ifndef DEBUG
+ CFLAGS += -O2
+else
+ CFLAGS += -O0 -g
+endif
+
.PHONY: all
all: $(TARGETS)
--
1.6.2.5
^ permalink raw reply related [flat|nested] 4+ messages in thread
end of thread, other threads:[~2009-11-16 18:40 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-11-16 18:40 [PATCH 0/3] rt-tests: Makefile changes John Kacur
2009-11-16 18:40 ` [PATCH 1/3] rt-tests: Makefile - Change FLAGS to CFLAGS John Kacur
2009-11-16 18:40 ` [PATCH 2/3] rt-tests: Makefile - Specify when a target is a PHONY target John Kacur
2009-11-16 18:40 ` [PATCH 3/3] rt-tests: Makefile - Add a DEBUG option to the Makefile John Kacur
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).