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