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
10 CFLAGS
:= $(EXTRA_CFLAGS
)
17 include $(srctree
)/tools
/scripts
/Makefile.
include
19 INCLUDE
= -I
$(srctree
)/tools
/lib
/perf
/include -I
$(srctree
)/tools
/include -I
$(srctree
)/tools
/lib
22 $(QUIET_LINK
)$(CC
) $(INCLUDE
) $(CFLAGS
) -o
$@
$(subst -a
,.c
,$@
) ..
/libperf.a
$(LIBAPI
)
25 $(QUIET_LINK
)$(CC
) $(INCLUDE
) $(CFLAGS
) -L..
-o
$@
$(subst -so
,.c
,$@
) $(LIBAPI
) -lperf
27 all: $(TESTS_A
) $(TESTS_SO
)
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
36 $(call QUIET_CLEAN
, tests
)$(RM
) $(TESTS_A
) $(TESTS_SO
)
38 .PHONY
: all clean FORCE