diff options
-rw-r--r-- | tools/testing/selftests/sync/Makefile | 24 |
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 | |||
2 | CFLAGS += -I../../../../usr/include/ | 2 | CFLAGS += -I../../../../usr/include/ |
3 | LDFLAGS += -pthread | 3 | LDFLAGS += -pthread |
4 | 4 | ||
5 | # lib.mk TEST_CUSTOM_PROGS var is for custome tests that need special | 5 | .PHONY: all clean |
6 | |||
7 | include ../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. |
7 | TEST_CUSTOM_PROGS = sync_test | ||
8 | 11 | ||
12 | TEST_CUSTOM_PROGS := $(OUTPUT)/sync_test | ||
9 | all: $(TEST_CUSTOM_PROGS) | 13 | all: $(TEST_CUSTOM_PROGS) |
10 | 14 | ||
11 | include ../lib.mk | ||
12 | |||
13 | OBJS = sync_test.o sync.o | 15 | OBJS = sync_test.o sync.o |
14 | 16 | ||
15 | TESTS += sync_alloc.o | 17 | TESTS += sync_alloc.o |
@@ -20,6 +22,16 @@ TESTS += sync_stress_parallelism.o | |||
20 | TESTS += sync_stress_consumer.o | 22 | TESTS += sync_stress_consumer.o |
21 | TESTS += sync_stress_merge.o | 23 | TESTS += sync_stress_merge.o |
22 | 24 | ||
23 | sync_test: $(OBJS) $(TESTS) | 25 | OBJS := $(patsubst %,$(OUTPUT)/%,$(OBJS)) |
26 | TESTS := $(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 | ||
25 | EXTRA_CLEAN := sync_test $(OBJS) $(TESTS) | 37 | EXTRA_CLEAN := $(TEST_CUSTOM_PROGS) $(OBJS) $(TESTS) |