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