mirror of
https://github.com/torvalds/linux
synced 2024-10-21 10:49:43 +00:00
84f887bfb9
This avoids repeating the logic in every Makefile. We mimic the top-level Makefile and use $(CROSS_COMPILE)gcc. Signed-off-by: Michael Ellerman <mpe@ellerman.id.au> Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com>
29 lines
609 B
Makefile
29 lines
609 B
Makefile
CFLAGS = -Wall
|
|
BINARIES = execveat
|
|
DEPS = execveat.symlink execveat.denatured script subdir
|
|
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*
|