xref: /titanic_52/usr/src/cmd/idmap/idmapd/Makefile (revision a60fc142342386d0b786e65fba901234400d7020)
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
28PROG =		idmapd
29MANIFEST =	idmap.xml
30SERVEROBJS =	idmapd.o init.o dbutils.o rpc_svc.o server.o adutils.o \
31	idmap_config.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
58$(OBJS) := CPPFLAGS += $(INCS) -D_REENTRANT
59$(POFILE) := CPPFLAGS += $(INCS)
60CLOBBERFILES += $(IDMAP_PROT_H)
61
62CFLAGS += -v
63LDLIBS += -lsecdb -lnsl -lidmap -lscf -lldap
64
65$(PROG) := MAPFILES = $(MAPFILE.INT) $(MAPFILE.NGB)
66$(PROG) := LDFLAGS += $(MAPFILES:%=-M%)
67
68DIRMODE = 0755
69FILEMODE = 0555
70OWNER = root
71GROUP = sys
72
73lint_SRCS := CPPFLAGS += $(INCS) -D_REENTRANT
74lint := LDLIBS += $(SQLITELINT)
75
76.KEEP_STATE:
77
78.PARALLEL: $(OBJS)
79
80all: $(PROG)
81
82$(IDMAP_PROT_H):	$(IDMAP_PROT_X)
83	$(RM) $@; $(RPCGEN) -CMNh -o $@ $(IDMAP_PROT_X)
84
85$(PROG): $(IDMAP_PROT_H) $(OBJS) $$(MAPFILES)
86	$(LINK.c) -o $@ $(OBJS) $(LIBSQLITE) $(LDLIBS)
87	$(POST_PROCESS)
88
89$(POFILE): $(POFILES)
90	$(RM) $(POFILE)
91	cat $(POFILES) > $(POFILE)
92
93install: all $(ROOTLIBPROG) $(ROOTMANIFEST)
94
95check: $(CHKMANIFEST)
96
97clean:
98	$(RM) $(OBJS)
99
100clobber:
101
102lint:   lint_SRCS
103
104lint_SRCS:
105
106include ../../Makefile.targ
107
108FRC:
109
110