xref: /illumos-gate/usr/src/cmd/idmap/idmapd/Makefile (revision ded9341448cd6e2573619c7f6fe98909bdd35ec6)
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 (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved.
23#
24
25PROG =		idmapd
26MANIFEST =	idmap.xml
27SERVEROBJS =				\
28	directory_provider_builtin.o	\
29	directory_provider_nsswitch.o	\
30	directory_provider_ad.o		\
31	directory_server.o		\
32	adutils.o			\
33	dbutils.o			\
34	idmap_config.o			\
35	idmapd.o			\
36	init.o				\
37	idmap_lsa.o				\
38	nldaputils.o			\
39	rpc_svc.o			\
40	server.o			\
41	wksids.o
42
43SERVERSRCS =	$(SERVEROBJS:%.o=%.c)
44OBJS =		$(SERVEROBJS)
45SRCS =		$(SERVERSRCS)
46POFILES =	$(OBJS:%.o=%.po)
47
48all :=		TARGET = all
49install :=	TARGET = install
50clean :=	TARGET = clean
51clobber :=	TARGET = clobber
52
53LIBSQLITE =	$(ROOT)/usr/lib/libsqlite.o
54SQLITELINT =	$(ROOT)/usr/lib/llib-lsqlite.ln
55
56include ../../Makefile.cmd
57
58TEXT_DOMAIN =	SUNW_OST_OSLIB
59XGETTEXT =	$(GNUXGETTEXT)
60XGETFLAGS =	--foreign-user --strict -n -E --width=72 \
61		--omit-header --keyword=directoryError:2 \
62		--language=C --force-po
63
64C99MODE = $(C99_ENABLE)
65POFILE =	$(PROG)_all.po
66
67RPC_MSGOUT_OPT = -DRPC_MSGOUT=idmap_rpc_msgout
68
69ROOTMANIFESTDIR = $(ROOTSVCSYSTEM)
70$(ROOTMANIFEST) := FILEMODE= 444
71
72INCS += -I. -I../../../lib/libidmap/common\
73	 -I../../../lib/libsldap/common\
74	 -I../../../lib/libadutils/common \
75	 -I../../../lib/smbsrv/libsmb/common
76
77$(OBJS) := CPPFLAGS += $(INCS) -D_REENTRANT
78$(POFILE) := CPPFLAGS += $(INCS)
79
80CFLAGS += -v
81LDLIBS += -lsecdb \
82	-lsocket \
83	-lnsl \
84	-lidmap \
85	-lscf \
86	-lsldap \
87	-lldap \
88	-luuid \
89	-ladutils \
90	-lumem \
91	-lnvpair \
92	-L $(ROOT)/usr/lib/smbsrv \
93	-lsmb
94
95rpc_svc.o := CFLAGS += $(RPC_MSGOUT_OPT)
96
97$(PROG) := MAPFILES = $(MAPFILE.INT) $(MAPFILE.NGB)
98$(PROG) := LDFLAGS += $(MAPFILES:%=-M%) \
99	-R /usr/lib/smbsrv
100
101DIRMODE = 0755
102FILEMODE = 0555
103
104lint_SRCS := CPPFLAGS += $(INCS) -D_REENTRANT $(RPC_MSGOUT_OPT)
105lint := LDLIBS += $(SQLITELINT)
106
107.KEEP_STATE:
108
109.PARALLEL: $(OBJS)
110
111all: $(PROG)
112
113$(PROG): $(OBJS) $$(MAPFILES)
114	$(LINK.c) -o $@ $(OBJS) $(LIBSQLITE) $(LDLIBS)
115	$(POST_PROCESS)
116
117$(POFILE): $(POFILES)
118	$(RM) $(POFILE)
119	cat $(POFILES) > $(POFILE)
120
121install: all $(ROOTLIBPROG) $(ROOTMANIFEST)
122
123check: $(CHKMANIFEST)
124
125clean:
126	$(RM) $(OBJS)
127
128clobber:
129
130lint:   lint_SRCS
131
132lint_SRCS:
133
134include ../../Makefile.targ
135
136FRC:
137
138