Makefile (a108772d03d8bdb43258218b00bfe43bbe1e8800) Makefile (a52540522c9541bfa3e499d2edba7bc0ca73a4ca)
1# SPDX-License-Identifier: GPL-2.0
1# SPDX-License-Identifier: GPL-2.0
2#
3# First run: make -C ../../../.. headers_install
2
3CFLAGS += -Wall -O2 $(KHDR_INCLUDES)
4
5CFLAGS += -Wall -O2 $(KHDR_INCLUDES)
6LDLIBS += -lcap
4
7
8LOCAL_HDRS += common.h
9
5src_test := $(wildcard *_test.c)
6
7TEST_GEN_PROGS := $(src_test:.c=)
8
9TEST_GEN_PROGS_EXTENDED := true
10
10src_test := $(wildcard *_test.c)
11
12TEST_GEN_PROGS := $(src_test:.c=)
13
14TEST_GEN_PROGS_EXTENDED := true
15
11OVERRIDE_TARGETS := 1
12top_srcdir := ../../../..
16# Static linking for short targets:
17$(TEST_GEN_PROGS_EXTENDED): LDFLAGS += -static
18
13include ../lib.mk
14
19include ../lib.mk
20
15khdr_dir = $(top_srcdir)/usr/include
16
17$(OUTPUT)/true: true.c
18 $(LINK.c) $< $(LDLIBS) -o $@ -static
19
20$(OUTPUT)/%_test: %_test.c $(khdr_dir)/linux/landlock.h ../kselftest_harness.h common.h
21 $(LINK.c) $< $(LDLIBS) -o $@ -lcap -I$(khdr_dir)
21# Static linking for targets with $(OUTPUT)/ prefix:
22$(TEST_GEN_PROGS_EXTENDED): LDFLAGS += -static