aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--tools/testing/selftests/sync/Makefile24
1 files changed, 18 insertions, 6 deletions
diff --git a/tools/testing/selftests/sync/Makefile b/tools/testing/selftests/sync/Makefile
index 43db80b71e80..8e04d0afcbd7 100644
--- a/tools/testing/selftests/sync/Makefile
+++ b/tools/testing/selftests/sync/Makefile
@@ -2,14 +2,16 @@ CFLAGS += -O2 -g -std=gnu89 -pthread -Wall -Wextra
2CFLAGS += -I../../../../usr/include/ 2CFLAGS += -I../../../../usr/include/
3LDFLAGS += -pthread 3LDFLAGS += -pthread
4 4
5# lib.mk TEST_CUSTOM_PROGS var is for custome tests that need special 5.PHONY: all clean
6
7include ../lib.mk
8
9# lib.mk TEST_CUSTOM_PROGS var is for custom tests that need special
6# build rules. lib.mk will run and install them. 10# build rules. lib.mk will run and install them.
7TEST_CUSTOM_PROGS = sync_test
8 11
12TEST_CUSTOM_PROGS := $(OUTPUT)/sync_test
9all: $(TEST_CUSTOM_PROGS) 13all: $(TEST_CUSTOM_PROGS)
10 14
11include ../lib.mk
12
13OBJS = sync_test.o sync.o 15OBJS = sync_test.o sync.o
14 16
15TESTS += sync_alloc.o 17TESTS += sync_alloc.o
@@ -20,6 +22,16 @@ TESTS += sync_stress_parallelism.o
20TESTS += sync_stress_consumer.o 22TESTS += sync_stress_consumer.o
21TESTS += sync_stress_merge.o 23TESTS += sync_stress_merge.o
22 24
23sync_test: $(OBJS) $(TESTS) 25OBJS := $(patsubst %,$(OUTPUT)/%,$(OBJS))
26TESTS := $(patsubst %,$(OUTPUT)/%,$(TESTS))
27
28$(TEST_CUSTOM_PROGS): $(TESTS) $(OBJS)
29 $(CC) -o $(TEST_CUSTOM_PROGS) $(OBJS) $(TESTS) $(CFLAGS) $(LDFLAGS)
30
31$(OBJS): $(OUTPUT)/%.o: %.c
32 $(CC) -c $^ -o $@
33
34$(TESTS): $(OUTPUT)/%.o: %.c
35 $(CC) -c $^ -o $@
24 36
25EXTRA_CLEAN := sync_test $(OBJS) $(TESTS) 37EXTRA_CLEAN := $(TEST_CUSTOM_PROGS) $(OBJS) $(TESTS)