Makefile (38f7251852a0cd47f34af4a6f84df0fadafa8ac7) | Makefile (b2fc6ade9fe2118591e7f51e21b51f65e36f138f) |
---|---|
1CFLAGS += -O2 -g -std=gnu89 -pthread -Wall -Wextra 2CFLAGS += -I../../../../usr/include/ 3LDFLAGS += -pthread 4 | 1CFLAGS += -O2 -g -std=gnu89 -pthread -Wall -Wextra 2CFLAGS += -I../../../../usr/include/ 3LDFLAGS += -pthread 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) 10 | 13all: $(TEST_CUSTOM_PROGS) 14 |
11include ../lib.mk 12 | |
13OBJS = sync_test.o sync.o 14 15TESTS += sync_alloc.o 16TESTS += sync_fence.o 17TESTS += sync_merge.o 18TESTS += sync_wait.o 19TESTS += sync_stress_parallelism.o 20TESTS += sync_stress_consumer.o 21TESTS += sync_stress_merge.o 22 | 15OBJS = sync_test.o sync.o 16 17TESTS += sync_alloc.o 18TESTS += sync_fence.o 19TESTS += sync_merge.o 20TESTS += sync_wait.o 21TESTS += sync_stress_parallelism.o 22TESTS += sync_stress_consumer.o 23TESTS += sync_stress_merge.o 24 |
23sync_test: $(OBJS) $(TESTS) | 25OBJS := $(patsubst %,$(OUTPUT)/%,$(OBJS)) 26TESTS := $(patsubst %,$(OUTPUT)/%,$(TESTS)) |
24 | 27 |
25EXTRA_CLEAN := sync_test $(OBJS) $(TESTS) | 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 37EXTRA_CLEAN := $(TEST_CUSTOM_PROGS) $(OBJS) $(TESTS) |