xref: /titanic_51/usr/src/cmd/nscd/Makefile (revision 791a814c934fcd4deb13b26c1f116ff283272a0d)
1#
2# CDDL HEADER START
3#
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.
7#
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.
12#
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]
18#
19# CDDL HEADER END
20#
21#
22# Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
23# Use is subject to license terms.
24#
25# Makefile for name service cache daemon
26#
27
28PROG=		nscd
29NISPROG=	nscd_nischeck
30MANIFEST=	name-service-cache.xml
31SVCMETHOD=	svc-nscd
32
33include ../Makefile.cmd
34
35ROOTMANIFESTDIR=	$(ROOTSVCSYSTEM)
36
37OBJS=	server.o getpw.o getgr.o gethost.o getnode.o \
38	getether.o getrpc.o getproto.o getnet.o \
39	getbootp.o getauuser.o getauth.o getserv.o \
40	getnetmasks.o getprinter.o getproject.o \
41	getexec.o getprof.o getuser.o cache.o \
42	nscd_biggest.o nscd_wait.o \
43	nscd_init.o nscd_access.o nscd_cfgfile.o nscd_config.o \
44	nscd_dbimpl.o nscd_getentctx.o nscd_intaddr.o \
45	nscd_log.o nscd_nswconfig.o nscd_nswstate.o nscd_nswcfgst.o \
46	nscd_seqnum.o nscd_smfmonitor.o \
47	nscd_switch.o nscd_nswparse.o nscd_initf.o nscd_selfcred.o \
48	nscd_frontend.o nscd_admin.o nscd_door.o \
49	gettnrhtp.o gettnrhdb.o
50
51NISOBJS=	nscd_nischeck.o
52
53CLOBBERFILES=	nscd nscd_nischeck
54
55SRCS=	${OBJS:%.o=%.c}
56
57NISSRC=	${NISOBJS:%.o=%.c}
58
59CFLAGS +=	$(CCVERBOSE)
60CPPFLAGS +=	-D_REENTRANT -DSUN_THREADS \
61		-I../../lib/libc/port/gen -I../../lib/libc/inc \
62		-I../../lib/libsldap/common
63LINTFLAGS +=	-erroff=E_GLOBAL_COULD_BE_STATIC2
64LINTFLAGS +=	-erroff=E_NAME_USED_NOT_DEF2
65LINTFLAGS +=	-erroff=E_NAME_DEF_NOT_USED2
66
67# nscd interposes on many symbols, and must export others for its own dlsym()
68# use, and dlsym() calls from libc.  Itemizing the interfaces within a mapfile
69# is error-prone, so establish the whole object as an interposer.
70LDFLAGS +=	$(ZINTERPOSE)
71
72# TCOV_FLAG=	-ql
73# GPROF_FLAG=	-xpg
74# DEBUG_FLAG=	-g
75
76PROGLIBS=	$(LDLIBS) -lresolv -lnsl -lsocket -lumem -lscf -lavl
77NISPROGLIBS=	$(LDLIBS) -lnsl
78
79# install macros and rule
80#
81ROOTPROG=	${ROOTUSRSBIN}/nscd
82ROOTNISPROG=	${ROOTLIB}/nscd_nischeck
83
84.KEEP_STATE:
85
86all: $(PROG) $(NISPROG)
87
88${PROG}: ${OBJS}
89	${LINK.c} ${OPT} -o $@ ${OBJS} ${PROGLIBS}
90	${POST_PROCESS}
91
92${NISPROG}: ${NISOBJS}
93	${LINK.c} ${OPT} -o $@ ${NISOBJS} ${NISPROGLIBS}
94	${POST_PROCESS}
95
96lint:
97	$(LINT.c) ${SRCS} ${PROGLIBS}
98	$(LINT.c) ${NISSRC} ${NISPROGLIBS}
99
100cstyle:
101	${CSTYLE} ${SRCS} ${NISSRC}
102
103install: all $(ROOTPROG) $(ROOTNISPROG) $(ROOTMANIFEST) $(ROOTSVCMETHOD)
104
105check:	$(CHKMANIFEST)
106
107clean:
108	${RM} ${OBJS} ${NISOBJS}
109
110${ROOTUSRSBIN}/%: %
111	${INS.file}
112
113${ROOTUSRLIB}/%: %
114	${INS.file}
115
116include ../Makefile.targ
117