blob: 33339e31e36526b169470f56f7bf05b891891202 [file] [log] [blame]
Andrew Scullb4b6d4a2019-01-02 15:54:55 +00001# SPDX-License-Identifier: GPL-2.0
2CFLAGS = -Wall
David Brazdil0f672f62019-12-10 10:32:29 +00003CFLAGS += -Wno-nonnull
4CFLAGS += -D_GNU_SOURCE
Andrew Scullb4b6d4a2019-01-02 15:54:55 +00005
6TEST_GEN_PROGS := execveat
7TEST_GEN_FILES := execveat.symlink execveat.denatured script subdir
8# Makefile is a run-time dependency, since it's accessed by the execveat test
9TEST_FILES := Makefile
10
David Brazdil0f672f62019-12-10 10:32:29 +000011TEST_GEN_PROGS += recursion-depth
12
Andrew Scullb4b6d4a2019-01-02 15:54:55 +000013EXTRA_CLEAN := $(OUTPUT)/subdir.moved $(OUTPUT)/execveat.moved $(OUTPUT)/xxxxx*
14
15include ../lib.mk
16
17$(OUTPUT)/subdir:
18 mkdir -p $@
19$(OUTPUT)/script:
20 echo '#!/bin/sh' > $@
21 echo 'exit $$*' >> $@
22 chmod +x $@
23$(OUTPUT)/execveat.symlink: $(OUTPUT)/execveat
24 cd $(OUTPUT) && ln -s -f $(shell basename $<) $(shell basename $@)
25$(OUTPUT)/execveat.denatured: $(OUTPUT)/execveat
26 cp $< $@
27 chmod -x $@
28