xref: /illumos-gate/usr/src/lib/libnsl/Makefile (revision 241c90a0)
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
545916cd2Sjpk# Common Development and Distribution License (the "License").
645916cd2Sjpk# You may not use this file except in compliance with the License.
77c478bd9Sstevel@tonic-gate#
87c478bd9Sstevel@tonic-gate# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
97c478bd9Sstevel@tonic-gate# or http://www.opensolaris.org/os/licensing.
107c478bd9Sstevel@tonic-gate# See the License for the specific language governing permissions
117c478bd9Sstevel@tonic-gate# and limitations under the License.
127c478bd9Sstevel@tonic-gate#
137c478bd9Sstevel@tonic-gate# When distributing Covered Code, include this CDDL HEADER in each
147c478bd9Sstevel@tonic-gate# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
157c478bd9Sstevel@tonic-gate# If applicable, add the following below this CDDL HEADER, with the
167c478bd9Sstevel@tonic-gate# fields enclosed by brackets "[]" replaced with your own identifying
177c478bd9Sstevel@tonic-gate# information: Portions Copyright [yyyy] [name of copyright owner]
187c478bd9Sstevel@tonic-gate#
197c478bd9Sstevel@tonic-gate# CDDL HEADER END
207c478bd9Sstevel@tonic-gate#
217c478bd9Sstevel@tonic-gate#
2236e852a1SRaja Andra# Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
237c478bd9Sstevel@tonic-gate# Use is subject to license terms.
247c478bd9Sstevel@tonic-gate#
257c478bd9Sstevel@tonic-gate#
26f808c858Sraf
2745916cd2SjpkPROTOCOL_DIR= $(ROOTHDRDIR)/rpcsvc
287c478bd9Sstevel@tonic-gatePROTOCOL_SRCDIR= $(SRC)/head/rpcsvc
297c478bd9Sstevel@tonic-gatePROTOCOL_UTS_SRCDIR= $(SRC)/uts/common/rpc
307c478bd9Sstevel@tonic-gate
31f808c858SrafSUBDIRS =	$(MACH)
32f808c858Sraf$(BUILD64)SUBDIRS += $(MACH64)
337c478bd9Sstevel@tonic-gate
347c478bd9Sstevel@tonic-gate# objects are listed by source directory
357c478bd9Sstevel@tonic-gate
367c478bd9Sstevel@tonic-gate# common utility code used in more than one directory
3761961e0fSrobinsonRPC_DERIVED_FILES=
387c478bd9Sstevel@tonic-gate
397c478bd9Sstevel@tonic-gateGEN_DERIVED_FILES= \
4036e852a1SRaja Andra	nis/gen/nis_clnt.h
417c478bd9Sstevel@tonic-gate
427c478bd9Sstevel@tonic-gate
437c478bd9Sstevel@tonic-gatePROTOCOL_FILES= \
447c478bd9Sstevel@tonic-gate	$(PROTOCOL_DIR)/daemon_utils.h	\
457c478bd9Sstevel@tonic-gate	$(PROTOCOL_DIR)/nis.x		\
467c478bd9Sstevel@tonic-gate	$(PROTOCOL_DIR)/nis.h		\
4736e852a1SRaja Andra	$(PROTOCOL_DIR)/nis_object.x
487c478bd9Sstevel@tonic-gate
497c478bd9Sstevel@tonic-gatePROTOCOL_FILES_UTS= \
507c478bd9Sstevel@tonic-gate	$(PROTOCOL_DIR)/key_prot.x
517c478bd9Sstevel@tonic-gate
5236e852a1SRaja AndraDERIVED_FILES= $(GEN_DERIVED_FILES) $(RPC_DERIVED_FILES)
537c478bd9Sstevel@tonic-gate
547c478bd9Sstevel@tonic-gate#
557c478bd9Sstevel@tonic-gate# Make sure they get cleaned when necessary
567c478bd9Sstevel@tonic-gate#
577c478bd9Sstevel@tonic-gateCLEANFILES += $(DERIVED_FILES)
587c478bd9Sstevel@tonic-gate
597c478bd9Sstevel@tonic-gate# include library definitions
607c478bd9Sstevel@tonic-gateinclude ../Makefile.lib
617c478bd9Sstevel@tonic-gate
6245916cd2Sjpk# header file delivered to /usr/include; internal to ON build process
6345916cd2SjpkHDRS =		nss.h
6445916cd2SjpkHDRDIR =	nss
657c478bd9Sstevel@tonic-gate
667c478bd9Sstevel@tonic-gateLIBRARY= libnsl.a
677c478bd9Sstevel@tonic-gateTEXT_DOMAIN= SUNW_OST_NETRPC
687c478bd9Sstevel@tonic-gatePOFILE= $(LIBRARY:.a=.po)
697c478bd9Sstevel@tonic-gatePOFILES= generic.po _errlst.po
707c478bd9Sstevel@tonic-gate
717c478bd9Sstevel@tonic-gateall :=		TARGET= all
727c478bd9Sstevel@tonic-gateclean :=	TARGET= clean
737c478bd9Sstevel@tonic-gateclobber :=	TARGET= clobber
747c478bd9Sstevel@tonic-gatedelete :=	TARGET= delete
757c478bd9Sstevel@tonic-gateinstall :=	TARGET= install
767c478bd9Sstevel@tonic-gate_msg :=		TARGET= _msg
777c478bd9Sstevel@tonic-gatepackage :=	TARGET= package
787c478bd9Sstevel@tonic-gate
797c478bd9Sstevel@tonic-gate
807c478bd9Sstevel@tonic-gate.KEEP_STATE:
817c478bd9Sstevel@tonic-gate
8233ec2264Sthall:		$(PROTOCOL_DIR) $(DERIVED_FILES) .WAIT $(SUBDIRS)
837c478bd9Sstevel@tonic-gate
847c478bd9Sstevel@tonic-gateheaders:	$(PROTOCOL_DIR) .WAIT $(PROTOCOL_FILES) $(PROTOCOL_FILES_UTS) \
857c478bd9Sstevel@tonic-gate		$(DERIVED_FILES)
867c478bd9Sstevel@tonic-gate
87f808c858Srafinstall:	all .WAIT $(SUBDIRS)
887c478bd9Sstevel@tonic-gate
8945916cd2Sjpkinstall_h:	$(ROOTHDRS)
9045916cd2Sjpk
9145916cd2Sjpk# nss.h isn't delivered; no reason to check
9245916cd2Sjpkcheck:
9345916cd2Sjpk
94*241c90a0SRichard Loweclean clobber delete package:	$(SUBDIRS)
957c478bd9Sstevel@tonic-gate
967c478bd9Sstevel@tonic-gate$(PROTOCOL_DIR):
977c478bd9Sstevel@tonic-gate	$(INS.dir)
987c478bd9Sstevel@tonic-gate
997c478bd9Sstevel@tonic-gate$(PROTOCOL_DIR)/%.h:	$(PROTOCOL_SRCDIR)/%.h
1007c478bd9Sstevel@tonic-gate	$(INS.file)
1017c478bd9Sstevel@tonic-gate
1027c478bd9Sstevel@tonic-gate$(PROTOCOL_DIR)/nis.h:	$(PROTOCOL_SRCDIR)/nis.x $(PROTOCOL_SRCDIR)/nis_object.x
1037c478bd9Sstevel@tonic-gate	$(RPCGEN) -C -h $(PROTOCOL_SRCDIR)/nis.x > nis-tmp.h
1047c478bd9Sstevel@tonic-gate	$(SED) -e '/EDIT_START/,$$ d' < nis-tmp.h > nis.h
1057c478bd9Sstevel@tonic-gate	$(RM) $@
1067c478bd9Sstevel@tonic-gate	$(INS) -s -m $(FILEMODE) -f $(@D) nis.h
1077c478bd9Sstevel@tonic-gate	$(RM) nis.h nis-tmp.h
1087c478bd9Sstevel@tonic-gate
1097c478bd9Sstevel@tonic-gate$(PROTOCOL_DIR)/%.x:	$(PROTOCOL_SRCDIR)/%.x
1107c478bd9Sstevel@tonic-gate	$(INS.file)
1117c478bd9Sstevel@tonic-gate
1127c478bd9Sstevel@tonic-gate$(PROTOCOL_DIR)/%.x:	$(PROTOCOL_UTS_SRCDIR)/%.x
1137c478bd9Sstevel@tonic-gate	$(INS.file)
1147c478bd9Sstevel@tonic-gate
1157c478bd9Sstevel@tonic-gate#
1167c478bd9Sstevel@tonic-gate# Rules for building the derived files
1177c478bd9Sstevel@tonic-gate#
1187c478bd9Sstevel@tonic-gate# Derived header files
1197c478bd9Sstevel@tonic-gate#
120*241c90a0SRichard Lowenis/gen/nis_clnt.h: $(PROTOCOL_DIR)/nis.x $(PROTOCOL_DIR)/nis_object.x
1217c478bd9Sstevel@tonic-gate	$(RPCGEN) -C -h $(PROTOCOL_DIR)/nis.x > nis_clnt-gen.h
1227c478bd9Sstevel@tonic-gate	$(SED) -n -e '/EDIT_START/,$$ p' < nis_clnt-gen.h |\
1237c478bd9Sstevel@tonic-gate	$(SED) -e 's/_3_svc/_svc/' |\
1247c478bd9Sstevel@tonic-gate	$(SED) -e 's/_3/_clnt/' > $@
1257c478bd9Sstevel@tonic-gate	$(RM) nis_clnt-gen.h
1267c478bd9Sstevel@tonic-gate
1277c478bd9Sstevel@tonic-gate#
1287c478bd9Sstevel@tonic-gate# Derived source files
1297c478bd9Sstevel@tonic-gate#
1307c478bd9Sstevel@tonic-gate
1317c478bd9Sstevel@tonic-gate# include library targets
1327c478bd9Sstevel@tonic-gateinclude ../Makefile.targ
1337c478bd9Sstevel@tonic-gate
1347c478bd9Sstevel@tonic-gate_msg: $(MSGDOMAIN) $(POFILE)
1357c478bd9Sstevel@tonic-gate	$(RM) $(MSGDOMAIN)/$(POFILE)
1367c478bd9Sstevel@tonic-gate	$(CP) $(POFILE) $(MSGDOMAIN)
1377c478bd9Sstevel@tonic-gate
1387c478bd9Sstevel@tonic-gate$(POFILE): $(DERIVED_FILES) .WAIT $(POFILES)
1397c478bd9Sstevel@tonic-gate	$(RM) $@
1407c478bd9Sstevel@tonic-gate	$(CAT) $(POFILES) > $@
1417c478bd9Sstevel@tonic-gate
1427c478bd9Sstevel@tonic-gate_errlst.po:
1437c478bd9Sstevel@tonic-gate	$(RM) messages.po
1447c478bd9Sstevel@tonic-gate	$(XGETTEXT) -a nsl/_errlst.c
1457c478bd9Sstevel@tonic-gate	$(SED) -e '/^# msg/d' -e '/^domain/d' messages.po > $@
1467c478bd9Sstevel@tonic-gate	$(RM) messages.po
1477c478bd9Sstevel@tonic-gate
1487c478bd9Sstevel@tonic-gategeneric.po:
1497c478bd9Sstevel@tonic-gate	$(RM) messages.po
1507c478bd9Sstevel@tonic-gate	$(XGETTEXT) $(XGETFLAGS) `$(GREP) -l gettext */*.[ch] nis/*/*.[ch]*`
1517c478bd9Sstevel@tonic-gate	$(SED) -e '/^# msg/d' -e '/^domain/d' messages.po > $@
1527c478bd9Sstevel@tonic-gate	$(RM) messages.po
1537c478bd9Sstevel@tonic-gate
1547c478bd9Sstevel@tonic-gate$(MSGDOMAIN):
1557c478bd9Sstevel@tonic-gate	$(INS.dir)
1567c478bd9Sstevel@tonic-gate
157f808c858Sraf$(SUBDIRS):	FRC
1587c478bd9Sstevel@tonic-gate	@cd $@; pwd; $(MAKE) $(TARGET)
1597c478bd9Sstevel@tonic-gate
1607c478bd9Sstevel@tonic-gateFRC:
161