aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile2
-rw-r--r--README4
-rw-r--r--Test.mk19
3 files changed, 19 insertions, 6 deletions
diff --git a/Makefile b/Makefile
index d76deb7..1c7bc9b 100644
--- a/Makefile
+++ b/Makefile
@@ -22,6 +22,8 @@
# - initial API and implementation
#
hotplug_allow_cpu0?=0
+
+# Build all the utils required by the tests.
all:
@(cd utils; $(MAKE))
diff --git a/README b/README
index b976727..8d1519f 100644
--- a/README
+++ b/README
@@ -1,5 +1,9 @@
Commands
========
+- If you just want to build the supporting utils for the pm-qa tests, invoke:
+
+ make
+
- In order to run the tests, invoke as root:
make check
diff --git a/Test.mk b/Test.mk
index 44f0ece..455dc3a 100644
--- a/Test.mk
+++ b/Test.mk
@@ -26,14 +26,15 @@ TST=$(sort $(wildcard *[!{sanity}].sh))
LOG=$(TST:.sh=.log)
CFLAGS?=-g -Wall -pthread
CC?=gcc
-SRC=$(wildcard *.c)
-EXEC=$(SRC:%.c=%)
-check: build_utils run_tests
+# All utils' source files.
+SRC=$(wildcard ../utils/*.c) $(wildcard ../cpuidle/*.c)
+
+# All executable files built from the utils' source files.
+EXEC=$(SRC:%.c=%)
-build_utils:
- $(CC) ../utils/uevent_reader.c -o ../utils/uevent_reader
- $(CC) ../utils/cpucycle.c -o ../utils/cpucycle
+# Build the utils and run the tests.
+build_utils: $(EXEC)
SANITY_STATUS:= $(shell if test $(SNT) && test -f $(SNT); then \
./$(SNT); if test "$$?" -eq 0; then echo 0; else \
@@ -55,9 +56,15 @@ run_tests:
# @cat $(<:.sh=.txt)
endif
+# Target for building all the utils we need, from sources.
+$(EXEC): $(SRC)
+ $(CC) $(CFLAGS) $@.c -o $@
+
clean:
rm -f *.o $(EXEC)
+check: build_utils run_tests
+
uncheck:
-@$(shell test ! -z "$(LOG)" && rm -f $(LOG))