Makefiles need to specify C99 mode consistently
[unleashed.git] / usr / src / cmd / ldap / Makefile.com
blob43167eb8992a61af153efa73816aa2e3b8f11eca
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.
24 # cmd/ldap/Makefile.com
25 # Native LDAP II commands (makestyle clean).
27 include $(SRC)/cmd/Makefile.cmd
29 LDAPMOD=        ldapmodify
30 LDAPADD=        ldapadd
31 LDAPPROG=       ldapmodrdn ldapsearch ldapdelete $(LDAPMOD)
32 LDAPSRCS=       $(LDAPPROG:%=../common/%.c)
33 LDAPOBJS=       $(LDAPPROG:%=%.o)
35 #ldap common
36 LDAPCOMMSRC=    common.c ldaptool-sasl.c fileurl.c convutf8.c
37 LDAPCOMMOBJS=   $(LDAPCOMMSRC:%.c=%.o)
39 # LDAP Naming service commands
40 # idsconfig command
41 IDSCONFIGPROG=  idsconfig
42 IDSCONFIGSRC=   idsconfig.sh
44 # ldaplist command
45 LDAPLISTPROG=   ldaplist
46 LDAPLISTSRCS=   ldaplist.c mapping.c printResult.c standalone.c
47 LDAPLISTOBJS=   $(LDAPLISTSRCS:%.c=%.o)
49 # ldapaddent command
50 LDAPADDENTPROG= ldapaddent
51 LDAPADDENTSRCS= ldapaddent.c ldapaddrbac.c standalone.c
52 LDAPADDENTOBJS= $(LDAPADDENTSRCS:%.c=%.o)
54 # ldapclient command
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)
80 # creating /var/ldap directory
81 ROOTVAR_LDAP=   $(ROOT)/var/ldap
84 CERRWARN +=     -Wno-implicit-function-declaration
85 CERRWARN +=     -Wno-parentheses
86 CERRWARN +=     -Wno-unused-function
87 CERRWARN +=     -Wno-unused-variable
88 CERRWARN +=     -Wno-uninitialized
90 all:=           TARGET= all
91 install:=       TARGET= install
92 clean:=         TARGET= clean
93 clobber:=       TARGET= clobber
95 # C Pre-Processor flags used by C and CC
96 CPPFLAGS +=     -DSUN -DSVR4 -DSOLARIS_LDAP_CMD \
97                 -I $(SRC)/lib/libldap5/include/ldap \
98                 -I $(SRC)/lib/libsldap/common \
99                 -I $(SRC)/lib/libc/inc/rpcsvc \
100                 -DNO_LIBLCACHE -DLDAP_REFERRALS -DNET_SSL -DLDAPSSLIO \
101                 -DHAVE_SASL_OPTIONS -DSOLARIS_LDAP_CMD
102 LDLIBS +=       $(COMPLIB)
104 ldapmodrdn :=   LDLIBS += -lldap
105 ldapsearch :=   LDLIBS += -lldap
106 ldapdelete :=   LDLIBS += -lldap
107 ldapmodify :=   LDLIBS += -lldap
108 ldaplist :=     LDLIBS += -lsldap
109 ldapaddent :=   LDLIBS += -lsldap
110 ldapclient :=   LDLIBS += -lsldap -lscf
112 ldaplist :=     CSTD = $(CSTD_GNU99)
113 ldapaddent :=   CSTD = $(CSTD_GNU99)
114 ldapclient :=   CSTD = $(CSTD_GNU99)
117 .KEEP_STATE:
119 all:    $(PROG) $(LDAPCLIENTPROG) $(LDAPADDENTPROG) $(IDSCONFIGPROG)
121 $(LDAPADD):     $(LDAPMOD)
122                 @$(RM) $(LDAPADD); $(LN) $(LDAPMOD) $(LDAPADD)
124 $(LDAPPROG):    ../common/$$@.c $(LDAPCOMMOBJS)
125                 $(LINK.c) -o $@ ../common/$@.c $(LDAPCOMMOBJS) $(LDLIBS)
126                 $(POST_PROCESS)
128 %.o:            ../common/%.c
129                 $(COMPILE.c) -o $@ $<
130                 $(POST_PROCESS_O)
132 %.o:            ../ns_ldap/%.c
133                 $(COMPILE.c) -o $@ $<
134                 $(POST_PROCESS_O)
136 idsconfig:      ../ns_ldap/$$@.sh
137                 $(CP) ../ns_ldap/$(IDSCONFIGSRC) $(IDSCONFIGPROG)
138                 $(CHMOD) 755 $(IDSCONFIGPROG)
140 ldaplist:       $(LDAPLISTOBJS)
141                 $(LINK.c) -o $@ $(LDAPLISTOBJS) $(LDLIBS)
142                 $(POST_PROCESS)
144 ldapaddent:     $(LDAPADDENTOBJS)
145                 $(LINK.c) -o $@ $(LDAPADDENTOBJS) $(LDLIBS)
146                 $(POST_PROCESS)
148 ldapclient:     $(LDAPCLIENTOBJS)
149                 $(LINK.c) -o $@ $(LDAPCLIENTOBJS) $(LDLIBS)
150                 $(POST_PROCESS)
152 install: all $(ROOTVAR_LDAP) $(ROOTUSRLIBLDAP) $(ROOTADD) $(ROOTSBIN) \
153                 $(ROOTSCRIPT)
155 $(ROOTUSRLIBLDAP):
156                 $(INS.dir)
158 $(ROOTVAR_LDAP):
159                 $(INS.dir)
161 $(ROOTADD):     $(ROOTPROG)
162                 $(RM) $@
163                 $(LN) $(ROOTMOD) $@
165 $(ROOTUSRLIBLDAP)/%:    %
166                 $(INS.file)
168 FRC:
170 clean:
171         $(RM) $(OBJS)
173 include $(SRC)/cmd/Makefile.targ