Makefile 763 B

1234567891011121314151617181920212223242526
  1. # SPDX-License-Identifier: GPL-2.0
  2. TEST_GEN_PROGS := nolibc-test libc-test
  3. include ../lib.mk
  4. include $(top_srcdir)/scripts/Makefile.compiler
  5. cc-option = $(call __cc-option, $(CC),,$(1),$(2))
  6. include Makefile.include
  7. $(OUTPUT)/nolibc-test: CFLAGS = -nostdlib -nostdinc -static \
  8. -isystem $(top_srcdir)/tools/include/nolibc -isystem $(top_srcdir)/usr/include \
  9. $(CFLAGS_NOLIBC_TEST)
  10. $(OUTPUT)/nolibc-test: LDLIBS = $(if $(LLVM),,-lgcc)
  11. $(OUTPUT)/nolibc-test: nolibc-test.c nolibc-test-linkage.c | headers
  12. $(OUTPUT)/libc-test: nolibc-test.c nolibc-test-linkage.c
  13. $(call msg,CC,,$@)
  14. $(Q)$(LINK.c) $^ -o $@
  15. help:
  16. @echo "For the custom nolibc testsuite use '$(MAKE) -f Makefile.nolibc'; available targets:"
  17. @$(MAKE) -f Makefile.nolibc help
  18. .PHONY: help