xref: /titanic_44/usr/src/lib/libnisdb/Makefile (revision 355b4669e025ff377602b6fc7caaf30dbc218371)
1#
2# CDDL HEADER START
3#
4# The contents of this file are subject to the terms of the
5# Common Development and Distribution License, Version 1.0 only
6# (the "License").  You may not use this file except in compliance
7# with the License.
8#
9# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10# or http://www.opensolaris.org/os/licensing.
11# See the License for the specific language governing permissions
12# and limitations under the License.
13#
14# When distributing Covered Code, include this CDDL HEADER in each
15# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16# If applicable, add the following below this CDDL HEADER, with the
17# fields enclosed by brackets "[]" replaced with your own identifying
18# information: Portions Copyright [yyyy] [name of copyright owner]
19#
20# CDDL HEADER END
21#
22#
23# Copyright 2004 Sun Microsystems, Inc.  All rights reserved.
24# Use is subject to license terms.
25#
26# ident	"%Z%%M%	%I%	%E% SMI"
27#
28# lib/libnisdb/Makefile
29#
30
31LIBRARY= libnisdb.a
32VERS=	.2
33PROTOCOL_DIR= $(ROOT)/include/rpcsvc
34YPTOL_DIR= ./yptol
35
36SED=	sed
37
38OBJECTS = \
39	db_entry.o db_entry_c_xdr.o \
40	db_item.o db_item_c_xdr.o \
41	db_vers.o db_vers_c_xdr.o \
42	db_pickle.o \
43	db_table.o db_table_c_xdr.o \
44	db_index_entry.o db_index_entry_c.o \
45	db_index.o db_index_c_xdr.o \
46	db_scheme.o db_scheme_c_xdr.o \
47	db_query.o db_query_c_xdr.o \
48	db_mindex.o db_mindex2.o db_mindex3.o db_mindex_c_xdr.o \
49	db_log_entry.o db_log_entry_c_xdr.o \
50	db_log.o \
51	db.o \
52	xdr_nullptr.o \
53	db_dictionary.o db_dictionary_c_xdr.o \
54	db_dictxdr.o db_dictlog.o db_dictlog_c_xdr.o \
55	nis_db.o \
56	nisdb_mt.o nisdb_rw.o \
57	nis_hashitem.o nis_servlist.o \
58	ldap_attr.o ldap_cto.o ldap_glob.o ldap_ldap.o \
59	ldap_map.o ldap_nisdbquery.o ldap_nisplus.o \
60	ldap_op.o ldap_parse.o ldap_print.o ldap_ruleval.o \
61	ldap_util.o ldap_val.o ldap_xdr.o ldap_scheme.o \
62	nis_ldap.o \
63	nis_parse_ldap_attr.o nis_parse_ldap_conf.o \
64	nis_parse_ldap_map.o nis_parse_ldap_util.o \
65	nis_parse_ldap_yp_util.o	\
66	dit_access.o \
67	dit_access_utils.o \
68	lock_update.o \
69	map_conv.o \
70	map_ctrl.o \
71	yptol_utils.o \
72	shim.o \
73	shim_ancil.o \
74	shim_lockmap.o \
75	ttl_utils.o \
76	update.o \
77	shim_changepasswd.o \
78	stubs.o
79
80X_FILES= \
81    db_c.x             db_dictionary_c.x db_entry_c.x  db_index_c.x     \
82    db_index_entry_c.x db_item_c.x       db_log_c.x    db_log_entry_c.x \
83    db_mindex_c.x      db_query_c.x      db_scheme_c.x db_table_c.x     \
84    db_vers_c.x	       db_dictlog_c.x
85
86DERIVED_HEADERS= $(X_FILES:%_c.x=%_c.h) $(X_FILES:%_c.x=%.h)
87DERIVED_SOURCES= $(X_FILES:%_c.x=%_c_xdr.c)
88DERIVED_FILES= $(DERIVED_HEADERS) $(DERIVED_SOURCES)
89
90# delete the derived files when cleaning up
91CLEANFILES += $(DERIVED_FILES)
92
93# include library definitions
94include ../Makefile.lib
95
96MAPDIR=		./spec/$(MACH)
97MAPFILE=	$(MAPDIR)/mapfile
98CLOBBERFILES +=	$(MAPFILE)
99
100SRCS= db_dictionary_c_xdr.c db_dictlog_c_xdr.c db_dictxdr.c \
101db_entry_c_xdr.c db_index_c_xdr.c db_index_entry_c_xdr.c db_item_c_xdr.c \
102db_log_c_xdr.c db_log_entry_c_xdr.c db_mindex_c_xdr.c db_query_c_xdr.c \
103db_scheme_c_xdr.c db_table_c_xdr.c db_vers_c_xdr.c \
104$(YPTOL_DIR)/dit_access.c \
105$(YPTOL_DIR)/dit_access_utils.c \
106$(YPTOL_DIR)/lock_update.c \
107$(YPTOL_DIR)/map_conv.c \
108$(YPTOL_DIR)/map_ctrl.c \
109$(YPTOL_DIR)/yptol_utils.c \
110$(YPTOL_DIR)/shim.c \
111$(YPTOL_DIR)/shim_ancil.c \
112$(YPTOL_DIR)/shim_lockmap.c \
113$(YPTOL_DIR)/ttl_utils.c \
114$(YPTOL_DIR)/update.c \
115$(YPTOL_DIR)/shim_changepasswd.c \
116$(YPTOL_DIR)/stubs.c \
117#db_c_xdr.c xdr_nullptr.c
118
119# Libnisdb has grown large enough that there may be too many symbols
120# wanting `small' PIC references. Hence, compile some files with
121# `large' PIC references; the parser files are good candidates, since
122# they're only used at startup, and performance isn't too important.
123LARGESYMS=	nis_parse_ldap_conf.o \
124		nis_parse_ldap_attr.o \
125		nis_parse_ldap_yp_util.o \
126		nis_parse_ldap_map.o \
127		ldap_parse.o \
128		dit_access.o \
129		dit_access_utilis.o \
130		map_conv.o \
131		map_ctrl.o \
132		shim.o \
133		shim_ancil.o \
134		shim_changepasswd.o \
135		update.o \
136		stubs.o \
137		yptol_utils.o \
138		nis_parse_ldap_util.o
139LARGEPICS=	$(LARGESYMS:%=pics/%)
140$(LARGEPICS) :=	sparc_C_PICFLAGS = $(C_BIGPICFLAGS)
141$(LARGEPICS) :=	i386_C_PICFLAGS = $(C_BIGPICFLAGS)
142
143CPPFLAGS +=	-D_REENTRANT
144
145# Extra includes, from yp, for yptol files.
146CPPFLAGS += -I$(SRC)/cmd/ypcmd
147
148DYNFLAGS +=	-M$(MAPFILE)
149
150LIBS = $(DYNLIB)
151ZDEFS=
152LDLIBS += -lnsl -lldap -lcmd -lc
153
154all :=		TARGET= all
155clean :=	TARGET= clean
156clobber :=	TARGET= clobber
157install :=	TARGET= install
158lint :=		TARGET= lint
159
160.KEEP_STATE:
161
162all:	spec .WAIT $(DERIVED_FILES) $(LIBS)
163
164install: all $(ROOTLIBS) $(ROOTLINKS)
165
166lint: $(DERIVED_FILES) .WAIT lintcheck
167
168$(DYNLIB):	$(MAPFILE)
169
170$(MAPFILE):
171	@cd $(MAPDIR); $(MAKE) mapfile
172
173pics/%.o: %.c
174	$(COMPILE.c) -o $@ $<
175	$(POST_PROCESS_O)
176
177pics/%.o: %.cc
178	$(COMPILE.cc) -o $@ $<
179	$(POST_PROCESS_O)
180
181objs/%.o pics/%.o profs/%.o: $(YPTOL_DIR)/%.c
182	$(COMPILE.c) -o $@ $<
183	$(POST_PROCESS_O)
184
185#
186# Pattern matching rules that define how to build the derived files.
187#
188%_c.h: %_c.x
189	$(RM) $@
190	$(RPCGEN) -DUSINGC -h -o $@ $<
191
192%.h: %_c.x
193	$(RM) $@
194	$(RPCGEN) -h -o $@ $<
195
196%_c_xdr.c: %_c.x
197	$(RM) $@
198	$(RPCGEN) -DUSINGC -c -o $@ $<
199
200# rename the xdr_db_free_entry() in the db_table_c_xdr.c.  So the one
201# in db_index_entry_c is used instead.
202DB_TABLE=db_table_c
203
204$(DB_TABLE)_xdr.c:	$(DB_TABLE).x
205	$(RM) $@
206	$(RPCGEN) -DUSINGC -c $(DB_TABLE).x |\
207	$(SED) -e 's/^xdr_db_free_entry(/__OBSOLETED_xdr_db_free_entry(/' > $@
208
209clean clobber: spec
210
211spec:	FRC
212	@cd $@;pwd; $(MAKE) $(TARGET)
213
214
215# include library targets
216include ../Makefile.targ
217
218FRC:
219