xref: /titanic_50/usr/src/cmd/ldap/Makefile.com (revision 49f9b365248ee858ee91baa36eab27c5200f6dca)
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
86CERRWARN +=	-_gcc=-Wno-implicit-function-declaration
87CERRWARN +=	-_gcc=-Wno-parentheses
88CERRWARN +=	-_gcc=-Wno-unused-function
89CERRWARN +=	-_gcc=-Wno-unused-variable
90CERRWARN +=	-_gcc=-Wno-uninitialized
91
92all:=           TARGET= all
93install:=       TARGET= install
94clean:=         TARGET= clean
95clobber:=       TARGET= clobber
96lint:=          TARGET= lint
97
98# C Pre-Processor flags used by C, CC & lint
99CPPFLAGS +=	-DSUN -DSVR4 -DSOLARIS_LDAP_CMD \
100		-I $(SRC)/lib/libldap5/include/ldap \
101		-I $(SRC)/lib/libsldap/common \
102		-I $(SRC)/lib/libnsl/include/rpcsvc \
103		-DNO_LIBLCACHE -DLDAP_REFERRALS -DNET_SSL -DLDAPSSLIO \
104		-DHAVE_SASL_OPTIONS -DSOLARIS_LDAP_CMD
105LDLIBS +=	$(COMPLIB)
106
107ldapmodrdn :=	LDLIBS += -lldap
108ldapsearch :=	LDLIBS += -lldap
109ldapdelete :=	LDLIBS += -lldap
110ldapmodify :=	LDLIBS += -lldap
111ldaplist :=	LDLIBS += -lsldap
112ldapaddent :=	LDLIBS += -lsldap -lnsl -lsecdb
113ldapclient :=	LDLIBS += -lsldap -lscf
114
115ldaplist :=	C99MODE = $(C99_ENABLE)
116ldapaddent :=	C99MODE = $(C99_ENABLE)
117ldapclient :=	C99MODE = $(C99_ENABLE)
118
119lint :=		LDLIBS += -lldap
120
121.KEEP_STATE:
122
123all:	$(PROG) $(LDAPCLIENTPROG) $(LDAPADDENTPROG) $(IDSCONFIGPROG)
124
125$(LDAPADD):	$(LDAPMOD)
126		@$(RM) $(LDAPADD); $(LN) $(LDAPMOD) $(LDAPADD)
127
128$(LDAPPROG):	../common/$$@.c $(LDAPCOMMOBJS)
129		$(LINK.c) -o $@ ../common/$@.c $(LDAPCOMMOBJS) $(LDLIBS)
130		$(POST_PROCESS)
131
132%.o:		../common/%.c
133		$(COMPILE.c) -o $@ $<
134		$(POST_PROCESS_O)
135
136%.o:		../ns_ldap/%.c
137		$(COMPILE.c) -o $@ $<
138		$(POST_PROCESS_O)
139
140idsconfig:	../ns_ldap/$$@.sh
141		$(CP) ../ns_ldap/$(IDSCONFIGSRC) $(IDSCONFIGPROG)
142		$(CHMOD) 755 $(IDSCONFIGPROG)
143
144ldaplist:	$(LDAPLISTOBJS)
145		$(LINK.c) -o $@ $(LDAPLISTOBJS) $(LDLIBS)
146		$(POST_PROCESS)
147
148ldapaddent:	$(LDAPADDENTOBJS)
149		$(LINK.c) -o $@ $(LDAPADDENTOBJS) $(LDLIBS)
150		$(POST_PROCESS)
151
152ldapclient:	$(LDAPCLIENTOBJS)
153		$(LINK.c) -o $@ $(LDAPCLIENTOBJS) $(LDLIBS)
154		$(POST_PROCESS)
155
156install: all $(ROOTVAR_LDAP) $(ROOTUSRLIBLDAP) $(ROOTADD) $(ROOTSBIN) \
157		$(ROOTSCRIPT)
158
159$(ROOTUSRLIBLDAP):
160		$(INS.dir)
161
162$(ROOTVAR_LDAP):
163		$(INS.dir)
164
165$(ROOTADD):	$(ROOTPROG)
166		$(RM) $@
167		$(LN) $(ROOTMOD) $@
168
169$(ROOTUSRLIBLDAP)/%:	%
170		$(INS.file)
171
172FRC:
173
174clean:
175	$(RM) $(OBJS)
176
177# Not linted Mozilla upstream commands
178lint: lintns_ldaplist lintns_ldapaddent lintns_ldapclient
179
180lintns_ldaplist := C99MODE = $(C99_ENABLE)
181
182lintns_ldaplist:
183	$(LINT.c) $(LDAPLISTSRCS:%=../ns_ldap/%) $(LDLIBS) -lsldap
184
185lintns_ldapaddent := C99MODE = $(C99_ENABLE)
186
187lintns_ldapaddent:
188	$(LINT.c) $(LDAPADDENTSRCS:%=../ns_ldap/%) $(LDLIBS) -lsldap -lnsl \
189		-lsecdb
190
191lintns_ldapclient := C99MODE = $(C99_ENABLE)
192
193lintns_ldapclient:
194	$(LINT.c) $(LDAPCLIENTSRCS:%=../ns_ldap/%) $(LDLIBS) -lsldap -lscf
195
196lintc_%:
197	$(LINT.c) $(@:lintc_%=../common/%.c) $(LDAPCOMMSRC:%=../common/%) \
198		 $(LDLIBS)
199
200include $(SRC)/cmd/Makefile.targ
201