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