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.
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.
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]
22 # Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved.
24 # cmd/ldap/Makefile.com
25 # Native LDAP II commands (makestyle clean).
27 include $(SRC)/cmd/Makefile.cmd
31 LDAPPROG= ldapmodrdn ldapsearch ldapdelete $(LDAPMOD)
32 LDAPSRCS= $(LDAPPROG:%=../common/%.c)
33 LDAPOBJS= $(LDAPPROG:%=%.o)
36 LDAPCOMMSRC= common.c ldaptool-sasl.c fileurl.c convutf8.c
37 LDAPCOMMOBJS= $(LDAPCOMMSRC:%.c=%.o)
39 # LDAP Naming service commands
41 IDSCONFIGPROG= idsconfig
42 IDSCONFIGSRC= idsconfig.sh
45 LDAPLISTPROG= ldaplist
46 LDAPLISTSRCS= ldaplist.c mapping.c printResult.c standalone.c
47 LDAPLISTOBJS= $(LDAPLISTSRCS:%.c=%.o)
50 LDAPADDENTPROG= ldapaddent
51 LDAPADDENTSRCS= ldapaddent.c ldapaddrbac.c ldapaddtsol.c standalone.c
52 LDAPADDENTOBJS= $(LDAPADDENTSRCS:%.c=%.o)
55 LDAPCLIENTPROG= ldapclient
56 LDAPCLIENTSRCS= ldapclient.c standalone.c
57 LDAPCLIENTOBJS= $(LDAPCLIENTSRCS:%.c=%.o)
60 NSLDAPOBJS= $(LDAPLISTOBJS) $(LDAPADDENTOBJS) $(LDAPCLIENTOBJS)
61 NSLDAPSRCS= $(LDAPLISTSRCS) $(LDAPADDENTSRCS) $(LDAPCLIENTSRCS)
63 OBJS= $(LDAPOBJS) $(NSLDAPOBJS) $(LDAPCOMMOBJS)
64 SRCS= $(LDAPSRCS) $(NSLDAPSRCS)
65 ROOTUSRSBIN= $(ROOT)/usr/sbin
66 ROOTUSRLIBLDAP= $(ROOT)/usr/lib/ldap
68 ROOTSCRIPT= $(IDSCONFIGPROG:%=$(ROOTUSRLIBLDAP)/%)
69 ROOTSBIN= $(LDAPADDENTPROG:%=$(ROOTUSRSBIN)/%) \
70 $(LDAPCLIENTPROG:%=$(ROOTUSRSBIN)/%)
72 PROG= $(LDAPPROG) $(LDAPLISTPROG)
73 ROOTADD= $(ROOTBIN)/$(LDAPADD)
74 ROOTMOD= $(ROOTBIN)/$(LDAPMOD)
75 ALLPROG= all $(ROOTADD)
77 CLOBBERFILES += $(OBJS) $(PROG) $(LDAPCLIENTPROG) $(LDAPADDENTPROG) \
78 $(IDSCONFIGPROG) $(LINTOUT)
80 # creating /var/ldap directory
81 ROOTVAR_LDAP= $(ROOT)/var/ldap
83 LINTFLAGS += -erroff=E_INCONS_ARG_DECL2
84 LINTFLAGS += -erroff=E_INCONS_VAL_TYPE_DECL2
86 CERRWARN += -_gcc=-Wno-implicit-function-declaration
87 CERRWARN += -_gcc=-Wno-parentheses
88 CERRWARN += -_gcc=-Wno-unused-function
89 CERRWARN += -_gcc=-Wno-unused-variable
90 CERRWARN += -_gcc=-Wno-uninitialized
93 install:= TARGET= install
95 clobber:= TARGET= clobber
98 # C Pre-Processor flags used by C, CC & lint
99 CPPFLAGS += -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
107 ldapmodrdn := LDLIBS += -lldap
108 ldapsearch := LDLIBS += -lldap
109 ldapdelete := LDLIBS += -lldap
110 ldapmodify := LDLIBS += -lldap
111 ldaplist := LDLIBS += -lsldap
112 ldapaddent := LDLIBS += -lsldap -lnsl -lsecdb
113 ldapclient := LDLIBS += -lsldap -lscf
115 ldaplist := C99MODE = $(C99_ENABLE)
116 ldapaddent := C99MODE = $(C99_ENABLE)
117 ldapclient := C99MODE = $(C99_ENABLE)
119 lint := LDLIBS += -lldap
123 all: $(PROG) $(LDAPCLIENTPROG) $(LDAPADDENTPROG) $(IDSCONFIGPROG)
125 $(LDAPADD): $(LDAPMOD)
126 @$(RM) $(LDAPADD); $(LN) $(LDAPMOD) $(LDAPADD)
128 $(LDAPPROG): ../common/$$@.c $(LDAPCOMMOBJS)
129 $(LINK.c) -o $@ ../common/$@.c $(LDAPCOMMOBJS) $(LDLIBS)
133 $(COMPILE.c) -o $@ $<
137 $(COMPILE.c) -o $@ $<
140 idsconfig: ../ns_ldap/$$@.sh
141 $(CP) ../ns_ldap/$(IDSCONFIGSRC) $(IDSCONFIGPROG)
142 $(CHMOD) 755 $(IDSCONFIGPROG)
144 ldaplist: $(LDAPLISTOBJS)
145 $(LINK.c) -o $@ $(LDAPLISTOBJS) $(LDLIBS)
148 ldapaddent: $(LDAPADDENTOBJS)
149 $(LINK.c) -o $@ $(LDAPADDENTOBJS) $(LDLIBS)
152 ldapclient: $(LDAPCLIENTOBJS)
153 $(LINK.c) -o $@ $(LDAPCLIENTOBJS) $(LDLIBS)
156 install: all $(ROOTVAR_LDAP) $(ROOTUSRLIBLDAP) $(ROOTADD) $(ROOTSBIN) \
165 $(ROOTADD): $(ROOTPROG)
169 $(ROOTUSRLIBLDAP)/%: %
177 # Not linted Mozilla upstream commands
178 lint: lintns_ldaplist lintns_ldapaddent lintns_ldapclient
180 lintns_ldaplist := C99MODE = $(C99_ENABLE)
183 $(LINT.c) $(LDAPLISTSRCS:%=../ns_ldap/%) $(LDLIBS) -lsldap
185 lintns_ldapaddent := C99MODE = $(C99_ENABLE)
188 $(LINT.c) $(LDAPADDENTSRCS:%=../ns_ldap/%) $(LDLIBS) -lsldap -lnsl \
191 lintns_ldapclient := C99MODE = $(C99_ENABLE)
194 $(LINT.c) $(LDAPCLIENTSRCS:%=../ns_ldap/%) $(LDLIBS) -lsldap -lscf
197 $(LINT.c) $(@:lintc_%=../common/%.c) $(LDAPCOMMSRC:%=../common/%) \
200 include $(SRC)/cmd/Makefile.targ