selftests/timers: Cleanup Makefile to make it easier to add future tests
[cascardo/linux.git] / 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}