xref: /illumos-gate/usr/src/uts/common/klm/Makefile (revision d48be21240dfd051b689384ce2b23479d757f2d8)
1#
2# This file and its contents are supplied under the terms of the
3# Common Development and Distribution License ("CDDL"), version 1.0.
4# You may only use this file in accordance with the terms of version
5# 1.0 of the CDDL.
6#
7# A full copy of the text of the CDDL should have accompanied this
8# source.  A copy is of the CDDL is also available via the Internet
9# at http://www.illumos.org/license/CDDL.
10#
11
12#
13# Copyright 2010 Nexenta Systems, Inc.  All rights reserved.
14# Copyright (c) 2012 by Delphix. All rights reserved.
15#
16
17include ../../../Makefile.master
18
19NLM_PROT_X= ../rpcsvc/nlm_prot.x
20SM_INTER_X= ../rpcsvc/sm_inter.x
21NSM_ADDR_X= ../rpcsvc/nsm_addr.x
22
23RPCGENFLAGS = -C -M -i 0
24SED_INCL='/^.include/s:\.\..*/rpcsvc:rpcsvc:'
25
26DERIVED_FILES= nlm_prot_clnt.c nlm_prot_xdr.c \
27		sm_inter_clnt.c sm_inter_xdr.c \
28		nsm_addr_clnt.c nsm_addr_xdr.c
29
30install_h: all_h
31
32all_h: $(DERIVED_FILES)
33
34nlm_prot_clnt.c : $(NLM_PROT_X) nlm_prot_clnt.sed
35	$(RPCGEN) $(RPCGENFLAGS) -l -o $@.tmp $(NLM_PROT_X)
36	sed -f nlm_prot_clnt.sed < $@.tmp > $@
37	$(RM) -f $@.tmp
38
39nlm_prot_xdr.c : $(NLM_PROT_X)
40	$(RPCGEN) $(RPCGENFLAGS) -c -o $@.tmp $(NLM_PROT_X)
41	sed -e $(SED_INCL) < $@.tmp > $@
42	$(RM) -f $@.tmp
43
44sm_inter_clnt.c : $(SM_INTER_X) sm_inter_clnt.sed
45	$(RPCGEN) $(RPCGENFLAGS) -l -o $@.tmp $(SM_INTER_X)
46	sed -f sm_inter_clnt.sed < $@.tmp > $@
47	$(RM) -f $@.tmp
48
49sm_inter_xdr.c : $(SM_INTER_X)
50	$(RPCGEN) $(RPCGENFLAGS) -c -o $@.tmp $(SM_INTER_X)
51	sed -e $(SED_INCL) < $@.tmp > $@
52	$(RM) -f $@.tmp
53
54nsm_addr_clnt.c : $(NSM_ADDR_X) nsm_addr_clnt.sed
55	$(RPCGEN) $(RPCGENFLAGS) -l -o $@.tmp $(NSM_ADDR_X)
56	sed -f nsm_addr_clnt.sed < $@.tmp > $@
57	$(RM) -f $@.tmp
58
59nsm_addr_xdr.c : $(NSM_ADDR_X)
60	$(RPCGEN) $(RPCGENFLAGS) -c -o $@.tmp $(NSM_ADDR_X)
61	sed -e $(SED_INCL) < $@.tmp > $@
62	$(RM) -f $@.tmp
63
64check:
65
66clean:
67	$(RM) $(DERIVED_FILES)
68
69clobber:	clean
70
71.KEEP_STATE:
72