selftests/timers: Cleanup Makefile to make it easier to add future tests
authorJohn Stultz <john.stultz@linaro.org>
Thu, 12 Mar 2015 00:39:57 +0000 (17:39 -0700)
committerShuah Khan <shuahkh@osg.samsung.com>
Thu, 12 Mar 2015 19:22:12 +0000 (13:22 -0600)
Try to streamline the makefile so its easier to add timer/timekeeping
tests.

Also adds support for the CROSS_COMPILE variable.

Cc: Shuah Khan <shuahkh@osg.samsung.com>
Cc: Prarit Bhargava <prarit@redhat.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Richard Cochran <richardcochran@gmail.com>
Signed-off-by: John Stultz <john.stultz@linaro.org>
Tested-by: Prarit Bhargava <prarit@redhat.com>
Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com>
tools/testing/selftests/timers/Makefile

index eb2859f..e65c543 100644 (file)
@@ -1,8 +1,13 @@
-all:
-       gcc posix_timers.c -o posix_timers -lrt
+CC = $(CROSS_COMPILE)gcc
+BUILD_FLAGS = -DKTEST
+CFLAGS += -O3 -Wl,-no-as-needed -Wall $(BUILD_FLAGS)
+LDFLAGS += -lrt -lpthread
+bins = posix_timers
+
+all: ${bins}
 
 run_tests: all
        ./posix_timers
 
 clean:
-       rm -f ./posix_timers
+       rm -f ${bins}