xref: /linux/tools/testing/selftests/nolibc/Makefile (revision 8d2b0853add1d7534dc0794e3c8e0b9e8c4ec640)
1# SPDX-License-Identifier: GPL-2.0
2
3TEST_GEN_PROGS := nolibc-test
4
5include ../lib.mk
6include $(top_srcdir)/scripts/Makefile.compiler
7
8cc-option = $(call __cc-option, $(CC),,$(1),$(2))
9
10include Makefile.include
11
12CFLAGS = -nostdlib -nostdinc -static \
13	 -isystem $(top_srcdir)/tools/include/nolibc -isystem $(top_srcdir)/usr/include \
14	 $(CFLAGS_NOLIBC_TEST)
15
16ifeq ($(LLVM),)
17LDLIBS := -lgcc
18endif
19
20$(OUTPUT)/nolibc-test: nolibc-test.c nolibc-test-linkage.c | headers
21
22help:
23	@echo "For the custom nolibc testsuite use '$(MAKE) -f Makefile.nolibc'; available targets:"
24	@$(MAKE) -f Makefile.nolibc help
25
26.PHONY: help
27