Greg Kroah-Hartman | b244131 | 2017-11-01 15:07:57 +0100 | [diff] [blame] | 1 | # SPDX-License-Identifier: GPL-2.0 |
David Drysdale | c9b26b8 | 2014-12-12 16:57:36 -0800 | [diff] [blame] | 2 | CFLAGS = -Wall |
Alexey Dobriyan | 4e7301e | 2019-05-14 15:44:43 -0700 | [diff] [blame] | 3 | CFLAGS += -Wno-nonnull |
| 4 | CFLAGS += -D_GNU_SOURCE |
David Drysdale | c9b26b8 | 2014-12-12 16:57:36 -0800 | [diff] [blame] | 5 | |
bamvor.zhangjian@huawei.com | 80d443e8 | 2016-11-29 19:55:51 +0800 | [diff] [blame] | 6 | TEST_GEN_PROGS := execveat |
| 7 | TEST_GEN_FILES := execveat.symlink execveat.denatured script subdir |
| 8 | # Makefile is a run-time dependency, since it's accessed by the execveat test |
| 9 | TEST_FILES := Makefile |
| 10 | |
Alexey Dobriyan | 4e7301e | 2019-05-14 15:44:43 -0700 | [diff] [blame] | 11 | TEST_GEN_PROGS += recursion-depth |
| 12 | |
bamvor.zhangjian@huawei.com | a8ba798 | 2016-11-29 19:55:52 +0800 | [diff] [blame] | 13 | EXTRA_CLEAN := $(OUTPUT)/subdir.moved $(OUTPUT)/execveat.moved $(OUTPUT)/xxxxx* |
bamvor.zhangjian@huawei.com | 80d443e8 | 2016-11-29 19:55:51 +0800 | [diff] [blame] | 14 | |
| 15 | include ../lib.mk |
| 16 | |
bamvor.zhangjian@huawei.com | a8ba798 | 2016-11-29 19:55:52 +0800 | [diff] [blame] | 17 | $(OUTPUT)/subdir: |
David Drysdale | c9b26b8 | 2014-12-12 16:57:36 -0800 | [diff] [blame] | 18 | mkdir -p $@ |
bamvor.zhangjian@huawei.com | a8ba798 | 2016-11-29 19:55:52 +0800 | [diff] [blame] | 19 | $(OUTPUT)/script: |
David Drysdale | c9b26b8 | 2014-12-12 16:57:36 -0800 | [diff] [blame] | 20 | echo '#!/bin/sh' > $@ |
| 21 | echo 'exit $$*' >> $@ |
| 22 | chmod +x $@ |
bamvor.zhangjian@huawei.com | a8ba798 | 2016-11-29 19:55:52 +0800 | [diff] [blame] | 23 | $(OUTPUT)/execveat.symlink: $(OUTPUT)/execveat |
| 24 | cd $(OUTPUT) && ln -s -f $(shell basename $<) $(shell basename $@) |
| 25 | $(OUTPUT)/execveat.denatured: $(OUTPUT)/execveat |
David Drysdale | c9b26b8 | 2014-12-12 16:57:36 -0800 | [diff] [blame] | 26 | cp $< $@ |
| 27 | chmod -x $@ |
bamvor.zhangjian@huawei.com | a8ba798 | 2016-11-29 19:55:52 +0800 | [diff] [blame] | 28 | |