xref: /linux/tools/tracing/rtla/tests/unit/Makefile.unit (revision 9e1e9d660255d7216067193d774f338d08d8528d)
1# SPDX-License-Identifier: GPL-2.0-only
2
3UNIT_TESTS := $(OUTPUT)unit_tests
4UNIT_TESTS_IN := $(UNIT_TESTS)-in.o
5
6$(UNIT_TESTS): $(UNIT_TESTS_IN)
7	$(QUIET_LINK)$(CC) $(LDFLAGS) -o $@ $^ -lcheck
8
9$(UNIT_TESTS_IN):
10	make $(build)=unit_tests
11
12unit-tests: FORCE
13	$(Q)if [ "$(feature-libcheck)" = "1" ]; then \
14		$(MAKE) $(UNIT_TESTS) && $(UNIT_TESTS); \
15	else \
16		echo "libcheck is missing, skipping unit tests. Please install check-devel/check"; \
17	fi
18