1# SPDX-License-Identifier: GPL-2.0
2CFLAGS = -Wall
3CFLAGS += -Wno-nonnull
4CFLAGS += -D_GNU_SOURCE
5
6TEST_PROGS := binfmt_script non-regular
7TEST_GEN_PROGS := execveat
8TEST_GEN_FILES := execveat.symlink execveat.denatured script subdir pipe
9# Makefile is a run-time dependency, since it's accessed by the execveat test
10TEST_FILES := Makefile
11
12TEST_GEN_PROGS += recursion-depth
13
14EXTRA_CLEAN := $(OUTPUT)/subdir.moved $(OUTPUT)/execveat.moved $(OUTPUT)/xxxxx*	\
15	       $(OUTPUT)/S_I*.test
16
17include ../lib.mk
18
19$(OUTPUT)/subdir:
20	mkdir -p $@
21$(OUTPUT)/script:
22	echo '#!/bin/sh' > $@
23	echo 'exit $$*' >> $@
24	chmod +x $@
25$(OUTPUT)/execveat.symlink: $(OUTPUT)/execveat
26	cd $(OUTPUT) && ln -s -f $(shell basename $<) $(shell basename $@)
27$(OUTPUT)/execveat.denatured: $(OUTPUT)/execveat
28	cp $< $@
29	chmod -x $@
30
31