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 # These only need -lnsl
40 LNSLPROG
= ypmatch ypwhich ypcat yppoll ypset \
41 ypbind ypxfr yppush mkalias stdhosts
43 include ..
/Makefile.cmd
45 ROOTMANIFESTDIR
= $(ROOTSVCNETWORKNIS
)
47 # installed directories
48 NETSVC
= $(ROOTLIB
)/netsvc
51 ROOTVAR_YP
= $(ROOT
)/var
/yp
52 ROOTBINDING
= $(ROOTVAR_YP
)/binding
53 ROOTDIRS
= $(ROOT
) $(ROOTUSR
) $(ROOTLIB
) $(ROOTETC
) $(ROOTVAR
) \
54 $(NETSVC
) $(NETYP
) $(ROOTVAR_YP
) $(ROOTBINDING
) \
55 $(ROOTUSRSBIN
) $(ROOTBIN
)
57 $(LNSLPROG
) := LDLIBS
+= -lnsl
58 $(NIS2LDAPPROG
) := LDLIBS
+= -lc
-lnsl
-lnisdb
59 stdethers
:= LDLIBS
+= -lsocket
60 makedbm
:= MAPFILES
= $(MAPFILE.INT
) $(MAPFILE.NGB
)
61 makedbm
:= LDFLAGS
+= $(MAPFILES
:%=-M
%)
63 $(ROOTVAR_YP
)/aliases
:= FILEMODE
=555
65 YPFILES
= Makefile aliases nicknames updaters
67 ROOTYPFILES
= $(YPFILES
:%=$(ROOTVAR_YP
)/%)
68 ROOTETCFILE
= $(ETCFILES
:%=$(ROOTETC
)/%)
70 TXTS
= $(ETCFILES
:%=net_files
/%) $(YPFILES
:%=net_files
/%)
71 SUBDIRS
= yppasswd mknetid revnetgroup ypupdated yp2lscripts
73 YPBINDOBJ
= yp_b_svc.o yp_b_subr.o rpc_bootstrap.o getlist.o
75 # Some sort of obsolete idea of common files which are only now used by a
78 COMMONOBJ
= getlist.o yp_getalias.o
81 # Objects shared between all the major components
84 SHAREDOBJ
= $(SHARED_DIR
)/utils.o
$(SHARED_DIR
)/lockmap.o
$(SHARED_DIR
)/ancil.o
85 SHARESRC
= $(SHAREOBJ
:.o
=.c
)
87 YPXFROBJ
= ypxfr.o ypxfrd_client.o ypxfrd_xdr.o
88 YPMATOBJ
= ypmatch.o nick.o
89 YPWHIOBJ
= ypwhich.o nick.o
90 YPCATOBJ
= ypcat.o nick.o
91 UDPUBLICKEYOBJ
= udpublickey.o
92 MKALIASOBJ
= mkalias.o
93 STDETHERSOBJ
= stdethers.o
94 STDHOSTSOBJ
= stdhosts.o
95 #COMMONCLNTOBJ = clnt_create_rsvd.o
96 YPSERVOBJ
= ypserv.o ypserv_map.o \
97 ypserv_proc.o ypserv_ancil.o \
98 ypserv_resolv.o ypserv_resolv_common.o \
99 ypv1_xdr.o ypserv_net_secure.o
101 YPXFRDOBJ
= ypxfrd_svc.o ypxfrd_xdr.o ypxfrd_server.o \
104 NETYPOBJ
= $(YPXFROBJ
) $(YPXFRDOBJ
) $(YPSERVOBJ
) $(YPPUSHOBJ
) \
105 $(YPBINDOBJ
) $(UDPUBLICKEYOBJ
)
106 OBJS
= $(NETYPOBJ
) $(MKALIASOBJ
) $(COMMONOBJ
) $(SHAREDOBJ
) \
107 $(YPPUSHOBJ
) $(YPMATOBJ
) $(YPWHIOBJ
) $(YPCATOBJ
) \
108 $(STDETHERSOBJ
) $(STDHOSTSOBJ
) makedbm.o ypalias.o pong.o
110 BINSRC
= $(BINPROG
:=.c
)
112 SBINSRC
= $(SBINPROG
:=.c
)
114 NETYPSRC
= $(NETYPOBJ
:.o
=.c
)
116 YPBINDSRC
= $(YPBINSOBJ
:.o
=.c
)
118 YPXFRSRC
= $(YPXFROBJ
:.o
=.c
)
120 YPSERVSRC
= $(YPSERVOBJ
:.o
=.c
)
122 YPPUSHSRC
= $(YPPUSHOBJ
:.o
=.c
)
124 YPXFRDSRC
= $(YPXFRDOBJ
:.o
=.c
)
126 YPMASTERSRC
= $(YPMASTEROBJ
:.o
=.c
)
128 YPALLSRC
= $(YPALLOBJ
:.o
=.c
)
130 COMMONSRC
= $(COMMONOBJ
:.o
=.c
)
132 #COMMONCLNTSRC = $(COMMONCLNTOBJ:.o=.c)
134 SRCS
= $(BINSRC
) $(SBINSRC
) $(NETYPSRC
) \
135 $(COMMONSRC
) $(SHAREDSRC
)
137 CLEANFILES
= ypxfrd.h ypxfrd_xdr.c
139 IBINPROG
= $(BINPROG
:%=$(ROOTBIN
)/%)
140 ISBINPROG
= $(SBINPROG
:%=$(ROOTUSRSBIN
)/%)
141 INETYPPROG
= $(NETYPPROG
:%=$(NETYP
)/%)
142 INIS2LDAPPROG
= $(NIS2LDAPPROG
:%=$(NETYP
)/%)
144 NIS2LDAPINC
= -I
$(SRC
)/lib
/libnisdb
/yptol
146 CERRWARN
+= -_gcc
=-Wno-implicit-function-declaration
147 CERRWARN
+= -_gcc
=-Wno-parentheses
148 CERRWARN
+= -_gcc
=-Wno-unused-variable
149 CERRWARN
+= -_gcc
=-Wno-uninitialized
150 CERRWARN
+= -_gcc
=-Wno-switch
151 CERRWARN
+= -_gcc
=-Wno-extra
152 CERRWARN
+= -_gcc
=-Wno-unused-label
153 CERRWARN
+= -_gcc
=-Wno-address
154 CERRWARN
+= -_gcc
=-Wno-unused-function
156 #conditional assignments
157 ypalias.o
:= CPPFLAGS
= -DMAIN
$(CPPFLAGS.master
)
158 makedbm.o
:= CPPFLAGS
= $(CPPFLAGS.master
)
159 yp_b_svc.o
:= CPPFLAGS
+= -DINIT_DEFAULT
160 ypxfrd_svc.o
:= CPPFLAGS
+= -Dmain
=_main
161 ypxfr.o
:= CPPFLAGS
+= $(NIS2LDAPINC
)
162 yppush.o
:= CPPFLAGS
+= $(NIS2LDAPINC
)
163 $(NIS2LDAPPROG
) := CPPFLAGS
+= $(NIS2LDAPINC
)
164 $(SHAREDOBJ
) := CPPFLAGS
+= -I
$(SRC
)/lib
/libnisdb
/yptol
165 $(ROOTVAR_YP
)/Makefile
:= FILEMODE
= 555
166 $(ROOTVAR_YP
)/nicknames
:= FILEMODE
= 644
167 $(ROOTVAR_YP
)/updaters
:= FILEMODE
= 500
168 $(ROOTETC
)/publickey
:= FILEMODE
= 644
169 # non-default file attributes to avoid conflict with rpcsrc
174 install:= TARGET
= install
175 clean:= TARGET
= clean
176 clobber:= TARGET
= clobber
178 cstyle
:= TARGET
= cstyle
180 all: $(SHAREDOBJ
) $(SUBDIRS
) $(PROG
) $(TXTS
)
184 $(ROOTETC
)/%: net_files
/%
187 $(ROOTVAR_YP
)/% : net_files
/%
195 $(SHAREDOBJ
): $(SHAREDSRC
)
196 $(COMPILE.c
) $(SHAREDSRC
) -o
$@
$<
199 $(LINK.c
) $(YPBINDOBJ
) -o
$@
$(LDLIBS
)
202 makedbm ypalias
: $$@.o
$(COMMONOBJ
) $$(MAPFILES
)
203 $(LINK.c
) -o
$@
$@.o
$(COMMONOBJ
) $(LDLIBS
)
207 $(LINK.c
) -o
$@
$(YPMATOBJ
) $(LDLIBS
)
211 $(LINK.c
) -o
$@
$(YPWHIOBJ
) $(LDLIBS
)
215 $(LINK.c
) -o
$@
$(YPCATOBJ
) $(LDLIBS
)
218 ypxfrd_xdr.c
: ypxfrd.x
219 $(RM
) ypxfrd_xdr.c
; $(RPCGEN
) -C
-c ypxfrd.x
-o ypxfrd_xdr.c
222 $(RM
) ypxfrd.h
; $(RPCGEN
) -C
-h ypxfrd.x
-o ypxfrd.h
224 ypxfrd_xdr.o ypxfrd_client.o
: ypxfrd.h
226 #clnt_create_rsvd.o ypxfr.o: clnt_create_rsvd.h
228 ypxfrd
: $(YPXFRDOBJ
) $(SHAREDOBJ
)
229 $(LINK.
cc) $(YPXFRDOBJ
) $(SHAREDOBJ
) \
233 ypxfr
: $(YPXFROBJ
) $(COMMONOBJ
) $(YPMASTEROBJ
) $(SHAREDOBJ
)
234 $(LINK.
cc) -o
$@
$(YPXFROBJ
) $(YPMASTEROBJ
) $(COMMONOBJ
) \
235 $(SHAREDOBJ
) $(LDLIBS
)
238 ypserv
: $(YPSERVOBJ
) $(COMMONOBJ
) $(SHAREDOBJ
)
239 $(LINK.
cc) $(YPSERVOBJ
) $(COMMONOBJ
) \
240 $(SHAREDOBJ
) -o
$@
$(LDLIBS
)
243 yppush
: $(YPPUSHOBJ
) $(COMMONOBJ
)
244 $(LINK.c
) $(YPPUSHOBJ
) $(COMMONOBJ
) -o
$@
$(LDLIBS
)
247 udpublickey
: $(UDPUBLICKEYOBJ
)
248 $(LINK.c
) $(UDPUBLICKEYOBJ
) -o
$@
$(LDLIBS
)
251 mkalias
: $(MKALIASOBJ
)
252 $(LINK.c
) $(MKALIASOBJ
) -o
$@
$(LDLIBS
)
255 stdethers
: $(STDETHERSOBJ
)
256 $(LINK.c
) $(STDETHERSOBJ
) -o
$@
$(LDLIBS
)
259 stdhosts
: $(STDHOSTSOBJ
)
260 $(LINK.c
) $(STDHOSTSOBJ
) -o
$@
$(LDLIBS
)
263 install: all $(PROG
) $(ROOTDIRS
) $(ROOTETCFILE
) $(ROOTYPFILES
) $(IBINPROG
) \
264 $(ISBINPROG
) $(INETYPPROG
) $(INIS2LDAPPROG
) $(SUBDIRS
) $(ROOTMANIFEST
) \
271 @cd
$@
; pwd
; $(MAKE
) $(TARGET
)
273 lint
:= CPPFLAGS
+= -I
$(SRC
)/lib
/libnisdb
/yptol
276 $(LINT.c
) ypmatch.c nick.c
-lnsl
277 $(LINT.c
) ypwhich.c nick.c
-lnsl
278 $(LINT.c
) ypcat.c nick.c
-lnsl
279 $(LINT.c
) makedbm.c getlist.c yp_getalias.c
280 $(LINT.c
) ypalias.c getlist.c yp_getalias.c
281 $(LINT.c
) yp_b_svc.c yp_b_subr.c rpc_bootstrap.c getlist.c
-lnsl
282 $(LINT.c
) ypxfr.c ypxfrd_client.c ypxfrd_xdr.c getlist.c yp_getalias.c \
283 .
/shared
/utils.c .
/shared
/lockmap.c .
/shared
/ancil.c
-lnsl
284 $(LINT.c
) yppush.c getlist.c yp_getalias.c
-lnsl
285 $(LINT.c
) udpublickey.c
286 $(LINT.c
) mkalias.c
-lnsl
287 $(LINT.c
) stdethers.c
-lsocket
288 $(LINT.c
) stdhosts.c
-lnsl
289 $(LINT.c
) ypxfrd_svc.c ypxfrd_xdr.c ypxfrd_server.c \
290 ypserv_net_secure.c \
291 .
/shared
/utils.c .
/shared
/lockmap.c .
/shared
/ancil.c \
293 $(LINT.c
) ypserv.c ypserv_map.c ypserv_proc.c ypserv_ancil.c \
294 ypserv_resolv.c ypserv_resolv_common.c ypv1_xdr.c \
295 ypserv_net_secure.c getlist.c yp_getalias.c \
296 .
/shared
/utils.c .
/shared
/lockmap.c .
/shared
/ancil.c \
299 check: $(CHKMANIFEST
)
302 ${CSTYLE} `echo $(SRCS) | sed 's/ypinit.c//'`
305 $(RM
) $(OBJS
) $(CLEANFILES
)
307 clobber: clean $(SUBDIRS
)
311 include ..
/Makefile.targ