blob: 427c41ba51513617883cee81cbe943bb6c523f67 [file] [log] [blame]
Greg Kroah-Hartmanb2441312017-11-01 15:07:57 +01001# SPDX-License-Identifier: GPL-2.0
David Drysdalec9b26b82014-12-12 16:57:36 -08002CFLAGS = -Wall
David Drysdalec9b26b82014-12-12 16:57:36 -08003
bamvor.zhangjian@huawei.com80d443e82016-11-29 19:55:51 +08004TEST_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
bamvor.zhangjian@huawei.coma8ba7982016-11-29 19:55:52 +08009EXTRA_CLEAN := $(OUTPUT)/subdir.moved $(OUTPUT)/execveat.moved $(OUTPUT)/xxxxx*
bamvor.zhangjian@huawei.com80d443e82016-11-29 19:55:51 +080010
11include ../lib.mk
12
bamvor.zhangjian@huawei.coma8ba7982016-11-29 19:55:52 +080013$(OUTPUT)/subdir:
David Drysdalec9b26b82014-12-12 16:57:36 -080014 mkdir -p $@
bamvor.zhangjian@huawei.coma8ba7982016-11-29 19:55:52 +080015$(OUTPUT)/script:
David Drysdalec9b26b82014-12-12 16:57:36 -080016 echo '#!/bin/sh' > $@
17 echo 'exit $$*' >> $@
18 chmod +x $@
bamvor.zhangjian@huawei.coma8ba7982016-11-29 19:55:52 +080019$(OUTPUT)/execveat.symlink: $(OUTPUT)/execveat
20 cd $(OUTPUT) && ln -s -f $(shell basename $<) $(shell basename $@)
21$(OUTPUT)/execveat.denatured: $(OUTPUT)/execveat
David Drysdalec9b26b82014-12-12 16:57:36 -080022 cp $< $@
23 chmod -x $@
bamvor.zhangjian@huawei.coma8ba7982016-11-29 19:55:52 +080024