xref: /illumos-gate/usr/src/lib/libldap5/Makefile.com (revision 60405de4d8688d96dd05157c28db3ade5c9bc234)
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 (the "License").
6# You may not use this file except in compliance with the License.
7#
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.
12#
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]
18#
19# CDDL HEADER END
20#
21#
22# Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
23# Use is subject to license terms.
24#
25# ident	"%Z%%M%	%I%	%E% SMI"
26#
27
28LIBRARY= libldap.a
29VERS= .5
30
31# Definition of all the objects macros
32# The LDAP specific objects
33
34BEROBJS=	bprint.o	decode.o 	encode.o       io.o
35
36LDAPOBJS=  abandon.o add.o bind.o cache.o charray.o \
37        charset.o compare.o compat.o control.o countvalues.o \
38        delete.o disptmpl.o dsparse.o error.o extendop.o free.o freevalues.o \
39        friendly.o getattr.o getdn.o getdxbyname.o getentry.o \
40        getfilter.o getoption.o getvalues.o memcache.o message.o \
41        modify.o open.o os-ip.o proxyauthctrl.o psearch.o referral.o \
42        rename.o request.o reslist.o result.o saslbind.o sasl.o \
43        sbind.o search.o setoption.o sort.o sortctrl.o srchpref.o \
44        tmplout.o ufn.o unbind.o unescape.o url.o ldaputf8.o vlistctrl.o \
45        cram_md5.o secutil.o spagectrl.o digest_md5.o
46
47SSLDAPOBJS=	clientinit.o ldapsinit.o errormap.o
48
49PRLDAPOBJS=	ldappr-dns.o	ldappr-error.o	ldappr-public.o \
50		ldappr-io.o	ldappr-threads.o
51
52UTILOBJS= log.o line64.o
53
54# Grouping it all together
55OBJECTS=	$(BEROBJS) $(LDAPOBJS) $(SSLDAPOBJS) $(PRLDAPOBJS) \
56		$(UTILOBJS)
57
58# include library definitions
59include ../../Makefile.lib
60
61NSS_LIBS=	-lnspr4 -lplc4 -lnss3 -lssl3
62NSS_HDRS=	/usr/include/mps
63NSS_LDPATH=	/usr/lib/mps
64NSS_LDPATH64=	$(NSS_LDPATH)/64
65
66
67LDAP_FLAGS=     -DSVR4 -DSYSV -D__svr4 -D__svr4__ -DSOLARIS \
68                -D_SOLARIS_SDK \
69                -DUSE_WAITPID -DNEEDPROTOS \
70                -DNET_SSL  -DNO_LIBLCACHE -DLDAP_REFERRALS \
71                -DNS_DOMESTIC -DLDAP_SSLIO_HOOKS -DSTR_TRANSLATION \
72                -DLDAP_SASLIO_HOOKS
73
74
75# Include directories for all files
76COM_INC=	-I$(SRC)/lib/libldap5/include/ldap \
77		-I$(NSS_HDRS)
78
79SRCS=		$(BEROBJS:%.o=../sources/ldap/ber/%.c) \
80		$(LDAPOBJS:%.o=../sources/ldap/common/%.c) \
81		$(SSLDAPOBJS:%.o=../sources/ldap/ssldap/%.c) \
82		$(PRLDAPOBJS:%.o=../sources/ldap/prldap/%.c) \
83		$(UTILOBJS:%.o=../sources/ldap/util/%.c)
84
85LIBS =		$(DYNLIB) $(LINTLIB)
86DYNFLAGS +=	$(ZNODELETE)
87
88CPPFLAGS=	$(COM_INC) $(CPPFLAGS.master)
89
90# definitions for lint
91
92$(LINTLIB):= 	SRCS=../sources/ldap/common/llib-lldap
93$(LINTLIB):= 	LINTFLAGS=-nvx
94$(LINTLIB):= 	TARGET_ARCH=
95
96LINTOUT=	lint.out
97
98LINTSRC=	$(LINTLIB:%.ln=%)
99ROOTLINTDIR=	$(ROOTLIBDIR)
100ROOTLINT=	$(LINTSRC:%=$(ROOTLINTDIR)/%)
101
102
103CLEANFILES += 	$(LINTOUT) $(LINTLIB)
104
105# Local Libldap definitions
106LOCFLAGS +=	 $(XSTRCONST) -D_REENTRANT
107
108# Following values defined in Makefile.master are overwritten here.
109#sparc_C_PICFLAGS =	$(sparc_C_BIGPICFLAGS)
110sparcv9_C_PICFLAGS =	$(sparcv9_C_BIGPICFLAGS)
111#i386_C_PICFLAGS =	$(i386_C_BIGPICFLAGS)
112#amd64_C_PICFLAGS =	$(amd64_C_BIGPICFLAGS)
113
114CFLAGS +=	$(CCVERBOSE) $(LOCFLAGS)
115CFLAGS64 +=	$(LOCFLAGS)
116LDLIBS +=	-lsasl -lsocket -lnsl -lmd -lc
117
118.KEEP_STATE:
119
120# include library targets
121include ../../Makefile.targ
122
123pics/%.o: ../sources/ldap/ber/%.c
124	$(COMPILE.c) $(LDAP_FLAGS) $(COM_INC) -o $@ $<
125	$(POST_PROCESS_O)
126
127pics/%.o: ../sources/ldap/common/%.c
128	$(COMPILE.c) $(LDAP_FLAGS) $(COM_INC) -o $@ $<
129	$(POST_PROCESS_O)
130
131pics/%.o: ../sources/ldap/ssldap/%.c
132	$(COMPILE.c) $(LDAP_FLAGS) $(COM_INC) -w -o $@ $<
133	$(POST_PROCESS_O)
134
135pics/%.o: ../sources/ldap/prldap/%.c
136	$(COMPILE.c) $(LDAP_FLAGS) $(COM_INC) -w -o $@ $<
137	$(POST_PROCESS_O)
138
139pics/%.o: ../sources/ldap/util/%.c
140	$(COMPILE.c) $(LDAP_FLAGS) $(COM_INC) -w -o $@ $<
141	$(POST_PROCESS_O)
142
143# install rule for lint library target
144$(ROOTLINTDIR)/%: ../sources/ldap/common/%
145	$(INS.file)
146