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 |
David Drysdale | c9b26b8 | 2014-12-12 16:57:36 -0800 | [diff] [blame] | 3 | |
bamvor.zhangjian@huawei.com | 80d443e8 | 2016-11-29 19:55:51 +0800 | [diff] [blame] | 4 | TEST_GEN_PROGS := execveat |
| 5 | TEST_GEN_FILES := execveat.symlink execveat.denatured script subdir |
| 6 | # Makefile is a run-time dependency, since it's accessed by the execveat test |
| 7 | TEST_FILES := Makefile |
| 8 | |
bamvor.zhangjian@huawei.com | a8ba798 | 2016-11-29 19:55:52 +0800 | [diff] [blame] | 9 | EXTRA_CLEAN := $(OUTPUT)/subdir.moved $(OUTPUT)/execveat.moved $(OUTPUT)/xxxxx* |
bamvor.zhangjian@huawei.com | 80d443e8 | 2016-11-29 19:55:51 +0800 | [diff] [blame] | 10 | |
| 11 | include ../lib.mk |
| 12 | |
bamvor.zhangjian@huawei.com | a8ba798 | 2016-11-29 19:55:52 +0800 | [diff] [blame] | 13 | $(OUTPUT)/subdir: |
David Drysdale | c9b26b8 | 2014-12-12 16:57:36 -0800 | [diff] [blame] | 14 | mkdir -p $@ |
bamvor.zhangjian@huawei.com | a8ba798 | 2016-11-29 19:55:52 +0800 | [diff] [blame] | 15 | $(OUTPUT)/script: |
David Drysdale | c9b26b8 | 2014-12-12 16:57:36 -0800 | [diff] [blame] | 16 | echo '#!/bin/sh' > $@ |
| 17 | echo 'exit $$*' >> $@ |
| 18 | chmod +x $@ |
bamvor.zhangjian@huawei.com | a8ba798 | 2016-11-29 19:55:52 +0800 | [diff] [blame] | 19 | $(OUTPUT)/execveat.symlink: $(OUTPUT)/execveat |
| 20 | cd $(OUTPUT) && ln -s -f $(shell basename $<) $(shell basename $@) |
| 21 | $(OUTPUT)/execveat.denatured: $(OUTPUT)/execveat |
David Drysdale | c9b26b8 | 2014-12-12 16:57:36 -0800 | [diff] [blame] | 22 | cp $< $@ |
| 23 | chmod -x $@ |
bamvor.zhangjian@huawei.com | a8ba798 | 2016-11-29 19:55:52 +0800 | [diff] [blame] | 24 | |