xref: /titanic_41/usr/src/cmd/idmap/idmapd/Makefile (revision b7d3956b92a285d8dac2c7f5f7e28d2ef5347ef8)
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 2008 Sun Microsystems, Inc.  All rights reserved.
23# Use is subject to license terms.
24#
25#ident	"%Z%%M%	%I%	%E% SMI"
26#
27
28PROG =		idmapd
29MANIFEST =	idmap.xml
30SERVEROBJS =	idmapd.o init.o dbutils.o rpc_svc.o server.o adutils.o\
31	idmap_config.o nldaputils.o
32SERVERSRCS =	$(SERVEROBJS:%.o=%.c)
33OBJS =		$(SERVEROBJS)
34SRCS =		$(SERVERSRCS)
35POFILES =	$(OBJS:%.o=%.po)
36
37all :=		TARGET = all
38install :=	TARGET = install
39clean :=	TARGET = clean
40clobber :=	TARGET = clobber
41
42LIBSQLITE =	$(ROOT)/usr/lib/libsqlite.o
43SQLITELINT =	$(ROOT)/usr/lib/llib-lsqlite.ln
44
45IDMAP_PROT_DIR =        $(SRC)/head/rpcsvc
46IDMAP_PROT_X =          $(IDMAP_PROT_DIR)/idmap_prot.x
47IDMAP_PROT_H =          $(IDMAP_PROT_DIR)/idmap_prot.h
48
49include ../../Makefile.cmd
50
51POFILE =	$(PROG)_all.po
52
53ROOTMANIFESTDIR = $(ROOTSVCSYSTEM)
54$(ROOTMANIFEST) := FILEMODE= 444
55
56INCS += -I. -I../../../lib/libidmap/common -I$(IDMAP_PROT_DIR)\
57	 -I../../../lib/libsldap/common
58
59$(OBJS) := CPPFLAGS += $(INCS) -D_REENTRANT
60$(POFILE) := CPPFLAGS += $(INCS)
61CLOBBERFILES += $(IDMAP_PROT_H)
62
63CFLAGS += -v
64LDLIBS += -lsecdb -lsocket -lnsl -lidmap -lscf -lsldap -lldap -luuid
65
66$(PROG) := MAPFILES = $(MAPFILE.INT) $(MAPFILE.NGB)
67$(PROG) := LDFLAGS += $(MAPFILES:%=-M%)
68
69DIRMODE = 0755
70FILEMODE = 0555
71OWNER = root
72GROUP = sys
73
74lint_SRCS := CPPFLAGS += $(INCS) -D_REENTRANT
75lint := LDLIBS += $(SQLITELINT)
76
77.KEEP_STATE:
78
79.PARALLEL: $(OBJS)
80
81all: $(PROG)
82
83$(IDMAP_PROT_H):	$(IDMAP_PROT_X)
84	$(RM) $@; $(RPCGEN) -CMNh -o $@ $(IDMAP_PROT_X)
85
86$(PROG): $(IDMAP_PROT_H) $(OBJS) $$(MAPFILES)
87	$(LINK.c) -o $@ $(OBJS) $(LIBSQLITE) $(LDLIBS)
88	$(POST_PROCESS)
89
90$(POFILE): $(POFILES)
91	$(RM) $(POFILE)
92	cat $(POFILES) > $(POFILE)
93
94install: all $(ROOTLIBPROG) $(ROOTMANIFEST)
95
96check: $(CHKMANIFEST)
97
98clean:
99	$(RM) $(OBJS)
100
101clobber:
102
103lint:   lint_SRCS
104
105lint_SRCS:
106
107include ../../Makefile.targ
108
109FRC:
110
111