xref: /linux/fs/lockd/Makefile (revision 9bf81d102c9d3403f51d00527beabf4151343ad5)
1# SPDX-License-Identifier: GPL-2.0
2#
3# Makefile for the linux lock manager stuff
4#
5
6ccflags-y += -I$(src)			# needed for trace events
7
8obj-$(CONFIG_LOCKD) += lockd.o
9
10lockd-y := clntlock.o clntproc.o clntxdr.o host.o svc.o svclock.o \
11	   svcshare.o svcproc.o svcsubs.o mon.o trace.o netlink.o \
12	   nlm3xdr_gen.o
13lockd-$(CONFIG_LOCKD_V4) += clnt4xdr.o svc4proc.o nlm4xdr_gen.o
14lockd-$(CONFIG_PROC_FS) += procfs.o
15
16#
17# XDR code generation (requires Python and additional packages)
18#
19# The generated *xdr_gen.{h,c} files are checked into git. Normal kernel
20# builds do not require the xdrgen tool or its Python dependencies.
21#
22# Developers modifying .x files in Documentation/sunrpc/xdr/ should run
23# "make xdrgen" to regenerate the affected files.
24#
25.PHONY: xdrgen
26
27XDRGEN			= ../../tools/net/sunrpc/xdrgen/xdrgen
28
29XDRGEN_DEFINITIONS	= ../../include/linux/sunrpc/xdrgen/nlm4.h \
30			  ../../include/linux/sunrpc/xdrgen/nlm3.h
31XDRGEN_DECLARATIONS	= nlm4xdr_gen.h nlm3xdr_gen.h
32XDRGEN_SOURCE		= nlm4xdr_gen.c nlm3xdr_gen.c
33
34xdrgen: $(XDRGEN_DEFINITIONS) $(XDRGEN_DECLARATIONS) $(XDRGEN_SOURCE)
35
36../../include/linux/sunrpc/xdrgen/nlm4.h: ../../Documentation/sunrpc/xdr/nlm4.x
37	$(XDRGEN) definitions $< > $@
38
39../../include/linux/sunrpc/xdrgen/nlm3.h: ../../Documentation/sunrpc/xdr/nlm3.x
40	$(XDRGEN) definitions $< > $@
41
42nlm4xdr_gen.h: ../../Documentation/sunrpc/xdr/nlm4.x
43	$(XDRGEN) declarations $< > $@
44
45nlm3xdr_gen.h: ../../Documentation/sunrpc/xdr/nlm3.x
46	$(XDRGEN) declarations $< > $@
47
48nlm4xdr_gen.c: ../../Documentation/sunrpc/xdr/nlm4.x
49	$(XDRGEN) source --peer server $< > $@
50
51nlm3xdr_gen.c: ../../Documentation/sunrpc/xdr/nlm3.x
52	$(XDRGEN) source --peer server $< > $@
53