Makefile 754 字节
Newer Older
1
# SPDX-License-Identifier: GPL-2.0
2
CFLAGS = -Wall
3 4
CFLAGS += -Wno-nonnull
CFLAGS += -D_GNU_SOURCE
5

6
TEST_PROGS := binfmt_script
7 8 9 10 11
TEST_GEN_PROGS := execveat
TEST_GEN_FILES := execveat.symlink execveat.denatured script subdir
# Makefile is a run-time dependency, since it's accessed by the execveat test
TEST_FILES := Makefile

12 13
TEST_GEN_PROGS += recursion-depth

14
EXTRA_CLEAN := $(OUTPUT)/subdir.moved $(OUTPUT)/execveat.moved $(OUTPUT)/xxxxx*
15 16 17

include ../lib.mk

18
$(OUTPUT)/subdir:
19
	mkdir -p $@
20
$(OUTPUT)/script:
21 22 23
	echo '#!/bin/sh' > $@
	echo 'exit $$*' >> $@
	chmod +x $@
24 25 26
$(OUTPUT)/execveat.symlink: $(OUTPUT)/execveat
	cd $(OUTPUT) && ln -s -f $(shell basename $<) $(shell basename $@)
$(OUTPUT)/execveat.denatured: $(OUTPUT)/execveat
27 28
	cp $< $@
	chmod -x $@
29