xref: /titanic_44/usr/src/lib/libnisdb/Makefile (revision 7014882c6a3672fd0e5d60200af8643ae53c5928)
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
5f808c858Sraf# Common Development and Distribution License (the "License").
6f808c858Sraf# 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#
267c478bd9Sstevel@tonic-gate
277c478bd9Sstevel@tonic-gateLIBRARY= libnisdb.a
287c478bd9Sstevel@tonic-gateVERS=	.2
297c478bd9Sstevel@tonic-gatePROTOCOL_DIR= $(ROOT)/include/rpcsvc
307c478bd9Sstevel@tonic-gateYPTOL_DIR= ./yptol
317c478bd9Sstevel@tonic-gate
327c478bd9Sstevel@tonic-gateSED=	sed
337c478bd9Sstevel@tonic-gate
347c478bd9Sstevel@tonic-gateOBJECTS = \
357c478bd9Sstevel@tonic-gate	db_entry.o db_entry_c_xdr.o \
367c478bd9Sstevel@tonic-gate	db_item.o db_item_c_xdr.o \
377c478bd9Sstevel@tonic-gate	db_vers.o db_vers_c_xdr.o \
387c478bd9Sstevel@tonic-gate	db_pickle.o \
397c478bd9Sstevel@tonic-gate	db_table.o db_table_c_xdr.o \
407c478bd9Sstevel@tonic-gate	db_index_entry.o db_index_entry_c.o \
417c478bd9Sstevel@tonic-gate	db_index.o db_index_c_xdr.o \
427c478bd9Sstevel@tonic-gate	db_scheme.o db_scheme_c_xdr.o \
437c478bd9Sstevel@tonic-gate	db_query.o db_query_c_xdr.o \
447c478bd9Sstevel@tonic-gate	db_mindex.o db_mindex2.o db_mindex3.o db_mindex_c_xdr.o \
457c478bd9Sstevel@tonic-gate	db_log_entry.o db_log_entry_c_xdr.o \
467c478bd9Sstevel@tonic-gate	db_log.o \
477c478bd9Sstevel@tonic-gate	db.o \
487c478bd9Sstevel@tonic-gate	xdr_nullptr.o \
497c478bd9Sstevel@tonic-gate	db_dictionary.o db_dictionary_c_xdr.o \
507c478bd9Sstevel@tonic-gate	db_dictxdr.o db_dictlog.o db_dictlog_c_xdr.o \
517c478bd9Sstevel@tonic-gate	nis_db.o \
527c478bd9Sstevel@tonic-gate	nisdb_mt.o nisdb_rw.o \
5336e852a1SRaja Andra	nis_hashitem.o \
547c478bd9Sstevel@tonic-gate	ldap_attr.o ldap_cto.o ldap_glob.o ldap_ldap.o \
5536e852a1SRaja Andra	ldap_map.o ldap_nisdbquery.o \
567c478bd9Sstevel@tonic-gate	ldap_op.o ldap_parse.o ldap_print.o ldap_ruleval.o \
577c478bd9Sstevel@tonic-gate	ldap_util.o ldap_val.o ldap_xdr.o ldap_scheme.o \
587c478bd9Sstevel@tonic-gate	nis_ldap.o \
597c478bd9Sstevel@tonic-gate	nis_parse_ldap_attr.o nis_parse_ldap_conf.o \
607c478bd9Sstevel@tonic-gate	nis_parse_ldap_map.o nis_parse_ldap_util.o \
617c478bd9Sstevel@tonic-gate	nis_parse_ldap_yp_util.o	\
627c478bd9Sstevel@tonic-gate	dit_access.o \
637c478bd9Sstevel@tonic-gate	dit_access_utils.o \
647c478bd9Sstevel@tonic-gate	lock_update.o \
657c478bd9Sstevel@tonic-gate	map_conv.o \
667c478bd9Sstevel@tonic-gate	map_ctrl.o \
677c478bd9Sstevel@tonic-gate	yptol_utils.o \
687c478bd9Sstevel@tonic-gate	shim.o \
697c478bd9Sstevel@tonic-gate	shim_ancil.o \
707c478bd9Sstevel@tonic-gate	shim_lockmap.o \
717c478bd9Sstevel@tonic-gate	ttl_utils.o \
727c478bd9Sstevel@tonic-gate	update.o \
737c478bd9Sstevel@tonic-gate	shim_changepasswd.o \
747c478bd9Sstevel@tonic-gate	stubs.o
757c478bd9Sstevel@tonic-gate
767c478bd9Sstevel@tonic-gateX_FILES= \
777c478bd9Sstevel@tonic-gate    db_c.x             db_dictionary_c.x db_entry_c.x  db_index_c.x     \
787c478bd9Sstevel@tonic-gate    db_index_entry_c.x db_item_c.x       db_log_c.x    db_log_entry_c.x \
797c478bd9Sstevel@tonic-gate    db_mindex_c.x      db_query_c.x      db_scheme_c.x db_table_c.x     \
807c478bd9Sstevel@tonic-gate    db_vers_c.x	       db_dictlog_c.x
817c478bd9Sstevel@tonic-gate
827c478bd9Sstevel@tonic-gateDERIVED_HEADERS= $(X_FILES:%_c.x=%_c.h) $(X_FILES:%_c.x=%.h)
837c478bd9Sstevel@tonic-gateDERIVED_SOURCES= $(X_FILES:%_c.x=%_c_xdr.c)
847c478bd9Sstevel@tonic-gateDERIVED_FILES= $(DERIVED_HEADERS) $(DERIVED_SOURCES)
857c478bd9Sstevel@tonic-gate
867c478bd9Sstevel@tonic-gate# delete the derived files when cleaning up
877c478bd9Sstevel@tonic-gateCLEANFILES += $(DERIVED_FILES)
887c478bd9Sstevel@tonic-gate
897c478bd9Sstevel@tonic-gate# include library definitions
907c478bd9Sstevel@tonic-gateinclude ../Makefile.lib
917c478bd9Sstevel@tonic-gate
92f808c858SrafMAPFILES =	mapfile-vers
937c478bd9Sstevel@tonic-gate
947c478bd9Sstevel@tonic-gateSRCS= db_dictionary_c_xdr.c db_dictlog_c_xdr.c db_dictxdr.c \
957c478bd9Sstevel@tonic-gatedb_entry_c_xdr.c db_index_c_xdr.c db_index_entry_c_xdr.c db_item_c_xdr.c \
967c478bd9Sstevel@tonic-gatedb_log_c_xdr.c db_log_entry_c_xdr.c db_mindex_c_xdr.c db_query_c_xdr.c \
977c478bd9Sstevel@tonic-gatedb_scheme_c_xdr.c db_table_c_xdr.c db_vers_c_xdr.c \
987c478bd9Sstevel@tonic-gate$(YPTOL_DIR)/dit_access.c \
997c478bd9Sstevel@tonic-gate$(YPTOL_DIR)/dit_access_utils.c \
1007c478bd9Sstevel@tonic-gate$(YPTOL_DIR)/lock_update.c \
1017c478bd9Sstevel@tonic-gate$(YPTOL_DIR)/map_conv.c \
1027c478bd9Sstevel@tonic-gate$(YPTOL_DIR)/map_ctrl.c \
1037c478bd9Sstevel@tonic-gate$(YPTOL_DIR)/yptol_utils.c \
1047c478bd9Sstevel@tonic-gate$(YPTOL_DIR)/shim.c \
1057c478bd9Sstevel@tonic-gate$(YPTOL_DIR)/shim_ancil.c \
1067c478bd9Sstevel@tonic-gate$(YPTOL_DIR)/shim_lockmap.c \
1077c478bd9Sstevel@tonic-gate$(YPTOL_DIR)/ttl_utils.c \
1087c478bd9Sstevel@tonic-gate$(YPTOL_DIR)/update.c \
1097c478bd9Sstevel@tonic-gate$(YPTOL_DIR)/shim_changepasswd.c \
1107c478bd9Sstevel@tonic-gate$(YPTOL_DIR)/stubs.c \
1117c478bd9Sstevel@tonic-gate#db_c_xdr.c xdr_nullptr.c
1127c478bd9Sstevel@tonic-gate
1137c478bd9Sstevel@tonic-gate# Libnisdb has grown large enough that there may be too many symbols
1147c478bd9Sstevel@tonic-gate# wanting `small' PIC references. Hence, compile some files with
1157c478bd9Sstevel@tonic-gate# `large' PIC references; the parser files are good candidates, since
1167c478bd9Sstevel@tonic-gate# they're only used at startup, and performance isn't too important.
1177c478bd9Sstevel@tonic-gateLARGESYMS=	nis_parse_ldap_conf.o \
1187c478bd9Sstevel@tonic-gate		nis_parse_ldap_attr.o \
1197c478bd9Sstevel@tonic-gate		nis_parse_ldap_yp_util.o \
1207c478bd9Sstevel@tonic-gate		nis_parse_ldap_map.o \
1217c478bd9Sstevel@tonic-gate		ldap_parse.o \
1227c478bd9Sstevel@tonic-gate		dit_access.o \
1237c478bd9Sstevel@tonic-gate		dit_access_utilis.o \
1247c478bd9Sstevel@tonic-gate		map_conv.o \
1257c478bd9Sstevel@tonic-gate		map_ctrl.o \
1267c478bd9Sstevel@tonic-gate		shim.o \
1277c478bd9Sstevel@tonic-gate		shim_ancil.o \
1287c478bd9Sstevel@tonic-gate		shim_changepasswd.o \
1297c478bd9Sstevel@tonic-gate		update.o \
1307c478bd9Sstevel@tonic-gate		stubs.o \
1317c478bd9Sstevel@tonic-gate		yptol_utils.o \
1327c478bd9Sstevel@tonic-gate		nis_parse_ldap_util.o
1337c478bd9Sstevel@tonic-gateLARGEPICS=	$(LARGESYMS:%=pics/%)
1347c478bd9Sstevel@tonic-gate$(LARGEPICS) :=	sparc_C_PICFLAGS = $(C_BIGPICFLAGS)
1357c478bd9Sstevel@tonic-gate$(LARGEPICS) :=	i386_C_PICFLAGS = $(C_BIGPICFLAGS)
1367c478bd9Sstevel@tonic-gate
1377c478bd9Sstevel@tonic-gateCPPFLAGS +=	-D_REENTRANT
1387c478bd9Sstevel@tonic-gate
139*7014882cSRichard LoweCERRWARN +=	-_gcc=-Wno-unused-variable
140*7014882cSRichard LoweCERRWARN +=	-_gcc=-Wno-unused-value
141*7014882cSRichard LoweCERRWARN +=	-_gcc=-Wno-uninitialized
142*7014882cSRichard LoweCERRWARN +=	-_gcc=-Wno-implicit-function-declaration
143*7014882cSRichard LoweCERRWARN +=	-_gcc=-Wno-switch
144*7014882cSRichard LoweCERRWARN +=	-_gcc=-Wno-parentheses
145*7014882cSRichard Lowe
1467c478bd9Sstevel@tonic-gate# Extra includes, from yp, for yptol files.
1477c478bd9Sstevel@tonic-gateCPPFLAGS += -I$(SRC)/cmd/ypcmd
1487c478bd9Sstevel@tonic-gate
1497c478bd9Sstevel@tonic-gateLIBS = $(DYNLIB)
1507c478bd9Sstevel@tonic-gateZDEFS=
15106e1a714SrafLDLIBS += -lnsl -lldap -lc
1527c478bd9Sstevel@tonic-gate
15324da5b34Srie# A number of interfaces are interposed by numerous applications, therefore
154f6acbf7cSrie# prevent direct binding to anything in libnisdb.  Disable libnisdb from
155f6acbf7cSrie# directly binding to itself, but allow libnisdb to directly bind to its
156f6acbf7cSrie# dependencies (ie. map -Bdirect -> -zdirect).  Ensure lazy loading is
157f6acbf7cSrie# established (which is enabled automatically with -Bdirect).  In addition,
158f6acbf7cSrie# libnisdb interposes on socket(), so tag this library as an interposer.
159f6acbf7cSrie# dependencies (lazyload).
160f6acbf7cSrieBDIRECT =
161f6acbf7cSrieDYNFLAGS +=	$(BNODIRECT) $(ZINTERPOSE) $(ZDIRECT) $(ZLAZYLOAD)
16224da5b34Srie
1637c478bd9Sstevel@tonic-gateall :=		TARGET= all
1647c478bd9Sstevel@tonic-gateclean :=	TARGET= clean
1657c478bd9Sstevel@tonic-gateclobber :=	TARGET= clobber
1667c478bd9Sstevel@tonic-gateinstall :=	TARGET= install
1677c478bd9Sstevel@tonic-gatelint :=		TARGET= lint
1687c478bd9Sstevel@tonic-gate
1697c478bd9Sstevel@tonic-gate.KEEP_STATE:
1707c478bd9Sstevel@tonic-gate
171f808c858Srafall:	$(DERIVED_FILES) $(LIBS)
1727c478bd9Sstevel@tonic-gate
1737c478bd9Sstevel@tonic-gateinstall: all $(ROOTLIBS) $(ROOTLINKS)
1747c478bd9Sstevel@tonic-gate
1757c478bd9Sstevel@tonic-gatelint: $(DERIVED_FILES) .WAIT lintcheck
1767c478bd9Sstevel@tonic-gate
1777c478bd9Sstevel@tonic-gatepics/%.o: %.c
1787c478bd9Sstevel@tonic-gate	$(COMPILE.c) -o $@ $<
1797c478bd9Sstevel@tonic-gate	$(POST_PROCESS_O)
1807c478bd9Sstevel@tonic-gate
1817c478bd9Sstevel@tonic-gatepics/%.o: %.cc
1827c478bd9Sstevel@tonic-gate	$(COMPILE.cc) -o $@ $<
1837c478bd9Sstevel@tonic-gate	$(POST_PROCESS_O)
1847c478bd9Sstevel@tonic-gate
1857c478bd9Sstevel@tonic-gateobjs/%.o pics/%.o profs/%.o: $(YPTOL_DIR)/%.c
1867c478bd9Sstevel@tonic-gate	$(COMPILE.c) -o $@ $<
1877c478bd9Sstevel@tonic-gate	$(POST_PROCESS_O)
1887c478bd9Sstevel@tonic-gate
1897c478bd9Sstevel@tonic-gate#
1907c478bd9Sstevel@tonic-gate# Pattern matching rules that define how to build the derived files.
1917c478bd9Sstevel@tonic-gate#
1927c478bd9Sstevel@tonic-gate%_c.h: %_c.x
1937c478bd9Sstevel@tonic-gate	$(RM) $@
1947c478bd9Sstevel@tonic-gate	$(RPCGEN) -DUSINGC -h -o $@ $<
1957c478bd9Sstevel@tonic-gate
1967c478bd9Sstevel@tonic-gate%.h: %_c.x
1977c478bd9Sstevel@tonic-gate	$(RM) $@
1987c478bd9Sstevel@tonic-gate	$(RPCGEN) -h -o $@ $<
1997c478bd9Sstevel@tonic-gate
2007c478bd9Sstevel@tonic-gate%_c_xdr.c: %_c.x
2017c478bd9Sstevel@tonic-gate	$(RM) $@
2027c478bd9Sstevel@tonic-gate	$(RPCGEN) -DUSINGC -c -o $@ $<
2037c478bd9Sstevel@tonic-gate
2047c478bd9Sstevel@tonic-gate# rename the xdr_db_free_entry() in the db_table_c_xdr.c.  So the one
2057c478bd9Sstevel@tonic-gate# in db_index_entry_c is used instead.
2067c478bd9Sstevel@tonic-gateDB_TABLE=db_table_c
2077c478bd9Sstevel@tonic-gate
2087c478bd9Sstevel@tonic-gate$(DB_TABLE)_xdr.c:	$(DB_TABLE).x
2097c478bd9Sstevel@tonic-gate	$(RM) $@
2107c478bd9Sstevel@tonic-gate	$(RPCGEN) -DUSINGC -c $(DB_TABLE).x |\
2117c478bd9Sstevel@tonic-gate	$(SED) -e 's/^xdr_db_free_entry(/__OBSOLETED_xdr_db_free_entry(/' > $@
2127c478bd9Sstevel@tonic-gate
2137c478bd9Sstevel@tonic-gate# include library targets
2147c478bd9Sstevel@tonic-gateinclude ../Makefile.targ
215