xref: /illumos-gate/usr/src/cmd/ldapcachemgr/Makefile (revision d3b5f56344d8bfcdd6cfb82446af0e5e55ad9ebe)
17c478bd9Sstevel@tonic-gate#
27c478bd9Sstevel@tonic-gate# CDDL HEADER START
37c478bd9Sstevel@tonic-gate#
47c478bd9Sstevel@tonic-gate# The contents of this file are subject to the terms of the
5cb5caa98Sdjl# Common Development and Distribution License (the "License").
6cb5caa98Sdjl# You may not use this file except in compliance with the License.
77c478bd9Sstevel@tonic-gate#
87c478bd9Sstevel@tonic-gate# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
97c478bd9Sstevel@tonic-gate# or http://www.opensolaris.org/os/licensing.
107c478bd9Sstevel@tonic-gate# See the License for the specific language governing permissions
117c478bd9Sstevel@tonic-gate# and limitations under the License.
127c478bd9Sstevel@tonic-gate#
137c478bd9Sstevel@tonic-gate# When distributing Covered Code, include this CDDL HEADER in each
147c478bd9Sstevel@tonic-gate# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
157c478bd9Sstevel@tonic-gate# If applicable, add the following below this CDDL HEADER, with the
167c478bd9Sstevel@tonic-gate# fields enclosed by brackets "[]" replaced with your own identifying
177c478bd9Sstevel@tonic-gate# information: Portions Copyright [yyyy] [name of copyright owner]
187c478bd9Sstevel@tonic-gate#
197c478bd9Sstevel@tonic-gate# CDDL HEADER END
207c478bd9Sstevel@tonic-gate#
217c478bd9Sstevel@tonic-gate#
2224fe0b3bSjmcp# Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
237c478bd9Sstevel@tonic-gate# Use is subject to license terms.
247c478bd9Sstevel@tonic-gate#
255661bb76SJohn Levon# Copyright (c) 2018, Joyent, Inc.
267c478bd9Sstevel@tonic-gate
277c478bd9Sstevel@tonic-gatePROG=	ldap_cachemgr
287c478bd9Sstevel@tonic-gate
297c478bd9Sstevel@tonic-gateMANIFEST=	client.xml
309e2871ecSrm88369SVCMETHOD=	ldap-client
317c478bd9Sstevel@tonic-gate
327c478bd9Sstevel@tonic-gateinclude ../Makefile.cmd
337c478bd9Sstevel@tonic-gate
347c478bd9Sstevel@tonic-gate#
357c478bd9Sstevel@tonic-gate# To compile in the $mgr SLP support
367c478bd9Sstevel@tonic-gate# 1. add -DSLP in to CPPFLAGS line
377c478bd9Sstevel@tonic-gate# 2. add cachemgr_discovery.o to the OBJS line
387c478bd9Sstevel@tonic-gate# 3. add -lslp in the LDLIBS line
397c478bd9Sstevel@tonic-gate#
407c478bd9Sstevel@tonic-gate
417c478bd9Sstevel@tonic-gateROOTLDAPLIB=	$(ROOT)/usr/lib/ldap
427c478bd9Sstevel@tonic-gateROOTLDAPPROG=	$(PROG:%=$(ROOTLDAPLIB)/%)
437c478bd9Sstevel@tonic-gate
447c478bd9Sstevel@tonic-gateROOTMANIFESTDIR=	$(ROOTSVCNETWORKLDAP)
457c478bd9Sstevel@tonic-gate
46e1dd0a2fSth160488OBJS=	cachemgr.o cachemgr_getldap.o cachemgr_parse.o cachemgr_change.o
477c478bd9Sstevel@tonic-gate
487c478bd9Sstevel@tonic-gateSRCS=	${OBJS:%.o=%.c}
497c478bd9Sstevel@tonic-gate
507c478bd9Sstevel@tonic-gateCPPFLAGS +=	-D_REENTRANT -DSUN_THREADS \
518142c2b2Schinlong		-I$(SRC)/lib/libsldap/common \
528142c2b2Schinlong		-I$(SRC)/lib/libldap5/include/ldap \
538142c2b2Schinlong		-I$(SRC)/lib/libc/port/gen
547c478bd9Sstevel@tonic-gate
557014882cSRichard LoweCERRWARN +=	-_gcc=-Wno-parentheses
567014882cSRichard LoweCERRWARN +=	-_gcc=-Wno-switch
57*d3b5f563SJohn LevonCERRWARN +=	$(CNOWARN_UNINIT)
587014882cSRichard Lowe
595661bb76SJohn Levon# not linted
605661bb76SJohn LevonSMATCH=off
615661bb76SJohn Levon
627c478bd9Sstevel@tonic-gate# Message files
637c478bd9Sstevel@tonic-gatePOFILE=		ldap_cachemgr.po
647c478bd9Sstevel@tonic-gatePOFILES=	${OBJS:%.o=%.po}
657c478bd9Sstevel@tonic-gate
667c478bd9Sstevel@tonic-gateLINTOUT=        lint.out
677c478bd9Sstevel@tonic-gate
687c478bd9Sstevel@tonic-gate# TCOV_FLAG=	-ql
697c478bd9Sstevel@tonic-gate
70e1dd0a2fSth160488LDLIBS +=	-lumem -lsldap
717c478bd9Sstevel@tonic-gate
727c478bd9Sstevel@tonic-gate# install macros and rule
737c478bd9Sstevel@tonic-gate#
747c478bd9Sstevel@tonic-gate
757c478bd9Sstevel@tonic-gate.KEEP_STATE:
767c478bd9Sstevel@tonic-gate
777c478bd9Sstevel@tonic-gateclean := TARGET= clean
787c478bd9Sstevel@tonic-gateclobber := TARGET= clobber
797c478bd9Sstevel@tonic-gate
809e2871ecSrm88369$(ROOTSVCMETHOD) := FILEMODE = 0555
817c478bd9Sstevel@tonic-gate
827c478bd9Sstevel@tonic-gateall: $(PROG)
837c478bd9Sstevel@tonic-gate
847c478bd9Sstevel@tonic-gate${PROG}: ${OBJS}
857c478bd9Sstevel@tonic-gate	${LINK.c} ${OPT} -o $@ ${OBJS} ${LDLIBS}
867c478bd9Sstevel@tonic-gate	${POST_PROCESS}
877c478bd9Sstevel@tonic-gate
887c478bd9Sstevel@tonic-gate$(ROOTLDAPLIB):
897c478bd9Sstevel@tonic-gate	$(INS.dir)
907c478bd9Sstevel@tonic-gate
917c478bd9Sstevel@tonic-gate$(ROOTLDAPLIB)/%:	%
927c478bd9Sstevel@tonic-gate	$(INS.file)
937c478bd9Sstevel@tonic-gate
947c478bd9Sstevel@tonic-gatelint :=	LINTFLAGS=-x -b -u -h
957c478bd9Sstevel@tonic-gate
967c478bd9Sstevel@tonic-gatelint:
977c478bd9Sstevel@tonic-gate	$(LINT.c) ${SRCS}  > $(LINTOUT) 2>&1
987c478bd9Sstevel@tonic-gate
997c478bd9Sstevel@tonic-gatecstyle:
1007c478bd9Sstevel@tonic-gate	${CSTYLE} ${SRCS}
1017c478bd9Sstevel@tonic-gate
1029e2871ecSrm88369install: all $(ROOTLDAPLIB) $(ROOTLDAPPROG) $(ROOTMANIFEST) $(ROOTSVCMETHOD)
1037c478bd9Sstevel@tonic-gate
1047c478bd9Sstevel@tonic-gatecheck:	$(CHKMANIFEST)
1057c478bd9Sstevel@tonic-gate
1067c478bd9Sstevel@tonic-gateclean:
107b6805bf7SGordon Ross	$(RM) $(OBJS) $(LINTOUT)
1087c478bd9Sstevel@tonic-gate
1097c478bd9Sstevel@tonic-gate$(POFILE): $(POFILES)
1107c478bd9Sstevel@tonic-gate	$(RM) $@
1117c478bd9Sstevel@tonic-gate	cat $(POFILES) > $@
1127c478bd9Sstevel@tonic-gate
1137c478bd9Sstevel@tonic-gateinclude $(SRC)/cmd/Makefile.targ
114