xref: /titanic_51/usr/src/cmd/ypcmd/ypupdated/Makefile (revision a31148363f598def767ac48c5d82e1572e44b935)
1#
2# CDDL HEADER START
3#
4# The contents of this file are subject to the terms of the
5# Common Development and Distribution License (the "License").
6# You may not use this file except in compliance with the License.
7#
8# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9# or http://www.opensolaris.org/os/licensing.
10# See the License for the specific language governing permissions
11# and limitations under the License.
12#
13# When distributing Covered Code, include this CDDL HEADER in each
14# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15# If applicable, add the following below this CDDL HEADER, with the
16# fields enclosed by brackets "[]" replaced with your own identifying
17# information: Portions Copyright [yyyy] [name of copyright owner]
18#
19# CDDL HEADER END
20#
21#
22# Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
23# Use is subject to license terms.
24#
25
26NETYPPROG =	rpc.ypupdated
27PROG =		$(NETYPPROG)
28
29MANIFEST =	update.xml
30
31include ../../Makefile.cmd
32
33ROOTMANIFESTDIR = $(ROOTSVCNETWORKNIS)
34
35#installed directories
36RPCSVC=		$(ROOT)/usr/include/rpcsvc
37NETSVC =	$(ROOTLIB)/netsvc
38NETYP =		$(NETSVC)/yp
39ROOTDIRS =	$(NETSVC) $(NETYP)
40
41# include library definitions
42LDLIBS +=	-lnsl
43
44# include path to yptol.h (for name of N2L mapping file)
45CPPFLAGS += -I$(SRC)/lib/libnisdb/yptol
46
47INETYPPROG=		$(NETYPPROG:%=$(NETYP)/%)
48
49RPCYPUPDATEOBJ =	rpc.ypupdated.o openchild.o
50
51OBJS =			$(RPCYPUPDATEOBJ)
52
53SRCS =			$(OBJS:%.o=%.c)
54
55#conditional assignments
56$(INETSVC)   := FILEMODE=555
57
58#install rules
59
60.KEEP_STATE:
61
62all: $(PROG)
63
64ypupdated_prot.h: ypupdate_prot.x
65	$(RM) ypupdated_prot.h; $(RPCGEN) -C -h ypupdate_prot.x -o ypupdated_prot.h
66
67$(RPCYPUPDATEOBJ): ypupdated_prot.h
68
69rpc.ypupdated: $(RPCYPUPDATEOBJ)
70	$(LINK.c) -o $@ $(RPCYPUPDATEOBJ) $(LDLIBS)
71	$(POST_PROCESS)
72
73install: all $(ROOTDIRS) $(IBINPROG) $(INETYPPROG) $(ROOTMANIFEST)
74
75$(ROOTDIRS):
76	$(INS.dir)
77
78$(NETYP)/%: %
79	$(INS.file)
80
81clean:
82	$(RM) $(OBJS)
83
84lint:
85	${LINT.c} ${SRCS}
86
87check: $(CHKMANIFEST)
88
89cstyle:
90	${CSTYLE} ${SRCS}
91
92# include library targets
93include ../../Makefile.targ
94