xref: /illumos-gate/usr/src/lib/libnsl/Makefile (revision e8031f0a8ed0e45c6d8847c5e09424e66fd34a4b)
17c478bd9Sstevel@tonic-gate#
27c478bd9Sstevel@tonic-gate# CDDL HEADER START
37c478bd9Sstevel@tonic-gate#
47c478bd9Sstevel@tonic-gate# The contents of this file are subject to the terms of the
57c478bd9Sstevel@tonic-gate# Common Development and Distribution License, Version 1.0 only
67c478bd9Sstevel@tonic-gate# (the "License").  You may not use this file except in compliance
77c478bd9Sstevel@tonic-gate# with the License.
87c478bd9Sstevel@tonic-gate#
97c478bd9Sstevel@tonic-gate# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
107c478bd9Sstevel@tonic-gate# or http://www.opensolaris.org/os/licensing.
117c478bd9Sstevel@tonic-gate# See the License for the specific language governing permissions
127c478bd9Sstevel@tonic-gate# and limitations under the License.
137c478bd9Sstevel@tonic-gate#
147c478bd9Sstevel@tonic-gate# When distributing Covered Code, include this CDDL HEADER in each
157c478bd9Sstevel@tonic-gate# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
167c478bd9Sstevel@tonic-gate# If applicable, add the following below this CDDL HEADER, with the
177c478bd9Sstevel@tonic-gate# fields enclosed by brackets "[]" replaced with your own identifying
187c478bd9Sstevel@tonic-gate# information: Portions Copyright [yyyy] [name of copyright owner]
197c478bd9Sstevel@tonic-gate#
207c478bd9Sstevel@tonic-gate# CDDL HEADER END
217c478bd9Sstevel@tonic-gate#
227c478bd9Sstevel@tonic-gate#
23*e8031f0aSraf# Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
247c478bd9Sstevel@tonic-gate# Use is subject to license terms.
257c478bd9Sstevel@tonic-gate#
267c478bd9Sstevel@tonic-gate# ident	"%Z%%M%	%I%	%E% SMI"
277c478bd9Sstevel@tonic-gate#
287c478bd9Sstevel@tonic-gate# lib/libnsl/Makefile
297c478bd9Sstevel@tonic-gate#
307c478bd9Sstevel@tonic-gatePROTOCOL_DIR= $(ROOT)/usr/include/rpcsvc
317c478bd9Sstevel@tonic-gatePROTOCOL_SRCDIR= $(SRC)/head/rpcsvc
327c478bd9Sstevel@tonic-gatePROTOCOL_UTS_SRCDIR= $(SRC)/uts/common/rpc
337c478bd9Sstevel@tonic-gate
347c478bd9Sstevel@tonic-gateSUBDIRS = spec .WAIT $(MACH) $(BUILD64) .WAIT $(MACH64)
357c478bd9Sstevel@tonic-gate
367c478bd9Sstevel@tonic-gate# objects are listed by source directory
377c478bd9Sstevel@tonic-gate
387c478bd9Sstevel@tonic-gate# common utility code used in more than one directory
3961961e0fSrobinsonRPC_DERIVED_FILES=
407c478bd9Sstevel@tonic-gate
417c478bd9Sstevel@tonic-gateGEN_DERIVED_FILES= \
427c478bd9Sstevel@tonic-gate	nis/gen/nis_clnt.h      \
4361961e0fSrobinson	nis/gen/nis_clnt.c
447c478bd9Sstevel@tonic-gate
457c478bd9Sstevel@tonic-gateCACHE_DERIVED_FILES= \
467c478bd9Sstevel@tonic-gate	nis/cache/nis_clnt.h	\
477c478bd9Sstevel@tonic-gate	nis/cache/nis_cache.h	\
487c478bd9Sstevel@tonic-gate	nis/cache/nis_cache_clnt.cc \
497c478bd9Sstevel@tonic-gate	nis/cache/nis_cache_xdr.cc
507c478bd9Sstevel@tonic-gate
517c478bd9Sstevel@tonic-gatePROTOCOL_FILES= \
527c478bd9Sstevel@tonic-gate	$(PROTOCOL_DIR)/daemon_utils.h	\
537c478bd9Sstevel@tonic-gate	$(PROTOCOL_DIR)/nis.x		\
547c478bd9Sstevel@tonic-gate	$(PROTOCOL_DIR)/nis.h		\
557c478bd9Sstevel@tonic-gate	$(PROTOCOL_DIR)/nis_object.x	\
567c478bd9Sstevel@tonic-gate	$(PROTOCOL_DIR)/nis_callback.x	\
577c478bd9Sstevel@tonic-gate	$(PROTOCOL_DIR)/nis_callback.h	\
587c478bd9Sstevel@tonic-gate	$(PROTOCOL_DIR)/nis_cache.x	\
597c478bd9Sstevel@tonic-gate	$(PROTOCOL_DIR)/nis_cache.h
607c478bd9Sstevel@tonic-gate
617c478bd9Sstevel@tonic-gatePROTOCOL_FILES_UTS= \
627c478bd9Sstevel@tonic-gate	$(PROTOCOL_DIR)/key_prot.x
637c478bd9Sstevel@tonic-gate
647c478bd9Sstevel@tonic-gateDERIVED_FILES= $(GEN_DERIVED_FILES) $(CACHE_DERIVED_FILES) $(RPC_DERIVED_FILES)
657c478bd9Sstevel@tonic-gate
667c478bd9Sstevel@tonic-gate#
677c478bd9Sstevel@tonic-gate# Make sure they get cleaned when necessary
687c478bd9Sstevel@tonic-gate#
697c478bd9Sstevel@tonic-gateCLEANFILES += $(DERIVED_FILES)
707c478bd9Sstevel@tonic-gate
717c478bd9Sstevel@tonic-gate# include library definitions
727c478bd9Sstevel@tonic-gateinclude ../Makefile.lib
737c478bd9Sstevel@tonic-gate
747c478bd9Sstevel@tonic-gateSED=	sed
757c478bd9Sstevel@tonic-gateCP=	cp
767c478bd9Sstevel@tonic-gateGREP=	grep
777c478bd9Sstevel@tonic-gate
787c478bd9Sstevel@tonic-gateLIBRARY= libnsl.a
797c478bd9Sstevel@tonic-gateTEXT_DOMAIN= SUNW_OST_NETRPC
807c478bd9Sstevel@tonic-gatePOFILE= $(LIBRARY:.a=.po)
817c478bd9Sstevel@tonic-gatePOFILES= generic.po _errlst.po
827c478bd9Sstevel@tonic-gate
837c478bd9Sstevel@tonic-gateall :=		TARGET= all
847c478bd9Sstevel@tonic-gateclean :=	TARGET= clean
857c478bd9Sstevel@tonic-gateclobber :=	TARGET= clobber
867c478bd9Sstevel@tonic-gatedelete :=	TARGET= delete
877c478bd9Sstevel@tonic-gateinstall :=	TARGET= install
887c478bd9Sstevel@tonic-gatelint :=		TARGET= lint
897c478bd9Sstevel@tonic-gate_msg :=		TARGET= _msg
907c478bd9Sstevel@tonic-gatepackage :=	TARGET= package
917c478bd9Sstevel@tonic-gate
927c478bd9Sstevel@tonic-gate
937c478bd9Sstevel@tonic-gate.KEEP_STATE:
947c478bd9Sstevel@tonic-gate
9533ec2264Sth160488all:		$(PROTOCOL_DIR) $(DERIVED_FILES) .WAIT $(SUBDIRS)
967c478bd9Sstevel@tonic-gate
977c478bd9Sstevel@tonic-gateheaders:	$(PROTOCOL_DIR) .WAIT $(PROTOCOL_FILES) $(PROTOCOL_FILES_UTS) \
987c478bd9Sstevel@tonic-gate		$(DERIVED_FILES)
997c478bd9Sstevel@tonic-gate
1007c478bd9Sstevel@tonic-gateinstall:	all $(SUBDIRS)
1017c478bd9Sstevel@tonic-gate
1027c478bd9Sstevel@tonic-gateclean clobber delete lint package:	$(SUBDIRS)
1037c478bd9Sstevel@tonic-gate
1047c478bd9Sstevel@tonic-gate$(PROTOCOL_DIR):
1057c478bd9Sstevel@tonic-gate	$(INS.dir)
1067c478bd9Sstevel@tonic-gate
1077c478bd9Sstevel@tonic-gate$(PROTOCOL_DIR)/%.h:	$(PROTOCOL_SRCDIR)/%.h
1087c478bd9Sstevel@tonic-gate	$(INS.file)
1097c478bd9Sstevel@tonic-gate
1107c478bd9Sstevel@tonic-gate$(PROTOCOL_DIR)/nis.h:	$(PROTOCOL_SRCDIR)/nis.x $(PROTOCOL_SRCDIR)/nis_object.x
1117c478bd9Sstevel@tonic-gate	$(RPCGEN) -C -h $(PROTOCOL_SRCDIR)/nis.x > nis-tmp.h
1127c478bd9Sstevel@tonic-gate	$(SED) -e '/EDIT_START/,$$ d' < nis-tmp.h > nis.h
1137c478bd9Sstevel@tonic-gate	$(RM) $@
1147c478bd9Sstevel@tonic-gate	$(INS) -s -m $(FILEMODE) -f $(@D) nis.h
1157c478bd9Sstevel@tonic-gate	$(RM) nis.h nis-tmp.h
1167c478bd9Sstevel@tonic-gate
1177c478bd9Sstevel@tonic-gate$(PROTOCOL_DIR)/nis_callback.h:	$(PROTOCOL_SRCDIR)/nis_callback.x
1187c478bd9Sstevel@tonic-gate	$(RPCGEN) -C -h $(PROTOCOL_SRCDIR)/nis_callback.x -o nis_callback.h
1197c478bd9Sstevel@tonic-gate	$(RM) $@
1207c478bd9Sstevel@tonic-gate	$(INS) -s -m $(FILEMODE) -f $(@D) nis_callback.h
1217c478bd9Sstevel@tonic-gate	$(RM) nis_callback.h
1227c478bd9Sstevel@tonic-gate
1237c478bd9Sstevel@tonic-gate$(PROTOCOL_DIR)/nis_cache.h:	$(PROTOCOL_SRCDIR)/nis_cache.x
1247c478bd9Sstevel@tonic-gate	$(RPCGEN) -C -h $(PROTOCOL_SRCDIR)/nis_cache.x -o nis_cache.h
1257c478bd9Sstevel@tonic-gate	$(RM) $@
1267c478bd9Sstevel@tonic-gate	$(INS) -s -m $(FILEMODE) -f $(@D) nis_cache.h
1277c478bd9Sstevel@tonic-gate	$(RM) nis_cache.h
1287c478bd9Sstevel@tonic-gate
1297c478bd9Sstevel@tonic-gate$(PROTOCOL_DIR)/%.x:	$(PROTOCOL_SRCDIR)/%.x
1307c478bd9Sstevel@tonic-gate	$(INS.file)
1317c478bd9Sstevel@tonic-gate
1327c478bd9Sstevel@tonic-gate$(PROTOCOL_DIR)/%.x:	$(PROTOCOL_UTS_SRCDIR)/%.x
1337c478bd9Sstevel@tonic-gate	$(INS.file)
1347c478bd9Sstevel@tonic-gate
1357c478bd9Sstevel@tonic-gate#
1367c478bd9Sstevel@tonic-gate# Rules for building the derived files
1377c478bd9Sstevel@tonic-gate#
1387c478bd9Sstevel@tonic-gate# Derived header files
1397c478bd9Sstevel@tonic-gate#
1407c478bd9Sstevel@tonic-gatenis/gen/nis_clnt.h: $(PROTOCOL_DIR)/nis.x $(PROTOCOL_DIR)/nis_object.x
1417c478bd9Sstevel@tonic-gate	$(RPCGEN) -C -h $(PROTOCOL_DIR)/nis.x > nis_clnt-gen.h
1427c478bd9Sstevel@tonic-gate	$(SED) -n -e '/EDIT_START/,$$ p' < nis_clnt-gen.h |\
1437c478bd9Sstevel@tonic-gate	$(SED) -e 's/_3_svc/_svc/' |\
1447c478bd9Sstevel@tonic-gate	$(SED) -e 's/_3/_clnt/' > $@
1457c478bd9Sstevel@tonic-gate	$(RM) nis_clnt-gen.h
1467c478bd9Sstevel@tonic-gate
1477c478bd9Sstevel@tonic-gatenis/cache/nis_clnt.h: $(PROTOCOL_DIR)/nis.x $(PROTOCOL_DIR)/nis_object.x
1487c478bd9Sstevel@tonic-gate	$(RPCGEN) -C -h $(PROTOCOL_DIR)/nis.x > nis_clnt-cache.h
1497c478bd9Sstevel@tonic-gate	$(SED) -n -e '/EDIT_START/,$$ p' < nis_clnt-cache.h |\
1507c478bd9Sstevel@tonic-gate	$(SED) -e 's/_3_svc/_svc/' |\
1517c478bd9Sstevel@tonic-gate	$(SED) -e 's/_3/_clnt/' > $@
1527c478bd9Sstevel@tonic-gate	$(RM) nis_clnt-cache.h
1537c478bd9Sstevel@tonic-gate
1547c478bd9Sstevel@tonic-gate#
1557c478bd9Sstevel@tonic-gate# Derived source files
1567c478bd9Sstevel@tonic-gate#
1577c478bd9Sstevel@tonic-gatenis/gen/nis_clnt.c: $(PROTOCOL_DIR)/nis.x $(PROTOCOL_DIR)/nis_object.x
1587c478bd9Sstevel@tonic-gate	$(RPCGEN) -C -l $(PROTOCOL_DIR)/nis.x > nis_clnt-tmp.c
1597c478bd9Sstevel@tonic-gate	$(SED) -e 's!\"$(PROTOCOL_DIR)/nis.h\"!\<rpcsvc/nis.h\>!' \
1607c478bd9Sstevel@tonic-gate	    < nis_clnt-tmp.c |\
161*e8031f0aSraf	$(SED) -e '/#include <memory.h>/i\
162*e8031f0aSraf#include "mt.h"' |\
1637c478bd9Sstevel@tonic-gate	$(SED) -e 's/_3/_clnt/' > $@
1647c478bd9Sstevel@tonic-gate	$(RM) nis_clnt-tmp.c
1657c478bd9Sstevel@tonic-gate
1667c478bd9Sstevel@tonic-gatenis/cache/nis_cache_xdr.cc: $(PROTOCOL_DIR)/nis_cache.x
1677c478bd9Sstevel@tonic-gate	$(RPCGEN) -C -c $(PROTOCOL_DIR)/nis_cache.x |\
1687c478bd9Sstevel@tonic-gate        $(SED) -e 's!\"$(PROTOCOL_DIR)/nis_cache.h\"!"nis_cache.h"!' > $@
1697c478bd9Sstevel@tonic-gate
1707c478bd9Sstevel@tonic-gatenis/cache/nis_cache_clnt.cc: $(PROTOCOL_DIR)/nis_cache.x
1717c478bd9Sstevel@tonic-gate	$(RPCGEN) -C -l $(PROTOCOL_DIR)/nis_cache.x |\
172*e8031f0aSraf	$(SED) -e '/#include <memory.h>/i\
173*e8031f0aSraf#include "mt.h"' |\
1747c478bd9Sstevel@tonic-gate        $(SED) -e 's!\"$(PROTOCOL_DIR)/nis_cache.h\"!"nis_cache.h"!' > $@
1757c478bd9Sstevel@tonic-gate
1767c478bd9Sstevel@tonic-gatenis/cache/nis_cache.h: $(PROTOCOL_DIR)/nis_cache.x
1777c478bd9Sstevel@tonic-gate	$(RPCGEN) -C -h $(PROTOCOL_DIR)/nis_cache.x |\
1787c478bd9Sstevel@tonic-gate        $(SED) -e 's!\"$(PROTOCOL_DIR)/nis_cache.h\"!"nis_cache.h"!' > $@
1797c478bd9Sstevel@tonic-gate
1807c478bd9Sstevel@tonic-gate# include library targets
1817c478bd9Sstevel@tonic-gateinclude ../Makefile.targ
1827c478bd9Sstevel@tonic-gate
1837c478bd9Sstevel@tonic-gate# EXPORT DELETE START
1847c478bd9Sstevel@tonic-gate# CRYPT DELETE START
1857c478bd9Sstevel@tonic-gate# Special target to clean up the source tree for export distribution
1867c478bd9Sstevel@tonic-gate# Warning: This target changes the source tree
1877c478bd9Sstevel@tonic-gateEXPORT_SRC:
1887c478bd9Sstevel@tonic-gate	$(RM) Makefile+ des/des_crypt.c+ des/des_soft.c+ key/xcrypt.c+
1897c478bd9Sstevel@tonic-gate	$(SED) -e "/EXPORT DELETE START/,/EXPORT DELETE END/d" \
1907c478bd9Sstevel@tonic-gate		< des/des_crypt.c > des/des_crypt.c+
1917c478bd9Sstevel@tonic-gate	$(MV) des/des_crypt.c+ des/des_crypt.c
1927c478bd9Sstevel@tonic-gate	$(SED) -e "/EXPORT DELETE START/,/EXPORT DELETE END/d" \
1937c478bd9Sstevel@tonic-gate		< des/des_soft.c > des/des_soft.c+
1947c478bd9Sstevel@tonic-gate	$(MV) des/des_soft.c+ des/des_soft.c
1957c478bd9Sstevel@tonic-gate	$(SED) -e "/EXPORT DELETE START/,/EXPORT DELETE END/d" \
1967c478bd9Sstevel@tonic-gate		< key/xcrypt.c > key/xcrypt.c+
1977c478bd9Sstevel@tonic-gate	$(MV) key/xcrypt.c+ key/xcrypt.c
1987c478bd9Sstevel@tonic-gate	$(SED) -e "/^# EXPORT DELETE START/,/^# EXPORT DELETE END/d" \
1997c478bd9Sstevel@tonic-gate		< Makefile > Makefile+
2007c478bd9Sstevel@tonic-gate	$(MV) Makefile+ Makefile
2017c478bd9Sstevel@tonic-gate	$(CHMOD) 444 Makefile des/des_crypt.c des/des_soft.c key/xcrypt.c
2027c478bd9Sstevel@tonic-gate
2037c478bd9Sstevel@tonic-gateCRYPT_SRC:
2047c478bd9Sstevel@tonic-gate	$(RM) Makefile+
2057c478bd9Sstevel@tonic-gate	$(SED) -e "/^# CRYPT DELETE START/,/^# CRYPT DELETE END/d"	\
2067c478bd9Sstevel@tonic-gate			< Makefile 				\
2077c478bd9Sstevel@tonic-gate	   | $(SED) -e "/EXPORT DELETE/d"				\
2087c478bd9Sstevel@tonic-gate			> Makefile+
2097c478bd9Sstevel@tonic-gate	$(MV) Makefile+ Makefile
2107c478bd9Sstevel@tonic-gate	$(CHMOD) 444 Makefile
2117c478bd9Sstevel@tonic-gate
2127c478bd9Sstevel@tonic-gate# CRYPT DELETE END
2137c478bd9Sstevel@tonic-gate# EXPORT DELETE END
2147c478bd9Sstevel@tonic-gate
2157c478bd9Sstevel@tonic-gate_msg: $(MSGDOMAIN) $(POFILE)
2167c478bd9Sstevel@tonic-gate	$(RM) $(MSGDOMAIN)/$(POFILE)
2177c478bd9Sstevel@tonic-gate	$(CP) $(POFILE) $(MSGDOMAIN)
2187c478bd9Sstevel@tonic-gate
2197c478bd9Sstevel@tonic-gate$(POFILE): $(DERIVED_FILES) .WAIT $(POFILES)
2207c478bd9Sstevel@tonic-gate	$(RM) $@
2217c478bd9Sstevel@tonic-gate	$(CAT) $(POFILES) > $@
2227c478bd9Sstevel@tonic-gate
2237c478bd9Sstevel@tonic-gate_errlst.po:
2247c478bd9Sstevel@tonic-gate	$(RM) messages.po
2257c478bd9Sstevel@tonic-gate	$(XGETTEXT) -a nsl/_errlst.c
2267c478bd9Sstevel@tonic-gate	$(SED) -e '/^# msg/d' -e '/^domain/d' messages.po > $@
2277c478bd9Sstevel@tonic-gate	$(RM) messages.po
2287c478bd9Sstevel@tonic-gate
2297c478bd9Sstevel@tonic-gategeneric.po:
2307c478bd9Sstevel@tonic-gate	$(RM) messages.po
2317c478bd9Sstevel@tonic-gate	$(XGETTEXT) $(XGETFLAGS) `$(GREP) -l gettext */*.[ch] nis/*/*.[ch]*`
2327c478bd9Sstevel@tonic-gate	$(SED) -e '/^# msg/d' -e '/^domain/d' messages.po > $@
2337c478bd9Sstevel@tonic-gate	$(RM) messages.po
2347c478bd9Sstevel@tonic-gate
2357c478bd9Sstevel@tonic-gate$(MSGDOMAIN):
2367c478bd9Sstevel@tonic-gate	$(INS.dir)
2377c478bd9Sstevel@tonic-gate
2387c478bd9Sstevel@tonic-gatespec $(MACH) $(MACH64) $(SPEC) $(SPEC64):      FRC
2397c478bd9Sstevel@tonic-gate	@cd $@; pwd; $(MAKE) $(TARGET)
2407c478bd9Sstevel@tonic-gate
2417c478bd9Sstevel@tonic-gateFRC:
242