xref: /linux/tools/testing/selftests/landlock/Makefile (revision e1199815b47be83346c03e20a3de76f934e4bb34)
1*e1199815SMickaël Salaün# SPDX-License-Identifier: GPL-2.0
2*e1199815SMickaël Salaün
3*e1199815SMickaël SalaünCFLAGS += -Wall -O2
4*e1199815SMickaël Salaün
5*e1199815SMickaël Salaünsrc_test := $(wildcard *_test.c)
6*e1199815SMickaël Salaün
7*e1199815SMickaël SalaünTEST_GEN_PROGS := $(src_test:.c=)
8*e1199815SMickaël Salaün
9*e1199815SMickaël SalaünTEST_GEN_PROGS_EXTENDED := true
10*e1199815SMickaël Salaün
11*e1199815SMickaël SalaünKSFT_KHDR_INSTALL := 1
12*e1199815SMickaël SalaünOVERRIDE_TARGETS := 1
13*e1199815SMickaël Salaüninclude ../lib.mk
14*e1199815SMickaël Salaün
15*e1199815SMickaël Salaünkhdr_dir = $(top_srcdir)/usr/include
16*e1199815SMickaël Salaün
17*e1199815SMickaël Salaün$(khdr_dir)/linux/landlock.h: khdr
18*e1199815SMickaël Salaün	@:
19*e1199815SMickaël Salaün
20*e1199815SMickaël Salaün$(OUTPUT)/true: true.c
21*e1199815SMickaël Salaün	$(LINK.c) $< $(LDLIBS) -o $@ -static
22*e1199815SMickaël Salaün
23*e1199815SMickaël Salaün$(OUTPUT)/%_test: %_test.c $(khdr_dir)/linux/landlock.h ../kselftest_harness.h common.h
24*e1199815SMickaël Salaün	$(LINK.c) $< $(LDLIBS) -o $@ -lcap -I$(khdr_dir)
25