xref: /titanic_44/usr/src/cmd/ldap/Makefile.com (revision 7ff178cd8db129d385d3177eb20744d3b6efc59b)
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 (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved.
23#
24# cmd/ldap/Makefile.com
25# Native LDAP II commands (makestyle clean).
26#
27include $(SRC)/cmd/Makefile.cmd
28
29LDAPMOD=	ldapmodify
30LDAPADD=	ldapadd
31LDAPPROG=	ldapmodrdn ldapsearch ldapdelete $(LDAPMOD)
32LDAPSRCS=	$(LDAPPROG:%=../common/%.c)
33LDAPOBJS=	$(LDAPPROG:%=%.o)
34
35#ldap common
36LDAPCOMMSRC=	common.c ldaptool-sasl.c fileurl.c convutf8.c
37LDAPCOMMOBJS=	$(LDAPCOMMSRC:%.c=%.o)
38
39# LDAP Naming service commands
40# idsconfig command
41IDSCONFIGPROG=	idsconfig
42IDSCONFIGSRC=	idsconfig.sh
43
44# ldaplist command
45LDAPLISTPROG=	ldaplist
46LDAPLISTSRCS=	ldaplist.c mapping.c printResult.c standalone.c
47LDAPLISTOBJS=	$(LDAPLISTSRCS:%.c=%.o)
48
49# ldapaddent command
50LDAPADDENTPROG=	ldapaddent
51LDAPADDENTSRCS=	ldapaddent.c ldapaddrbac.c ldapaddtsol.c standalone.c
52LDAPADDENTOBJS=	$(LDAPADDENTSRCS:%.c=%.o)
53
54# ldapclient command
55LDAPCLIENTPROG=	ldapclient
56LDAPCLIENTSRCS=	ldapclient.c standalone.c
57LDAPCLIENTOBJS=	$(LDAPCLIENTSRCS:%.c=%.o)
58
59
60NSLDAPOBJS=	$(LDAPLISTOBJS) $(LDAPADDENTOBJS) $(LDAPCLIENTOBJS)
61NSLDAPSRCS=	$(LDAPLISTSRCS) $(LDAPADDENTSRCS) $(LDAPCLIENTSRCS)
62
63OBJS=		$(LDAPOBJS) $(NSLDAPOBJS) $(LDAPCOMMOBJS)
64SRCS=		$(LDAPSRCS) $(NSLDAPSRCS)
65ROOTUSRSBIN=	$(ROOT)/usr/sbin
66ROOTUSRLIBLDAP=	$(ROOT)/usr/lib/ldap
67
68ROOTSCRIPT=	$(IDSCONFIGPROG:%=$(ROOTUSRLIBLDAP)/%)
69ROOTSBIN=	$(LDAPADDENTPROG:%=$(ROOTUSRSBIN)/%) \
70		$(LDAPCLIENTPROG:%=$(ROOTUSRSBIN)/%)
71
72PROG=		$(LDAPPROG) $(LDAPLISTPROG)
73ROOTADD=	$(ROOTBIN)/$(LDAPADD)
74ROOTMOD=	$(ROOTBIN)/$(LDAPMOD)
75ALLPROG=	all $(ROOTADD)
76
77CLOBBERFILES += $(OBJS) $(PROG) $(LDAPCLIENTPROG) $(LDAPADDENTPROG) \
78		$(IDSCONFIGPROG) $(LINTOUT)
79
80# creating /var/ldap directory
81ROOTVAR_LDAP=	$(ROOT)/var/ldap
82
83LINTFLAGS += -erroff=E_INCONS_ARG_DECL2
84LINTFLAGS += -erroff=E_INCONS_VAL_TYPE_DECL2
85
86all:=           TARGET= all
87install:=       TARGET= install
88clean:=         TARGET= clean
89clobber:=       TARGET= clobber
90lint:=          TARGET= lint
91
92# C Pre-Processor flags used by C, CC & lint
93CPPFLAGS +=	-DSUN -DSVR4 -DSOLARIS_LDAP_CMD \
94		-I $(SRC)/lib/libldap5/include/ldap \
95		-I $(SRC)/lib/libsldap/common \
96		-I $(SRC)/lib/libnsl/include/rpcsvc \
97		-DNO_LIBLCACHE -DLDAP_REFERRALS -DNET_SSL -DLDAPSSLIO \
98		-DHAVE_SASL_OPTIONS -DSOLARIS_LDAP_CMD
99LDLIBS +=	$(COMPLIB)
100
101ldapmodrdn :=	LDLIBS += -lldap
102ldapsearch :=	LDLIBS += -lldap
103ldapdelete :=	LDLIBS += -lldap
104ldapmodify :=	LDLIBS += -lldap
105ldaplist :=	LDLIBS += -lsldap
106ldapaddent :=	LDLIBS += -lsldap -lnsl -lsecdb
107ldapclient :=	LDLIBS += -lsldap -lscf
108
109ldaplist :=	C99MODE = $(C99_ENABLE)
110ldapaddent :=	C99MODE = $(C99_ENABLE)
111ldapclient :=	C99MODE = $(C99_ENABLE)
112
113lint :=		LDLIBS += -lldap
114
115.KEEP_STATE:
116
117all:	$(PROG) $(LDAPCLIENTPROG) $(LDAPADDENTPROG) $(IDSCONFIGPROG)
118
119$(LDAPADD):	$(LDAPMOD)
120		@$(RM) $(LDAPADD); $(LN) $(LDAPMOD) $(LDAPADD)
121
122$(LDAPPROG):	../common/$$@.c $(LDAPCOMMOBJS)
123		$(LINK.c) -o $@ ../common/$@.c $(LDAPCOMMOBJS) $(LDLIBS)
124		$(POST_PROCESS)
125
126%.o:		../common/%.c
127		$(COMPILE.c) -o $@ $<
128		$(POST_PROCESS_O)
129
130%.o:		../ns_ldap/%.c
131		$(COMPILE.c) -o $@ $<
132		$(POST_PROCESS_O)
133
134idsconfig:	../ns_ldap/$$@.sh
135		$(CP) ../ns_ldap/$(IDSCONFIGSRC) $(IDSCONFIGPROG)
136		$(CHMOD) 755 $(IDSCONFIGPROG)
137
138ldaplist:	$(LDAPLISTOBJS)
139		$(LINK.c) -o $@ $(LDAPLISTOBJS) $(LDLIBS)
140		$(POST_PROCESS)
141
142ldapaddent:	$(LDAPADDENTOBJS)
143		$(LINK.c) -o $@ $(LDAPADDENTOBJS) $(LDLIBS)
144		$(POST_PROCESS)
145
146ldapclient:	$(LDAPCLIENTOBJS)
147		$(LINK.c) -o $@ $(LDAPCLIENTOBJS) $(LDLIBS)
148		$(POST_PROCESS)
149
150install: all $(ROOTVAR_LDAP) $(ROOTUSRLIBLDAP) $(ROOTADD) $(ROOTSBIN) \
151		$(ROOTSCRIPT)
152
153$(ROOTUSRLIBLDAP):
154		$(INS.dir)
155
156$(ROOTVAR_LDAP):
157		$(INS.dir)
158
159$(ROOTADD):	$(ROOTPROG)
160		$(RM) $@
161		$(LN) $(ROOTMOD) $@
162
163$(ROOTUSRLIBLDAP)/%:	%
164		$(INS.file)
165
166FRC:
167
168clean:
169	$(RM) $(OBJS)
170
171# Not linted Mozilla upstream commands
172lint: lintns_ldaplist lintns_ldapaddent lintns_ldapclient
173
174lintns_ldaplist := C99MODE = $(C99_ENABLE)
175
176lintns_ldaplist:
177	$(LINT.c) $(LDAPLISTSRCS:%=../ns_ldap/%) $(LDLIBS) -lsldap
178
179lintns_ldapaddent := C99MODE = $(C99_ENABLE)
180
181lintns_ldapaddent:
182	$(LINT.c) $(LDAPADDENTSRCS:%=../ns_ldap/%) $(LDLIBS) -lsldap -lnsl \
183		-lsecdb
184
185lintns_ldapclient := C99MODE = $(C99_ENABLE)
186
187lintns_ldapclient:
188	$(LINT.c) $(LDAPCLIENTSRCS:%=../ns_ldap/%) $(LDLIBS) -lsldap -lscf
189
190lintc_%:
191	$(LINT.c) $(@:lintc_%=../common/%.c) $(LDAPCOMMSRC:%=../common/%) \
192		 $(LDLIBS)
193
194include $(SRC)/cmd/Makefile.targ
195