summaryrefslogtreecommitdiff
path: root/tools/testing/selftests/exec/Makefile
blob: 6b76bfdc847ea58879cc52ccfa2b77ebd296150d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
CFLAGS = -Wall
BINARIES = execveat
DEPS = execveat.symlink execveat.denatured script
all: $(BINARIES) $(DEPS)

subdir:
	mkdir -p $@
script:
	echo '#!/bin/sh' > $@
	echo 'exit $$*' >> $@
	chmod +x $@
execveat.symlink: execveat
	ln -s -f $< $@
execveat.denatured: execveat
	cp $< $@
	chmod -x $@
%: %.c
	$(CC) $(CFLAGS) -o $@ $^

TEST_PROGS := execveat
TEST_FILES := $(DEPS)

include ../lib.mk

override EMIT_TESTS := echo "mkdir -p subdir; (./execveat && echo \"selftests: execveat [PASS]\") || echo \"selftests: execveat [FAIL]\""

clean:
	rm -rf $(BINARIES) $(DEPS) subdir.moved execveat.moved xxxxx*