Back to home page

OSCL-LXR

 
 

    


0001 # SPDX-License-Identifier: GPL-2.0+ OR MIT
0002 
0003 ifneq ($(shell $(CC) --version 2>&1 | head -n 1 | grep clang),)
0004 CLANG_FLAGS += -no-integrated-as
0005 endif
0006 
0007 CFLAGS += -O2 -Wall -g -I./ -I../../../../usr/include/ -L$(OUTPUT) -Wl,-rpath=./ \
0008           $(CLANG_FLAGS)
0009 LDLIBS += -lpthread -ldl
0010 
0011 # Own dependencies because we only want to build against 1st prerequisite, but
0012 # still track changes to header files and depend on shared object.
0013 OVERRIDE_TARGETS = 1
0014 
0015 TEST_GEN_PROGS = basic_test basic_percpu_ops_test param_test \
0016                 param_test_benchmark param_test_compare_twice
0017 
0018 TEST_GEN_PROGS_EXTENDED = librseq.so
0019 
0020 TEST_PROGS = run_param_test.sh
0021 
0022 TEST_FILES := settings
0023 
0024 include ../lib.mk
0025 
0026 $(OUTPUT)/librseq.so: rseq.c rseq.h rseq-*.h
0027         $(CC) $(CFLAGS) -shared -fPIC $< $(LDLIBS) -o $@
0028 
0029 $(OUTPUT)/%: %.c $(TEST_GEN_PROGS_EXTENDED) rseq.h rseq-*.h
0030         $(CC) $(CFLAGS) $< $(LDLIBS) -lrseq -o $@
0031 
0032 $(OUTPUT)/param_test_benchmark: param_test.c $(TEST_GEN_PROGS_EXTENDED) \
0033                                         rseq.h rseq-*.h
0034         $(CC) $(CFLAGS) -DBENCHMARK $< $(LDLIBS) -lrseq -o $@
0035 
0036 $(OUTPUT)/param_test_compare_twice: param_test.c $(TEST_GEN_PROGS_EXTENDED) \
0037                                         rseq.h rseq-*.h
0038         $(CC) $(CFLAGS) -DRSEQ_COMPARE_TWICE $< $(LDLIBS) -lrseq -o $@