Merge tag 'hwmon-for-linus-v4.14-rc4' of git://git.kernel.org/pub/scm/linux/kernel...
[linux-2.6-microblaze.git] / tools / testing / selftests / sync / Makefile
1 CFLAGS += -O2 -g -std=gnu89 -pthread -Wall -Wextra
2 CFLAGS += -I../../../../usr/include/
3 LDFLAGS += -pthread
4
5 .PHONY: all clean
6
7 include ../lib.mk
8
9 # lib.mk TEST_CUSTOM_PROGS var is for custom tests that need special
10 # build rules. lib.mk will run and install them.
11
12 TEST_CUSTOM_PROGS := $(OUTPUT)/sync_test
13 all: $(TEST_CUSTOM_PROGS)
14
15 OBJS = sync_test.o sync.o
16
17 TESTS += sync_alloc.o
18 TESTS += sync_fence.o
19 TESTS += sync_merge.o
20 TESTS += sync_wait.o
21 TESTS += sync_stress_parallelism.o
22 TESTS += sync_stress_consumer.o
23 TESTS += sync_stress_merge.o
24
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 $@
36
37 EXTRA_CLEAN := $(TEST_CUSTOM_PROGS) $(OBJS) $(TESTS)