Merge tag 'ntb-5.11' of git://github.com/jonmason/ntb
[linux/fpc-iii.git] / tools / lib / perf / tests / Makefile
blob96841775feaf2b6d697963e96c955e37fcfceea0
1 # SPDX-License-Identifier: (LGPL-2.1 OR BSD-2-Clause)
3 TESTS = test-cpumap test-threadmap test-evlist test-evsel
5 TESTS_SO := $(addsuffix -so,$(TESTS))
6 TESTS_A := $(addsuffix -a,$(TESTS))
8 # Set compile option CFLAGS
9 ifdef EXTRA_CFLAGS
10 CFLAGS := $(EXTRA_CFLAGS)
11 else
12 CFLAGS := -g -Wall
13 endif
15 all:
17 include $(srctree)/tools/scripts/Makefile.include
19 INCLUDE = -I$(srctree)/tools/lib/perf/include -I$(srctree)/tools/include -I$(srctree)/tools/lib
21 $(TESTS_A): FORCE
22 $(QUIET_LINK)$(CC) $(INCLUDE) $(CFLAGS) -o $@ $(subst -a,.c,$@) ../libperf.a $(LIBAPI)
24 $(TESTS_SO): FORCE
25 $(QUIET_LINK)$(CC) $(INCLUDE) $(CFLAGS) -L.. -o $@ $(subst -so,.c,$@) $(LIBAPI) -lperf
27 all: $(TESTS_A) $(TESTS_SO)
29 run:
30 @echo "running static:"
31 @for i in $(TESTS_A); do ./$$i; done
32 @echo "running dynamic:"
33 @for i in $(TESTS_SO); do LD_LIBRARY_PATH=../ ./$$i; done
35 clean:
36 $(call QUIET_CLEAN, tests)$(RM) $(TESTS_A) $(TESTS_SO)
38 .PHONY: all clean FORCE