Makefile 644 B

123456789101112131415161718192021222324
  1. # SPDX-License-Identifier: GPL-2.0
  2. CFLAGS = -Wall
  3. TEST_GEN_PROGS := execveat
  4. TEST_GEN_FILES := execveat.symlink execveat.denatured script subdir
  5. # Makefile is a run-time dependency, since it's accessed by the execveat test
  6. TEST_FILES := Makefile
  7. EXTRA_CLEAN := $(OUTPUT)/subdir.moved $(OUTPUT)/execveat.moved $(OUTPUT)/xxxxx*
  8. include ../lib.mk
  9. $(OUTPUT)/subdir:
  10. mkdir -p $@
  11. $(OUTPUT)/script:
  12. echo '#!/bin/sh' > $@
  13. echo 'exit $$*' >> $@
  14. chmod +x $@
  15. $(OUTPUT)/execveat.symlink: $(OUTPUT)/execveat
  16. cd $(OUTPUT) && ln -s -f $(shell basename $<) $(shell basename $@)
  17. $(OUTPUT)/execveat.denatured: $(OUTPUT)/execveat
  18. cp $< $@
  19. chmod -x $@