Merge illumos-gate
[unleashed/lotheac.git] / usr / src / cmd / ldap / Makefile.com
bloba9f450263dafe1bb0314bddca1ea193c45a6e40f
2 # CDDL HEADER START
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]
19 # CDDL HEADER END
22 # Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved.
23 # Copyright (c) 2018, Joyent, Inc.
25 # cmd/ldap/Makefile.com
26 # Native LDAP II commands (makestyle clean).
28 include $(SRC)/cmd/Makefile.cmd
30 LDAPMOD=        ldapmodify
31 LDAPADD=        ldapadd
32 LDAPPROG=       ldapmodrdn ldapsearch ldapdelete $(LDAPMOD)
33 LDAPSRCS=       $(LDAPPROG:%=../common/%.c)
34 LDAPOBJS=       $(LDAPPROG:%=%.o)
36 #ldap common
37 LDAPCOMMSRC=    common.c ldaptool-sasl.c fileurl.c convutf8.c
38 LDAPCOMMOBJS=   $(LDAPCOMMSRC:%.c=%.o)
40 # LDAP Naming service commands
41 # idsconfig command
42 IDSCONFIGPROG=  idsconfig
43 IDSCONFIGSRC=   idsconfig.sh
45 # ldaplist command
46 LDAPLISTPROG=   ldaplist
47 LDAPLISTSRCS=   ldaplist.c mapping.c printResult.c standalone.c
48 LDAPLISTOBJS=   $(LDAPLISTSRCS:%.c=%.o)
50 # ldapaddent command
51 LDAPADDENTPROG= ldapaddent
52 LDAPADDENTSRCS= ldapaddent.c ldapaddrbac.c standalone.c
53 LDAPADDENTOBJS= $(LDAPADDENTSRCS:%.c=%.o)
55 # ldapclient command
56 LDAPCLIENTPROG= ldapclient
57 LDAPCLIENTSRCS= ldapclient.c standalone.c
58 LDAPCLIENTOBJS= $(LDAPCLIENTSRCS:%.c=%.o)
61 NSLDAPOBJS=     $(LDAPLISTOBJS) $(LDAPADDENTOBJS) $(LDAPCLIENTOBJS)
62 NSLDAPSRCS=     $(LDAPLISTSRCS) $(LDAPADDENTSRCS) $(LDAPCLIENTSRCS)
64 OBJS=           $(LDAPOBJS) $(NSLDAPOBJS) $(LDAPCOMMOBJS)
65 SRCS=           $(LDAPSRCS) $(NSLDAPSRCS)
66 ROOTUSRSBIN=    $(ROOT)/usr/sbin
67 ROOTUSRLIBLDAP= $(ROOT)/usr/lib/ldap
69 ROOTSCRIPT=     $(IDSCONFIGPROG:%=$(ROOTUSRLIBLDAP)/%)
70 ROOTSBIN=       $(LDAPADDENTPROG:%=$(ROOTUSRSBIN)/%) \
71                 $(LDAPCLIENTPROG:%=$(ROOTUSRSBIN)/%)
73 PROG=           $(LDAPPROG) $(LDAPLISTPROG)
74 ROOTADD=        $(ROOTBIN)/$(LDAPADD)
75 ROOTMOD=        $(ROOTBIN)/$(LDAPMOD)
76 ALLPROG=        all $(ROOTADD)
78 CLOBBERFILES += $(OBJS) $(PROG) $(LDAPCLIENTPROG) $(LDAPADDENTPROG) \
79                 $(IDSCONFIGPROG)
81 # creating /var/ldap directory
82 ROOTVAR_LDAP=   $(ROOT)/var/ldap
85 CERRWARN +=     -Wno-implicit-function-declaration
86 CERRWARN +=     -Wno-parentheses
87 CERRWARN +=     -Wno-unused-function
88 CERRWARN +=     -Wno-unused-variable
89 CERRWARN +=     -Wno-uninitialized
91 # not linted
92 SMATCH=off
94 all:=           TARGET= all
95 install:=       TARGET= install
96 clean:=         TARGET= clean
97 clobber:=       TARGET= clobber
99 # C Pre-Processor flags used by C and CC
100 CPPFLAGS +=     -DSUN -DSVR4 -DSOLARIS_LDAP_CMD \
101                 -I $(SRC)/lib/libldap5/include/ldap \
102                 -I $(SRC)/lib/libsldap/common \
103                 -I $(SRC)/lib/libc/inc/rpcsvc \
104                 -DNO_LIBLCACHE -DLDAP_REFERRALS -DNET_SSL -DLDAPSSLIO \
105                 -DHAVE_SASL_OPTIONS -DSOLARIS_LDAP_CMD
106 LDLIBS +=       $(COMPLIB)
108 ldapmodrdn :=   LDLIBS += -lldap
109 ldapsearch :=   LDLIBS += -lldap
110 ldapdelete :=   LDLIBS += -lldap
111 ldapmodify :=   LDLIBS += -lldap
112 ldaplist :=     LDLIBS += -lsldap
113 ldapaddent :=   LDLIBS += -lsldap
114 ldapclient :=   LDLIBS += -lsldap -lscf
116 ldaplist :=     CSTD = $(CSTD_GNU99)
117 ldapaddent :=   CSTD = $(CSTD_GNU99)
118 ldapclient :=   CSTD = $(CSTD_GNU99)
121 .KEEP_STATE:
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)
130                 $(POST_PROCESS)
132 %.o:            ../common/%.c
133                 $(COMPILE.c) -o $@ $<
134                 $(POST_PROCESS_O)
136 %.o:            ../ns_ldap/%.c
137                 $(COMPILE.c) -o $@ $<
138                 $(POST_PROCESS_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)
146                 $(POST_PROCESS)
148 ldapaddent:     $(LDAPADDENTOBJS)
149                 $(LINK.c) -o $@ $(LDAPADDENTOBJS) $(LDLIBS)
150                 $(POST_PROCESS)
152 ldapclient:     $(LDAPCLIENTOBJS)
153                 $(LINK.c) -o $@ $(LDAPCLIENTOBJS) $(LDLIBS)
154                 $(POST_PROCESS)
156 install: all $(ROOTVAR_LDAP) $(ROOTUSRLIBLDAP) $(ROOTADD) $(ROOTSBIN) \
157                 $(ROOTSCRIPT)
159 $(ROOTUSRLIBLDAP):
160                 $(INS.dir)
162 $(ROOTVAR_LDAP):
163                 $(INS.dir)
165 $(ROOTADD):     $(ROOTPROG)
166                 $(RM) $@
167                 $(LN) $(ROOTMOD) $@
169 $(ROOTUSRLIBLDAP)/%:    %
170                 $(INS.file)
172 FRC:
174 clean:
175         $(RM) $(OBJS)
177 include $(SRC)/cmd/Makefile.targ