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