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.
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.
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]
22 # Copyright 2015 Gary Mills
23 # Copyright 2009 Sun Microsystems, Inc. All rights reserved.
24 # Use is subject to license terms.
27 BINPROG
= ypmatch ypwhich ypcat
28 SBINPROG
= makedbm ypalias ypinit yppoll ypset
29 NETYPPROG
= ypbind ypxfr yppush udpublickey mkalias \
30 multi multi.awk stdethers stdhosts \
31 ypxfr_1perday ypxfr_1perhour ypxfr_2perday \
33 NIS2LDAPPROG
= ypxfrd ypserv ypxfr
35 PROG
= $(BINPROG
) $(SBINPROG
) $(NETYPPROG
) $(NIS2LDAPPROG
) $(SVCMETHOD
)
37 MANIFEST
= server.xml client.xml xfr.xml
39 include ..
/Makefile.cmd
41 ROOTMANIFESTDIR
= $(ROOTSVCNETWORKNIS
)
43 # installed directories
44 NETSVC
= $(ROOTLIB
)/netsvc
47 ROOTVAR_YP
= $(ROOT
)/var
/yp
48 ROOTBINDING
= $(ROOTVAR_YP
)/binding
49 ROOTDIRS
= $(ROOT
) $(ROOTUSR
) $(ROOTLIB
) $(ROOTETC
) $(ROOTVAR
) \
50 $(NETSVC
) $(NETYP
) $(ROOTVAR_YP
) $(ROOTBINDING
) \
51 $(ROOTUSRSBIN
) $(ROOTBIN
)
53 $(NIS2LDAPPROG
) := LDLIBS
+= -lc
-lnisdb
54 makedbm
:= MAPFILES
= $(MAPFILE.INT
)
55 makedbm
:= LDFLAGS
+= $(MAPFILES
:%=-Wl
,-M
%)
57 $(ROOTVAR_YP
)/aliases
:= FILEMODE
=555
59 YPFILES
= Makefile aliases nicknames updaters
61 ROOTYPFILES
= $(YPFILES
:%=$(ROOTVAR_YP
)/%)
62 ROOTETCFILE
= $(ETCFILES
:%=$(ROOTETC
)/%)
64 TXTS
= $(ETCFILES
:%=net_files
/%) $(YPFILES
:%=net_files
/%)
65 SUBDIRS
= yppasswd mknetid revnetgroup ypupdated yp2lscripts
67 YPBINDOBJ
= yp_b_svc.o yp_b_subr.o rpc_bootstrap.o getlist.o
69 # Some sort of obsolete idea of common files which are only now used by a
72 COMMONOBJ
= getlist.o yp_getalias.o
75 # Objects shared between all the major components
78 SHAREDOBJ
= $(SHARED_DIR
)/utils.o
$(SHARED_DIR
)/lockmap.o
$(SHARED_DIR
)/ancil.o
79 SHARESRC
= $(SHAREOBJ
:.o
=.c
)
81 YPXFROBJ
= ypxfr.o ypxfrd_client.o ypxfrd_xdr.o
82 YPMATOBJ
= ypmatch.o nick.o
83 YPWHIOBJ
= ypwhich.o nick.o
84 YPCATOBJ
= ypcat.o nick.o
85 UDPUBLICKEYOBJ
= udpublickey.o
86 MKALIASOBJ
= mkalias.o
87 STDETHERSOBJ
= stdethers.o
88 STDHOSTSOBJ
= stdhosts.o
89 #COMMONCLNTOBJ = clnt_create_rsvd.o
90 YPSERVOBJ
= ypserv.o ypserv_map.o \
91 ypserv_proc.o ypserv_ancil.o \
92 ypserv_resolv.o ypserv_resolv_common.o \
93 ypv1_xdr.o ypserv_net_secure.o
95 YPXFRDOBJ
= ypxfrd_svc.o ypxfrd_xdr.o ypxfrd_server.o \
98 NETYPOBJ
= $(YPXFROBJ
) $(YPXFRDOBJ
) $(YPSERVOBJ
) $(YPPUSHOBJ
) \
99 $(YPBINDOBJ
) $(UDPUBLICKEYOBJ
)
100 OBJS
= $(NETYPOBJ
) $(MKALIASOBJ
) $(COMMONOBJ
) $(SHAREDOBJ
) \
101 $(YPPUSHOBJ
) $(YPMATOBJ
) $(YPWHIOBJ
) $(YPCATOBJ
) \
102 $(STDETHERSOBJ
) $(STDHOSTSOBJ
) makedbm.o ypalias.o pong.o
104 BINSRC
= $(BINPROG
:=.c
)
106 SBINSRC
= $(SBINPROG
:=.c
)
108 NETYPSRC
= $(NETYPOBJ
:.o
=.c
)
110 YPBINDSRC
= $(YPBINSOBJ
:.o
=.c
)
112 YPXFRSRC
= $(YPXFROBJ
:.o
=.c
)
114 YPSERVSRC
= $(YPSERVOBJ
:.o
=.c
)
116 YPPUSHSRC
= $(YPPUSHOBJ
:.o
=.c
)
118 YPXFRDSRC
= $(YPXFRDOBJ
:.o
=.c
)
120 YPMASTERSRC
= $(YPMASTEROBJ
:.o
=.c
)
122 YPALLSRC
= $(YPALLOBJ
:.o
=.c
)
124 COMMONSRC
= $(COMMONOBJ
:.o
=.c
)
126 #COMMONCLNTSRC = $(COMMONCLNTOBJ:.o=.c)
128 SRCS
= $(BINSRC
) $(SBINSRC
) $(NETYPSRC
) \
129 $(COMMONSRC
) $(SHAREDSRC
)
131 CLEANFILES
= ypxfrd.h ypxfrd_xdr.c
133 IBINPROG
= $(BINPROG
:%=$(ROOTBIN
)/%)
134 ISBINPROG
= $(SBINPROG
:%=$(ROOTUSRSBIN
)/%)
135 INETYPPROG
= $(NETYPPROG
:%=$(NETYP
)/%)
136 INIS2LDAPPROG
= $(NIS2LDAPPROG
:%=$(NETYP
)/%)
138 NIS2LDAPINC
= -I
$(SRC
)/lib
/libnisdb
/yptol
140 CERRWARN
+= -Wno-implicit-function-declaration
141 CERRWARN
+= -Wno-parentheses
142 CERRWARN
+= -Wno-unused-variable
143 CERRWARN
+= -Wno-uninitialized
144 CERRWARN
+= -Wno-switch
145 CERRWARN
+= -Wno-extra
146 CERRWARN
+= -Wno-unused-label
147 CERRWARN
+= -Wno-address
148 CERRWARN
+= -Wno-unused-function
150 #conditional assignments
151 ypalias.o
:= CPPFLAGS
= -DMAIN
$(CPPFLAGS.master
)
152 makedbm.o
:= CPPFLAGS
= $(CPPFLAGS.master
)
153 yp_b_svc.o
:= CPPFLAGS
+= -DINIT_DEFAULT
154 ypxfrd_svc.o
:= CPPFLAGS
+= -Dmain
=_main
155 ypxfr.o
:= CPPFLAGS
+= $(NIS2LDAPINC
)
156 yppush.o
:= CPPFLAGS
+= $(NIS2LDAPINC
)
157 $(NIS2LDAPPROG
) := CPPFLAGS
+= $(NIS2LDAPINC
)
158 $(SHAREDOBJ
) := CPPFLAGS
+= -I
$(SRC
)/lib
/libnisdb
/yptol
159 $(ROOTVAR_YP
)/Makefile
:= FILEMODE
= 555
160 $(ROOTVAR_YP
)/nicknames
:= FILEMODE
= 644
161 $(ROOTVAR_YP
)/updaters
:= FILEMODE
= 500
162 $(ROOTETC
)/publickey
:= FILEMODE
= 644
163 # non-default file attributes to avoid conflict with rpcsrc
168 install:= TARGET
= install
169 clean:= TARGET
= clean
170 clobber:= TARGET
= clobber
171 cstyle
:= TARGET
= cstyle
173 all: $(SHAREDOBJ
) $(SUBDIRS
) $(PROG
) $(TXTS
)
177 $(ROOTETC
)/%: net_files
/%
180 $(ROOTVAR_YP
)/% : net_files
/%
188 $(SHAREDOBJ
): $(SHAREDSRC
)
189 $(COMPILE.c
) $(SHAREDSRC
) -o
$@
$<
192 $(LINK.c
) $(YPBINDOBJ
) -o
$@
$(LDLIBS
)
195 makedbm ypalias
: $$@.o
$(COMMONOBJ
) $$(MAPFILES
)
196 $(LINK.c
) -o
$@
$@.o
$(COMMONOBJ
) $(LDLIBS
)
200 $(LINK.c
) -o
$@
$(YPMATOBJ
) $(LDLIBS
)
204 $(LINK.c
) -o
$@
$(YPWHIOBJ
) $(LDLIBS
)
208 $(LINK.c
) -o
$@
$(YPCATOBJ
) $(LDLIBS
)
211 ypxfrd_xdr.c
: ypxfrd.x
212 $(RM
) ypxfrd_xdr.c
; $(RPCGEN
) -C
-c ypxfrd.x
-o ypxfrd_xdr.c
215 $(RM
) ypxfrd.h
; $(RPCGEN
) -C
-h ypxfrd.x
-o ypxfrd.h
217 ypxfrd_xdr.o ypxfrd_client.o
: ypxfrd.h
219 #clnt_create_rsvd.o ypxfr.o: clnt_create_rsvd.h
221 ypxfrd
: $(YPXFRDOBJ
) $(SHAREDOBJ
)
222 $(LINK.
cc) $(YPXFRDOBJ
) $(SHAREDOBJ
) \
226 ypxfr
: $(YPXFROBJ
) $(COMMONOBJ
) $(YPMASTEROBJ
) $(SHAREDOBJ
)
227 $(LINK.
cc) -o
$@
$(YPXFROBJ
) $(YPMASTEROBJ
) $(COMMONOBJ
) \
228 $(SHAREDOBJ
) $(LDLIBS
)
231 ypserv
: $(YPSERVOBJ
) $(COMMONOBJ
) $(SHAREDOBJ
)
232 $(LINK.
cc) $(YPSERVOBJ
) $(COMMONOBJ
) \
233 $(SHAREDOBJ
) -o
$@
$(LDLIBS
)
236 yppush
: $(YPPUSHOBJ
) $(COMMONOBJ
)
237 $(LINK.c
) $(YPPUSHOBJ
) $(COMMONOBJ
) -o
$@
$(LDLIBS
)
240 udpublickey
: $(UDPUBLICKEYOBJ
)
241 $(LINK.c
) $(UDPUBLICKEYOBJ
) -o
$@
$(LDLIBS
)
244 mkalias
: $(MKALIASOBJ
)
245 $(LINK.c
) $(MKALIASOBJ
) -o
$@
$(LDLIBS
)
248 stdethers
: $(STDETHERSOBJ
)
249 $(LINK.c
) $(STDETHERSOBJ
) -o
$@
$(LDLIBS
)
252 stdhosts
: $(STDHOSTSOBJ
)
253 $(LINK.c
) $(STDHOSTSOBJ
) -o
$@
$(LDLIBS
)
256 install: all $(PROG
) $(ROOTDIRS
) $(ROOTETCFILE
) $(ROOTYPFILES
) $(IBINPROG
) \
257 $(ISBINPROG
) $(INETYPPROG
) $(INIS2LDAPPROG
) $(SUBDIRS
) $(ROOTMANIFEST
) \
264 @cd
$@
; pwd
; $(MAKE
) $(TARGET
)
266 check: $(CHKMANIFEST
)
269 ${CSTYLE} `echo $(SRCS) | sed 's/ypinit.c//'`
272 $(RM
) $(OBJS
) $(CLEANFILES
)
274 clobber: clean $(SUBDIRS
)
278 include ..
/Makefile.targ