2014-12-13 07:57:36 +07:00
|
|
|
CFLAGS = -Wall
|
|
|
|
BINARIES = execveat
|
2015-04-22 05:52:13 +07:00
|
|
|
DEPS = execveat.symlink execveat.denatured script
|
2014-12-13 07:57:36 +07:00
|
|
|
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 $@ $^
|
|
|
|
|
2015-03-11 11:05:59 +07:00
|
|
|
TEST_PROGS := execveat
|
2015-03-11 11:06:00 +07:00
|
|
|
TEST_FILES := $(DEPS)
|
2015-03-11 11:05:59 +07:00
|
|
|
|
|
|
|
include ../lib.mk
|
2014-12-13 07:57:36 +07:00
|
|
|
|
2015-03-11 11:06:00 +07:00
|
|
|
override EMIT_TESTS := echo "mkdir -p subdir; (./execveat && echo \"selftests: execveat [PASS]\") || echo \"selftests: execveat [FAIL]\""
|
|
|
|
|
2014-12-13 07:57:36 +07:00
|
|
|
clean:
|
|
|
|
rm -rf $(BINARIES) $(DEPS) subdir.moved execveat.moved xxxxx*
|