Back to home page

OSCL-LXR

 
 

    


0001 # SPDX-License-Identifier: GPL-2.0
0002 CFLAGS += -O2 -g -std=gnu89 -pthread -Wall -Wextra
0003 CFLAGS += -I../../../../usr/include/
0004 LDFLAGS += -pthread
0005 
0006 .PHONY: all clean
0007 
0008 include ../lib.mk
0009 
0010 # lib.mk TEST_CUSTOM_PROGS var is for custom tests that need special
0011 # build rules. lib.mk will run and install them.
0012 
0013 TEST_CUSTOM_PROGS := $(OUTPUT)/sync_test
0014 all: $(TEST_CUSTOM_PROGS)
0015 
0016 OBJS = sync_test.o sync.o
0017 
0018 TESTS += sync_alloc.o
0019 TESTS += sync_fence.o
0020 TESTS += sync_merge.o
0021 TESTS += sync_wait.o
0022 TESTS += sync_stress_parallelism.o
0023 TESTS += sync_stress_consumer.o
0024 TESTS += sync_stress_merge.o
0025 
0026 OBJS := $(patsubst %,$(OUTPUT)/%,$(OBJS))
0027 TESTS := $(patsubst %,$(OUTPUT)/%,$(TESTS))
0028 
0029 $(TEST_CUSTOM_PROGS): $(TESTS) $(OBJS)
0030         $(CC) -o $(TEST_CUSTOM_PROGS) $(OBJS) $(TESTS) $(CFLAGS) $(LDFLAGS)
0031 
0032 $(OBJS): $(OUTPUT)/%.o: %.c
0033         $(CC) -c $^ -o $@ $(CFLAGS)
0034 
0035 $(TESTS): $(OUTPUT)/%.o: %.c
0036         $(CC) -c $^ -o $@
0037 
0038 EXTRA_CLEAN := $(TEST_CUSTOM_PROGS) $(OBJS) $(TESTS)