summaryrefslogtreecommitdiff
path: root/tools/tracing/rtla/tests/unit/Makefile.unit
blob: 839abda64b76ec8f6a40bf4fd4b27428e762c46d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
# SPDX-License-Identifier: GPL-2.0-only

UNIT_TESTS := $(OUTPUT)unit_tests
UNIT_TESTS_IN := $(UNIT_TESTS)-in.o

$(UNIT_TESTS): $(UNIT_TESTS_IN) $(RTLA_IN) $(LIBSUBCMD) $(LIB_STRING) $(LIB_STR_ERROR_R)
	$(QUIET_LINK)$(CC) $(LDFLAGS) -o $@ $^ $(EXTLIBS) -lcheck

$(UNIT_TESTS_IN): fixdep $(LIBSUBCMD_INCLUDES)
	make $(build)=unit_tests

unit-tests: FORCE
	$(Q)if [ "$(feature-libcheck)" = "1" ]; then \
		$(MAKE) $(UNIT_TESTS) && $(UNIT_TESTS); \
	else \
		echo "libcheck is missing, skipping unit tests. Please install check-devel/check"; \
	fi