2009-07-05 22:14:57 +01:00
|
|
|
VERSION_STRING = 0.47
|
2007-12-12 10:56:05 +00:00
|
|
|
|
2009-06-10 19:50:02 +01:00
|
|
|
TARGETS = cyclictest signaltest classic_pi pi_stress hwlatdetect
|
2007-12-14 14:23:51 +00:00
|
|
|
FLAGS = -Wall -Wno-nonnull -O2
|
|
|
|
LIBS = -lpthread -lrt
|
2009-05-02 19:25:53 +01:00
|
|
|
DESTDIR ?=
|
|
|
|
prefix ?= /usr/local
|
|
|
|
bindir ?= $(prefix)/bin
|
|
|
|
mandir ?= $(prefix)/share/man/man8
|
2007-12-12 09:20:17 +00:00
|
|
|
|
2008-01-03 19:26:22 +00:00
|
|
|
all: $(TARGETS)
|
2007-12-12 09:20:17 +00:00
|
|
|
|
|
|
|
cyclictest: src/cyclictest/cyclictest.c
|
2007-12-14 14:23:51 +00:00
|
|
|
$(CC) $(FLAGS) -D VERSION_STRING=$(VERSION_STRING) $^ -o $@ $(LIBS)
|
2007-12-12 09:20:17 +00:00
|
|
|
|
|
|
|
signaltest: src/signaltest/signaltest.c
|
2007-12-14 14:23:51 +00:00
|
|
|
$(CC) $(FLAGS) -D VERSION_STRING=$(VERSION_STRING) $^ -o $@ $(LIBS)
|
2007-12-12 09:20:17 +00:00
|
|
|
|
2008-01-03 19:26:22 +00:00
|
|
|
classic_pi: src/pi_tests/classic_pi.c
|
|
|
|
$(CC) $(FLAGS) -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)
|
|
|
|
|
2009-06-10 19:50:02 +01:00
|
|
|
hwlatdetect: src/hwlatdetect/hwlatdetect.py
|
2009-06-11 05:32:41 +01:00
|
|
|
chmod +x src/hwlatdetect/hwlatdetect.py
|
|
|
|
ln -s src/hwlatdetect/hwlatdetect.py hwlatdetect
|
2009-05-13 19:57:11 +01:00
|
|
|
|
2009-03-17 20:50:42 +00:00
|
|
|
CLEANUP = $(TARGETS) *.o .depend *.*~ *.orig *.rej rt-tests.spec
|
|
|
|
CLEANUP += $(if $(wildcard .git), ChangeLog)
|
2008-01-03 19:26:22 +00:00
|
|
|
|
2007-12-12 09:20:17 +00:00
|
|
|
clean:
|
2008-12-11 16:13:07 +00:00
|
|
|
for F in $(CLEANUP); do find -type f -name $$F | xargs rm -f; done
|
2009-06-12 19:15:45 +01:00
|
|
|
rm -f hwlatdetect
|
2007-12-12 09:20:17 +00:00
|
|
|
|
2008-01-03 19:33:23 +00:00
|
|
|
distclean: clean
|
2009-06-10 19:53:18 +01:00
|
|
|
rm -rf BUILD RPMS SRPMS releases *.tar.gz rt-tests.spec
|
2008-01-03 19:33:23 +00:00
|
|
|
|
2007-12-14 14:23:51 +00:00
|
|
|
changelog:
|
|
|
|
git log >ChangeLog
|
|
|
|
|
|
|
|
install: all
|
2009-04-07 21:01:57 +01:00
|
|
|
mkdir -p "$(DESTDIR)$(bindir)" "$(DESTDIR)$(mandir)"
|
|
|
|
cp $(TARGETS) "$(DESTDIR)$(bindir)"
|
|
|
|
gzip src/cyclictest/cyclictest.8 -c >"$(DESTDIR)$(mandir)/cyclictest.8.gz"
|
|
|
|
gzip src/pi_tests/pi_stress.8 -c >"$(DESTDIR)$(mandir)/pi_stress.8.gz"
|
2009-06-10 19:50:02 +01:00
|
|
|
gzip src/hwlatdetect/hwlatdetect.8 -c >"$(DESTDIR)$(mandir)/hwlatdetect.8.gz"
|
2007-12-14 14:23:51 +00:00
|
|
|
|
|
|
|
release: clean changelog
|
|
|
|
mkdir -p releases
|
2008-10-22 21:00:57 +01:00
|
|
|
rm -rf tmp && 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
|
2007-12-14 14:23:51 +00:00
|
|
|
rm -f ChangeLog
|
2009-04-07 21:31:32 +01:00
|
|
|
cp rt-tests-$(VERSION_STRING).tar.gz releases
|
2008-01-03 19:26:22 +00:00
|
|
|
|
2008-06-05 01:12:40 +01:00
|
|
|
rt-tests.spec: Makefile rt-tests.spec-in
|
|
|
|
sed s/__VERSION__/$(VERSION_STRING)/ <$@-in >$@
|
|
|
|
|
2008-01-03 19:26:22 +00:00
|
|
|
HERE := $(shell pwd)
|
|
|
|
RPMARGS := --define "_topdir $(HERE)" \
|
|
|
|
--define "_sourcedir $(HERE)/releases" \
|
|
|
|
--define "_builddir $(HERE)/BUILD" \
|
|
|
|
|
2008-07-28 11:45:20 +01:00
|
|
|
rpm: rpmdirs release rt-tests.spec
|
2008-01-03 19:26:22 +00:00
|
|
|
rpmbuild -ba $(RPMARGS) rt-tests.spec
|
|
|
|
|
|
|
|
rpmdirs:
|
|
|
|
@[ -d BUILD ] || mkdir BUILD
|
|
|
|
@[ -d RPMS ] || mkdir RPMS
|
|
|
|
@[ -d SRPMS ] || mkdir SRPMS
|
2009-07-02 15:36:52 +01:00
|
|
|
|
|
|
|
help:
|
|
|
|
@echo ""
|
|
|
|
@echo " rt-tests useful Makefile targets:"
|
|
|
|
@echo ""
|
|
|
|
@echo " all : build all tests (default"
|
|
|
|
@echo " install : install tests to local filesystem"
|
|
|
|
@echo " release : build source tarfile"
|
|
|
|
@echo " rpm : build RPM package"
|
|
|
|
@echo " clean : remove object files"
|
|
|
|
@echo " distclean : remove all generated files"
|
|
|
|
@echo " help : print this message"
|