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