Makefile 1021 B

123456789101112131415161718192021222324252627282930
  1. # SPDX-License-Identifier: GPL-2.0+ OR MIT
  2. CFLAGS += -O2 -Wall -g -I./ -I../../../../usr/include/ -L./ -Wl,-rpath=./
  3. LDLIBS += -lpthread
  4. # Own dependencies because we only want to build against 1st prerequisite, but
  5. # still track changes to header files and depend on shared object.
  6. OVERRIDE_TARGETS = 1
  7. TEST_GEN_PROGS = basic_test basic_percpu_ops_test param_test \
  8. param_test_benchmark param_test_compare_twice
  9. TEST_GEN_PROGS_EXTENDED = librseq.so
  10. TEST_PROGS = run_param_test.sh
  11. include ../lib.mk
  12. $(OUTPUT)/librseq.so: rseq.c rseq.h rseq-*.h
  13. $(CC) $(CFLAGS) -shared -fPIC $< $(LDLIBS) -o $@
  14. $(OUTPUT)/%: %.c $(TEST_GEN_PROGS_EXTENDED) rseq.h rseq-*.h
  15. $(CC) $(CFLAGS) $< $(LDLIBS) -lrseq -o $@
  16. $(OUTPUT)/param_test_benchmark: param_test.c $(TEST_GEN_PROGS_EXTENDED) \
  17. rseq.h rseq-*.h
  18. $(CC) $(CFLAGS) -DBENCHMARK $< $(LDLIBS) -lrseq -o $@
  19. $(OUTPUT)/param_test_compare_twice: param_test.c $(TEST_GEN_PROGS_EXTENDED) \
  20. rseq.h rseq-*.h
  21. $(CC) $(CFLAGS) -DRSEQ_COMPARE_TWICE $< $(LDLIBS) -lrseq -o $@