Files
kernel/tools/testing/selftests/exec/Makefile
T

29 lines
726 B
Makefile
Raw Normal View History

# SPDX-License-Identifier: GPL-2.0
2014-12-12 16:57:36 -08:00
CFLAGS = -Wall
2019-05-14 15:44:43 -07:00
CFLAGS += -Wno-nonnull
CFLAGS += -D_GNU_SOURCE
2014-12-12 16:57:36 -08:00
2016-11-29 19:55:51 +08:00
TEST_GEN_PROGS := execveat
TEST_GEN_FILES := execveat.symlink execveat.denatured script subdir
# Makefile is a run-time dependency, since it's accessed by the execveat test
TEST_FILES := Makefile
2019-05-14 15:44:43 -07:00
TEST_GEN_PROGS += recursion-depth
2016-11-29 19:55:52 +08:00
EXTRA_CLEAN := $(OUTPUT)/subdir.moved $(OUTPUT)/execveat.moved $(OUTPUT)/xxxxx*
2016-11-29 19:55:51 +08:00
include ../lib.mk
2016-11-29 19:55:52 +08:00
$(OUTPUT)/subdir:
2014-12-12 16:57:36 -08:00
mkdir -p $@
2016-11-29 19:55:52 +08:00
$(OUTPUT)/script:
2014-12-12 16:57:36 -08:00
echo '#!/bin/sh' > $@
echo 'exit $$*' >> $@
chmod +x $@
2016-11-29 19:55:52 +08:00
$(OUTPUT)/execveat.symlink: $(OUTPUT)/execveat
cd $(OUTPUT) && ln -s -f $(shell basename $<) $(shell basename $@)
$(OUTPUT)/execveat.denatured: $(OUTPUT)/execveat
2014-12-12 16:57:36 -08:00
cp $< $@
chmod -x $@
2016-11-29 19:55:52 +08:00