xref: /linux-6.15/tools/testing/selftests/exec/Makefile (revision 8a78882d)
  • Home
  • History
  • Annotate
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# SPDX-License-Identifier: GPL-2.0
2CFLAGS = -Wall
3CFLAGS += -Wno-nonnull
4
5TEST_PROGS := binfmt_script.py
6TEST_GEN_PROGS := execveat load_address_4096 load_address_2097152 load_address_16777216 non-regular
7TEST_GEN_FILES := execveat.symlink execveat.denatured script subdir
8# Makefile is a run-time dependency, since it's accessed by the execveat test
9TEST_FILES := Makefile
10
11TEST_GEN_PROGS += recursion-depth
12TEST_GEN_PROGS += null-argv
13
14EXTRA_CLEAN := $(OUTPUT)/subdir.moved $(OUTPUT)/execveat.moved $(OUTPUT)/xxxxx*	\
15	       $(OUTPUT)/S_I*.test
16
17include ../lib.mk
18
19$(OUTPUT)/subdir:
20	mkdir -p $@
21$(OUTPUT)/script: Makefile
22	echo '#!/bin/bash' > $@
23	echo 'exit $$*' >> $@
24	chmod +x $@
25$(OUTPUT)/execveat.symlink: $(OUTPUT)/execveat
26	cd $(OUTPUT) && ln -s -f $(shell basename $<) $(shell basename $@)
27$(OUTPUT)/execveat.denatured: $(OUTPUT)/execveat
28	cp $< $@
29	chmod -x $@
30$(OUTPUT)/load_address_4096: load_address.c
31	$(CC) $(CFLAGS) $(LDFLAGS) -Wl,-z,max-page-size=0x1000 -pie -static $< -o $@
32$(OUTPUT)/load_address_2097152: load_address.c
33	$(CC) $(CFLAGS) $(LDFLAGS) -Wl,-z,max-page-size=0x200000 -pie -static $< -o $@
34$(OUTPUT)/load_address_16777216: load_address.c
35	$(CC) $(CFLAGS) $(LDFLAGS) -Wl,-z,max-page-size=0x1000000 -pie -static $< -o $@
36

served by {OpenGrok

Last Index Update: Tue Oct 21 18:42:31 GMT 2025