diff options
author | Luis Machado <luis.machado@linaro.org> | 2019-01-11 15:52:49 -0200 |
---|---|---|
committer | Lisa Nguyen <lisa.nguyen@linaro.org> | 2019-01-13 15:02:24 -0800 |
commit | e7c1883f618628de95c67070e8d58bc15d546b34 (patch) | |
tree | da55eacaf878c133e3ec81bebf3cfb10fbb87768 | |
parent | c0a72abc630bc4a4f018d93c1c050446f0ecff06 (diff) | |
download | pm-qa-e7c1883f618628de95c67070e8d58bc15d546b34.tar.gz |
Make the default target only build the utils
The following patch adjusts the main Makefile and secondary Makefile
(Test.mk) so the default target only builds the pm-qa utils from sources,
without running the tests.
Also document some variables and targets.
2018-01-11 Luis Machado <luis.machado@linaro.org>
* Makefile: Document target "all".
* README: Document how to build only the pm-qa utils.
* Test.mk: Document misc variables and targets.
(SRC): Hold list of all utils' .c files.
($(EXEC)): New target to build all utils from sources.
(check): Move target closer to uncheck target.
Signed-off-by: Luis Machado <luis.machado@linaro.org>
-rw-r--r-- | Makefile | 2 | ||||
-rw-r--r-- | README | 4 | ||||
-rw-r--r-- | Test.mk | 19 |
3 files changed, 19 insertions, 6 deletions
@@ -22,6 +22,8 @@ # - initial API and implementation # hotplug_allow_cpu0?=0 + +# Build all the utils required by the tests. all: @(cd utils; $(MAKE)) @@ -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 @@ -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)) |