Makefile 993 B

123456789101112131415161718192021222324252627
  1. # SPDX-License-Identifier: GPL-2.0
  2. # Copyright (C) 2019 ARM Limited
  3. # Additional include paths needed by kselftest.h and local headers
  4. CFLAGS += -D_GNU_SOURCE -std=gnu99 -I.
  5. SRCS := $(filter-out testcases/testcases.c,$(wildcard testcases/*.c))
  6. PROGS := $(patsubst %.c,%,$(SRCS))
  7. # Generated binaries to be installed by top KSFT script
  8. TEST_GEN_PROGS := $(notdir $(PROGS))
  9. # Get Kernel headers installed and use them.
  10. # Including KSFT lib.mk here will also mangle the TEST_GEN_PROGS list
  11. # to account for any OUTPUT target-dirs optionally provided by
  12. # the toplevel makefile
  13. include ../../lib.mk
  14. $(TEST_GEN_PROGS): $(PROGS)
  15. cp $(PROGS) $(OUTPUT)/
  16. # Common test-unit targets to build common-layout test-cases executables
  17. # Needs secondary expansion to properly include the testcase c-file in pre-reqs
  18. .SECONDEXPANSION:
  19. $(PROGS): test_signals.c test_signals_utils.c testcases/testcases.c signals.S [email protected] test_signals.h test_signals_utils.h testcases/testcases.h
  20. $(CC) $(CFLAGS) $^ -o $@