xref: /illumos-gate/usr/src/cmd/ypcmd/ypupdated/Makefile (revision 8226594fdd4479be135127f43632f1f995074654)
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# Copyright (c) 2018, Joyent, Inc.
26
27NETYPPROG =	rpc.ypupdated
28PROG =		$(NETYPPROG)
29
30MANIFEST =	update.xml
31
32include ../../Makefile.cmd
33
34ROOTMANIFESTDIR = $(ROOTSVCNETWORKNIS)
35
36#installed directories
37RPCSVC=		$(ROOT)/usr/include/rpcsvc
38NETSVC =	$(ROOTLIB)/netsvc
39NETYP =		$(NETSVC)/yp
40ROOTDIRS =	$(NETSVC) $(NETYP)
41
42# include library definitions
43LDLIBS +=	-lnsl
44
45# include path to yptol.h (for name of N2L mapping file)
46CPPFLAGS += -I$(SRC)/lib/libnisdb/yptol
47
48INETYPPROG=		$(NETYPPROG:%=$(NETYP)/%)
49
50RPCYPUPDATEOBJ =	rpc.ypupdated.o openchild.o
51
52OBJS =			$(RPCYPUPDATEOBJ)
53
54SRCS =			$(OBJS:%.o=%.c)
55
56CERRWARN +=		-_gcc=-Wno-implicit-function-declaration
57CERRWARN +=		-_gcc=-Wno-unused-variable
58
59# not linted
60SMATCH=off
61
62CLOBBERFILES += ypupdated_prot.h
63
64#conditional assignments
65$(INETSVC)   := FILEMODE=555
66
67#install rules
68
69.KEEP_STATE:
70
71all: $(PROG)
72
73ypupdated_prot.h: ypupdate_prot.x
74	$(RM) ypupdated_prot.h; $(RPCGEN) -C -h ypupdate_prot.x -o ypupdated_prot.h
75
76$(RPCYPUPDATEOBJ): ypupdated_prot.h
77
78rpc.ypupdated: $(RPCYPUPDATEOBJ)
79	$(LINK.c) -o $@ $(RPCYPUPDATEOBJ) $(LDLIBS)
80	$(POST_PROCESS)
81
82install: all $(ROOTDIRS) $(IBINPROG) $(INETYPPROG) $(ROOTMANIFEST)
83
84$(ROOTDIRS):
85	$(INS.dir)
86
87$(NETYP)/%: %
88	$(INS.file)
89
90clean:
91	$(RM) $(OBJS)
92
93lint:
94	${LINT.c} ${SRCS}
95
96check: $(CHKMANIFEST)
97
98cstyle:
99	${CSTYLE} ${SRCS}
100
101# include library targets
102include ../../Makefile.targ
103