xref: /titanic_50/usr/src/cmd/ldap/Makefile.com (revision 7014882c6a3672fd0e5d60200af8643ae53c5928)
17c478bd9Sstevel@tonic-gate#
245916cd2Sjpk# CDDL HEADER START
345916cd2Sjpk#
445916cd2Sjpk# The contents of this file are subject to the terms of the
545916cd2Sjpk# Common Development and Distribution License (the "License").
645916cd2Sjpk# You may not use this file except in compliance with the License.
745916cd2Sjpk#
845916cd2Sjpk# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
945916cd2Sjpk# or http://www.opensolaris.org/os/licensing.
1045916cd2Sjpk# See the License for the specific language governing permissions
1145916cd2Sjpk# and limitations under the License.
1245916cd2Sjpk#
1345916cd2Sjpk# When distributing Covered Code, include this CDDL HEADER in each
1445916cd2Sjpk# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
1545916cd2Sjpk# If applicable, add the following below this CDDL HEADER, with the
1645916cd2Sjpk# fields enclosed by brackets "[]" replaced with your own identifying
1745916cd2Sjpk# information: Portions Copyright [yyyy] [name of copyright owner]
1845916cd2Sjpk#
1945916cd2Sjpk# CDDL HEADER END
2045916cd2Sjpk#
2145916cd2Sjpk#
2268e40ea6SMilan Jurik# Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved.
237c478bd9Sstevel@tonic-gate#
247c478bd9Sstevel@tonic-gate# cmd/ldap/Makefile.com
257c478bd9Sstevel@tonic-gate# Native LDAP II commands (makestyle clean).
267c478bd9Sstevel@tonic-gate#
277c478bd9Sstevel@tonic-gateinclude $(SRC)/cmd/Makefile.cmd
287c478bd9Sstevel@tonic-gate
297c478bd9Sstevel@tonic-gateLDAPMOD=	ldapmodify
307c478bd9Sstevel@tonic-gateLDAPADD=	ldapadd
317c478bd9Sstevel@tonic-gateLDAPPROG=	ldapmodrdn ldapsearch ldapdelete $(LDAPMOD)
327c478bd9Sstevel@tonic-gateLDAPSRCS=	$(LDAPPROG:%=../common/%.c)
337c478bd9Sstevel@tonic-gateLDAPOBJS=	$(LDAPPROG:%=%.o)
347c478bd9Sstevel@tonic-gate
357c478bd9Sstevel@tonic-gate#ldap common
366c4d349cSsm26363LDAPCOMMSRC=	common.c ldaptool-sasl.c fileurl.c convutf8.c
376c4d349cSsm26363LDAPCOMMOBJS=	$(LDAPCOMMSRC:%.c=%.o)
387c478bd9Sstevel@tonic-gate
397c478bd9Sstevel@tonic-gate# LDAP Naming service commands
407c478bd9Sstevel@tonic-gate# idsconfig command
417c478bd9Sstevel@tonic-gateIDSCONFIGPROG=	idsconfig
427c478bd9Sstevel@tonic-gateIDSCONFIGSRC=	idsconfig.sh
437c478bd9Sstevel@tonic-gate
447c478bd9Sstevel@tonic-gate# ldaplist command
457c478bd9Sstevel@tonic-gateLDAPLISTPROG=	ldaplist
46e1dd0a2fSth160488LDAPLISTSRCS=	ldaplist.c mapping.c printResult.c standalone.c
477c478bd9Sstevel@tonic-gateLDAPLISTOBJS=	$(LDAPLISTSRCS:%.c=%.o)
487c478bd9Sstevel@tonic-gate
497c478bd9Sstevel@tonic-gate# ldapaddent command
507c478bd9Sstevel@tonic-gateLDAPADDENTPROG=	ldapaddent
51e1dd0a2fSth160488LDAPADDENTSRCS=	ldapaddent.c ldapaddrbac.c ldapaddtsol.c standalone.c
527c478bd9Sstevel@tonic-gateLDAPADDENTOBJS=	$(LDAPADDENTSRCS:%.c=%.o)
537c478bd9Sstevel@tonic-gate
547c478bd9Sstevel@tonic-gate# ldapclient command
557c478bd9Sstevel@tonic-gateLDAPCLIENTPROG=	ldapclient
56e1dd0a2fSth160488LDAPCLIENTSRCS=	ldapclient.c standalone.c
577c478bd9Sstevel@tonic-gateLDAPCLIENTOBJS=	$(LDAPCLIENTSRCS:%.c=%.o)
587c478bd9Sstevel@tonic-gate
597c478bd9Sstevel@tonic-gate
607c478bd9Sstevel@tonic-gateNSLDAPOBJS=	$(LDAPLISTOBJS) $(LDAPADDENTOBJS) $(LDAPCLIENTOBJS)
617c478bd9Sstevel@tonic-gateNSLDAPSRCS=	$(LDAPLISTSRCS) $(LDAPADDENTSRCS) $(LDAPCLIENTSRCS)
627c478bd9Sstevel@tonic-gate
637c478bd9Sstevel@tonic-gateOBJS=		$(LDAPOBJS) $(NSLDAPOBJS) $(LDAPCOMMOBJS)
647c478bd9Sstevel@tonic-gateSRCS=		$(LDAPSRCS) $(NSLDAPSRCS)
657c478bd9Sstevel@tonic-gateROOTUSRSBIN=	$(ROOT)/usr/sbin
667c478bd9Sstevel@tonic-gateROOTUSRLIBLDAP=	$(ROOT)/usr/lib/ldap
677c478bd9Sstevel@tonic-gate
687c478bd9Sstevel@tonic-gateROOTSCRIPT=	$(IDSCONFIGPROG:%=$(ROOTUSRLIBLDAP)/%)
697c478bd9Sstevel@tonic-gateROOTSBIN=	$(LDAPADDENTPROG:%=$(ROOTUSRSBIN)/%) \
707c478bd9Sstevel@tonic-gate		$(LDAPCLIENTPROG:%=$(ROOTUSRSBIN)/%)
717c478bd9Sstevel@tonic-gate
727c478bd9Sstevel@tonic-gatePROG=		$(LDAPPROG) $(LDAPLISTPROG)
737c478bd9Sstevel@tonic-gateROOTADD=	$(ROOTBIN)/$(LDAPADD)
747c478bd9Sstevel@tonic-gateROOTMOD=	$(ROOTBIN)/$(LDAPMOD)
757c478bd9Sstevel@tonic-gateALLPROG=	all $(ROOTADD)
767c478bd9Sstevel@tonic-gate
777c478bd9Sstevel@tonic-gateCLOBBERFILES += $(OBJS) $(PROG) $(LDAPCLIENTPROG) $(LDAPADDENTPROG) \
787c478bd9Sstevel@tonic-gate		$(IDSCONFIGPROG) $(LINTOUT)
797c478bd9Sstevel@tonic-gate
807c478bd9Sstevel@tonic-gate# creating /var/ldap directory
817c478bd9Sstevel@tonic-gateROOTVAR_LDAP=	$(ROOT)/var/ldap
827c478bd9Sstevel@tonic-gate
8368e40ea6SMilan JurikLINTFLAGS += -erroff=E_INCONS_ARG_DECL2
8468e40ea6SMilan JurikLINTFLAGS += -erroff=E_INCONS_VAL_TYPE_DECL2
8568e40ea6SMilan Jurik
86*7014882cSRichard LoweCERRWARN +=	-_gcc=-Wno-implicit-function-declaration
87*7014882cSRichard LoweCERRWARN +=	-_gcc=-Wno-parentheses
88*7014882cSRichard LoweCERRWARN +=	-_gcc=-Wno-unused-function
89*7014882cSRichard LoweCERRWARN +=	-_gcc=-Wno-unused-variable
90*7014882cSRichard LoweCERRWARN +=	-_gcc=-Wno-uninitialized
91*7014882cSRichard Lowe
927c478bd9Sstevel@tonic-gateall:=           TARGET= all
937c478bd9Sstevel@tonic-gateinstall:=       TARGET= install
947c478bd9Sstevel@tonic-gateclean:=         TARGET= clean
957c478bd9Sstevel@tonic-gateclobber:=       TARGET= clobber
967c478bd9Sstevel@tonic-gatelint:=          TARGET= lint
977c478bd9Sstevel@tonic-gate
986c4d349cSsm26363# C Pre-Processor flags used by C, CC & lint
9945916cd2SjpkCPPFLAGS +=	-DSUN -DSVR4 -DSOLARIS_LDAP_CMD \
100cb5caa98Sdjl		-I $(SRC)/lib/libldap5/include/ldap \
101cb5caa98Sdjl		-I $(SRC)/lib/libsldap/common \
102cb5caa98Sdjl		-I $(SRC)/lib/libnsl/include/rpcsvc \
1037c478bd9Sstevel@tonic-gate		-DNO_LIBLCACHE -DLDAP_REFERRALS -DNET_SSL -DLDAPSSLIO \
1047c478bd9Sstevel@tonic-gate		-DHAVE_SASL_OPTIONS -DSOLARIS_LDAP_CMD
1057c478bd9Sstevel@tonic-gateLDLIBS +=	$(COMPLIB)
1067c478bd9Sstevel@tonic-gate
1077c478bd9Sstevel@tonic-gateldapmodrdn :=	LDLIBS += -lldap
1087c478bd9Sstevel@tonic-gateldapsearch :=	LDLIBS += -lldap
1097c478bd9Sstevel@tonic-gateldapdelete :=	LDLIBS += -lldap
1107c478bd9Sstevel@tonic-gateldapmodify :=	LDLIBS += -lldap
1117c478bd9Sstevel@tonic-gateldaplist :=	LDLIBS += -lsldap
11245916cd2Sjpkldapaddent :=	LDLIBS += -lsldap -lnsl -lsecdb
1137c478bd9Sstevel@tonic-gateldapclient :=	LDLIBS += -lsldap -lscf
1147c478bd9Sstevel@tonic-gate
115e1dd0a2fSth160488ldaplist :=	C99MODE = $(C99_ENABLE)
116e1dd0a2fSth160488ldapaddent :=	C99MODE = $(C99_ENABLE)
117e1dd0a2fSth160488ldapclient :=	C99MODE = $(C99_ENABLE)
118e1dd0a2fSth160488
1197c478bd9Sstevel@tonic-gatelint :=		LDLIBS += -lldap
1207c478bd9Sstevel@tonic-gate
1217c478bd9Sstevel@tonic-gate.KEEP_STATE:
1227c478bd9Sstevel@tonic-gate
1237c478bd9Sstevel@tonic-gateall:	$(PROG) $(LDAPCLIENTPROG) $(LDAPADDENTPROG) $(IDSCONFIGPROG)
1247c478bd9Sstevel@tonic-gate
1257c478bd9Sstevel@tonic-gate$(LDAPADD):	$(LDAPMOD)
1267c478bd9Sstevel@tonic-gate		@$(RM) $(LDAPADD); $(LN) $(LDAPMOD) $(LDAPADD)
1277c478bd9Sstevel@tonic-gate
1287c478bd9Sstevel@tonic-gate$(LDAPPROG):	../common/$$@.c $(LDAPCOMMOBJS)
1297c478bd9Sstevel@tonic-gate		$(LINK.c) -o $@ ../common/$@.c $(LDAPCOMMOBJS) $(LDLIBS)
1307c478bd9Sstevel@tonic-gate		$(POST_PROCESS)
1317c478bd9Sstevel@tonic-gate
1327c478bd9Sstevel@tonic-gate%.o:		../common/%.c
1337c478bd9Sstevel@tonic-gate		$(COMPILE.c) -o $@ $<
1347c478bd9Sstevel@tonic-gate		$(POST_PROCESS_O)
1357c478bd9Sstevel@tonic-gate
1367c478bd9Sstevel@tonic-gate%.o:		../ns_ldap/%.c
1377c478bd9Sstevel@tonic-gate		$(COMPILE.c) -o $@ $<
1387c478bd9Sstevel@tonic-gate		$(POST_PROCESS_O)
1397c478bd9Sstevel@tonic-gate
1407c478bd9Sstevel@tonic-gateidsconfig:	../ns_ldap/$$@.sh
1417c478bd9Sstevel@tonic-gate		$(CP) ../ns_ldap/$(IDSCONFIGSRC) $(IDSCONFIGPROG)
1427c478bd9Sstevel@tonic-gate		$(CHMOD) 755 $(IDSCONFIGPROG)
1437c478bd9Sstevel@tonic-gate
1447c478bd9Sstevel@tonic-gateldaplist:	$(LDAPLISTOBJS)
1457c478bd9Sstevel@tonic-gate		$(LINK.c) -o $@ $(LDAPLISTOBJS) $(LDLIBS)
1467c478bd9Sstevel@tonic-gate		$(POST_PROCESS)
1477c478bd9Sstevel@tonic-gate
1487c478bd9Sstevel@tonic-gateldapaddent:	$(LDAPADDENTOBJS)
1497c478bd9Sstevel@tonic-gate		$(LINK.c) -o $@ $(LDAPADDENTOBJS) $(LDLIBS)
1507c478bd9Sstevel@tonic-gate		$(POST_PROCESS)
1517c478bd9Sstevel@tonic-gate
1527c478bd9Sstevel@tonic-gateldapclient:	$(LDAPCLIENTOBJS)
1537c478bd9Sstevel@tonic-gate		$(LINK.c) -o $@ $(LDAPCLIENTOBJS) $(LDLIBS)
1547c478bd9Sstevel@tonic-gate		$(POST_PROCESS)
1557c478bd9Sstevel@tonic-gate
1567c478bd9Sstevel@tonic-gateinstall: all $(ROOTVAR_LDAP) $(ROOTUSRLIBLDAP) $(ROOTADD) $(ROOTSBIN) \
1577c478bd9Sstevel@tonic-gate		$(ROOTSCRIPT)
1587c478bd9Sstevel@tonic-gate
1597c478bd9Sstevel@tonic-gate$(ROOTUSRLIBLDAP):
1607c478bd9Sstevel@tonic-gate		$(INS.dir)
1617c478bd9Sstevel@tonic-gate
1627c478bd9Sstevel@tonic-gate$(ROOTVAR_LDAP):
1637c478bd9Sstevel@tonic-gate		$(INS.dir)
1647c478bd9Sstevel@tonic-gate
1657c478bd9Sstevel@tonic-gate$(ROOTADD):	$(ROOTPROG)
1667c478bd9Sstevel@tonic-gate		$(RM) $@
1677c478bd9Sstevel@tonic-gate		$(LN) $(ROOTMOD) $@
1687c478bd9Sstevel@tonic-gate
1697c478bd9Sstevel@tonic-gate$(ROOTUSRLIBLDAP)/%:	%
1707c478bd9Sstevel@tonic-gate		$(INS.file)
1717c478bd9Sstevel@tonic-gate
1727c478bd9Sstevel@tonic-gateFRC:
1737c478bd9Sstevel@tonic-gate
1747c478bd9Sstevel@tonic-gateclean:
1756c4d349cSsm26363	$(RM) $(OBJS)
1767c478bd9Sstevel@tonic-gate
17768e40ea6SMilan Jurik# Not linted Mozilla upstream commands
17868e40ea6SMilan Juriklint: lintns_ldaplist lintns_ldapaddent lintns_ldapclient
1797c478bd9Sstevel@tonic-gate
180e1dd0a2fSth160488lintns_ldaplist := C99MODE = $(C99_ENABLE)
181e1dd0a2fSth160488
1827c478bd9Sstevel@tonic-gatelintns_ldaplist:
18368e40ea6SMilan Jurik	$(LINT.c) $(LDAPLISTSRCS:%=../ns_ldap/%) $(LDLIBS) -lsldap
1847c478bd9Sstevel@tonic-gate
185e1dd0a2fSth160488lintns_ldapaddent := C99MODE = $(C99_ENABLE)
186e1dd0a2fSth160488
1877c478bd9Sstevel@tonic-gatelintns_ldapaddent:
1887c478bd9Sstevel@tonic-gate	$(LINT.c) $(LDAPADDENTSRCS:%=../ns_ldap/%) $(LDLIBS) -lsldap -lnsl \
18968e40ea6SMilan Jurik		-lsecdb
1907c478bd9Sstevel@tonic-gate
191e1dd0a2fSth160488lintns_ldapclient := C99MODE = $(C99_ENABLE)
192e1dd0a2fSth160488
1937c478bd9Sstevel@tonic-gatelintns_ldapclient:
19468e40ea6SMilan Jurik	$(LINT.c) $(LDAPCLIENTSRCS:%=../ns_ldap/%) $(LDLIBS) -lsldap -lscf
1957c478bd9Sstevel@tonic-gate
1967c478bd9Sstevel@tonic-gatelintc_%:
1976c4d349cSsm26363	$(LINT.c) $(@:lintc_%=../common/%.c) $(LDAPCOMMSRC:%=../common/%) \
19868e40ea6SMilan Jurik		 $(LDLIBS)
1997c478bd9Sstevel@tonic-gate
2007c478bd9Sstevel@tonic-gateinclude $(SRC)/cmd/Makefile.targ
201