David Drysdale | c9b26b8 | 2014-12-12 16:57:36 -0800 | [diff] [blame] | 1 | CFLAGS = -Wall |
| 2 | BINARIES = execveat |
Bamvor Jian Zhang | ae78581 | 2015-09-09 21:06:29 +0800 | [diff] [blame] | 3 | DEPS = execveat.symlink execveat.denatured script subdir |
David Drysdale | c9b26b8 | 2014-12-12 16:57:36 -0800 | [diff] [blame] | 4 | all: $(BINARIES) $(DEPS) |
| 5 | |
| 6 | subdir: |
| 7 | mkdir -p $@ |
| 8 | script: |
| 9 | echo '#!/bin/sh' > $@ |
| 10 | echo 'exit $$*' >> $@ |
| 11 | chmod +x $@ |
| 12 | execveat.symlink: execveat |
| 13 | ln -s -f $< $@ |
| 14 | execveat.denatured: execveat |
| 15 | cp $< $@ |
| 16 | chmod -x $@ |
| 17 | %: %.c |
| 18 | $(CC) $(CFLAGS) -o $@ $^ |
| 19 | |
Michael Ellerman | 5e29a91 | 2015-03-11 15:05:59 +1100 | [diff] [blame] | 20 | TEST_PROGS := execveat |
Michael Ellerman | 32dcfba | 2015-03-11 15:06:00 +1100 | [diff] [blame] | 21 | TEST_FILES := $(DEPS) |
Michael Ellerman | 5e29a91 | 2015-03-11 15:05:59 +1100 | [diff] [blame] | 22 | |
| 23 | include ../lib.mk |
David Drysdale | c9b26b8 | 2014-12-12 16:57:36 -0800 | [diff] [blame] | 24 | |
David Drysdale | c9b26b8 | 2014-12-12 16:57:36 -0800 | [diff] [blame] | 25 | clean: |
| 26 | rm -rf $(BINARIES) $(DEPS) subdir.moved execveat.moved xxxxx* |