xref: /titanic_41/usr/src/cmd/ypcmd/ypupdated/Makefile (revision 0bb073995ac5a95bd35f2dd790df1ea3d8c2d507)
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 2006 Sun Microsystems, Inc.  All rights reserved.
23# Use is subject to license terms.
24#
25# ident	"%Z%%M%	%I%	%E% SMI"
26#
27
28NETYPPROG =	rpc.ypupdated
29PROG =		$(NETYPPROG)
30
31MANIFEST =	update.xml
32
33include ../../Makefile.cmd
34
35ROOTMANIFESTDIR = $(ROOTSVCNETWORKNIS)
36
37#installed directories
38RPCSVC=		$(ROOT)/usr/include/rpcsvc
39NETSVC =	$(ROOTLIB)/netsvc
40NETYP =		$(NETSVC)/yp
41ROOTDIRS =	$(NETSVC) $(NETYP)
42
43# include library definitions
44LDLIBS +=	-lnsl
45
46# include path to yptol.h (for name of N2L mapping file)
47CPPFLAGS += -I$(SRC)/lib/libnisdb/yptol
48
49INETYPPROG=		$(NETYPPROG:%=$(NETYP)/%)
50
51RPCYPUPDATEOBJ =	rpc.ypupdated.o openchild.o
52
53OBJS =			$(RPCYPUPDATEOBJ)
54
55SRCS =			$(OBJS:%.o=%.c)
56
57#conditional assignments
58$(INETSVC)   := GROUP=bin
59$(INETSVC)   := FILEMODE=555
60
61#install rules
62
63.KEEP_STATE:
64
65all: $(PROG)
66
67ypupdated_prot.h: ypupdate_prot.x
68	$(RM) ypupdated_prot.h; $(RPCGEN) -C -h ypupdate_prot.x -o ypupdated_prot.h
69
70$(RPCYPUPDATEOBJ): ypupdated_prot.h
71
72rpc.ypupdated: $(RPCYPUPDATEOBJ)
73	$(LINK.c) -o $@ $(RPCYPUPDATEOBJ) $(LDLIBS)
74	$(POST_PROCESS)
75
76install: all $(ROOTDIRS) $(IBINPROG) $(INETYPPROG) $(ROOTMANIFEST)
77
78$(ROOTDIRS):
79	$(INS.dir)
80
81$(NETYP)/%: %
82	$(INS.file)
83
84clean:
85	$(RM) $(OBJS)
86
87lint:
88	${LINT.c} ${SRCS}
89
90check: $(CHKMANIFEST)
91
92cstyle:
93	${CSTYLE} ${SRCS}
94
95# include library targets
96include ../../Makefile.targ
97