xref: /illumos-gate/usr/src/cmd/idmap/idmapd/Makefile (revision 5db531e3faa94427746eae754b11770fd8416b6d)
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# Copyright 2014 Nexenta Systems, Inc.  All rights reserved.
24#
25
26PROG =		idmapd
27MANIFEST =	idmap.xml
28SERVEROBJS =				\
29	adspriv_impl.o			\
30	directory_provider_builtin.o	\
31	directory_provider_nsswitch.o	\
32	directory_provider_ad.o		\
33	directory_server.o		\
34	adutils.o			\
35	dbutils.o			\
36	idmap_config.o			\
37	idmapd.o			\
38	init.o				\
39	idmap_lsa.o			\
40	krb5_lookup.o			\
41	nldaputils.o			\
42	server.o			\
43	wksids.o
44
45GENOBJS =				\
46	adspriv_srv.o			\
47	rpc_svc.o
48
49SERVERSRCS =	$(SERVEROBJS:%.o=%.c)
50GENSRCS = 	$(GENOBJS:%.o=%.c)
51OBJS =		$(SERVEROBJS) $(GENOBJS)
52SRCS =		$(SERVERSRCS)
53POFILES =	$(OBJS:%.o=%.po)
54
55all :=		TARGET = all
56install :=	TARGET = install
57clean :=	TARGET = clean
58clobber :=	TARGET = clobber
59
60include ../../Makefile.cmd
61
62CERRWARN +=	-_gcc=-Wno-type-limits
63CERRWARN +=	-_gcc=-Wno-switch
64CERRWARN +=	-_gcc=-Wno-uninitialized
65
66TEXT_DOMAIN =	SUNW_OST_OSLIB
67XGETTEXT =	$(GNUXGETTEXT)
68XGETFLAGS =	--foreign-user --strict -n -E --width=72 \
69		--omit-header --keyword=directoryError:2 \
70		--language=C --force-po
71
72C99MODE = $(C99_ENABLE)
73POFILE =	$(PROG)_all.po
74
75RPC_MSGOUT_OPT = -DRPC_MSGOUT=idmap_rpc_msgout
76
77ROOTMANIFESTDIR = $(ROOTSVCSYSTEM)
78$(ROOTMANIFEST) := FILEMODE= 444
79RPCSVC= ../../../uts/common/rpcsvc
80ADS_CMN=../../../lib/libads/common
81
82INCS += -I. -I../../../lib/libidmap/common \
83	 -I../../../lib/libsldap/common \
84	 -I../../../lib/libadutils/common \
85	 -I $(ADS_CMN) \
86	 -I../../../lib/smbsrv/libsmb/common
87
88# Should not have to do this, but the Kerberos includes are a mess.
89INCS += -I $(ROOT)/usr/include/kerberosv5
90
91$(OBJS) := CPPFLAGS += $(INCS) -D_REENTRANT
92$(POFILE) := CPPFLAGS += $(INCS)
93
94LINTFLAGS += -xerroff=E_NAME_DEF_NOT_USED2
95LINTFLAGS += -xerroff=E_NAME_USED_NOT_DEF2
96
97CFLAGS += $(CCVERBOSE)
98LDLIBS += \
99	-lsqlite-sys \
100	-lsecdb \
101	-lsocket \
102	-lnsl \
103	-lidmap \
104	-lscf \
105	-lsldap \
106	-lldap \
107	-luuid \
108	-ladutils \
109	-lads \
110	-lumem \
111	-lnvpair \
112	-luutil \
113	-L $(ROOT)/usr/lib/smbsrv \
114	-lsmb
115
116rpc_svc.o := CFLAGS += $(RPC_MSGOUT_OPT)
117
118$(PROG) := MAPFILES = $(MAPFILE.INT) $(MAPFILE.NGB)
119$(PROG) := LDFLAGS += $(MAPFILES:%=-M%) \
120	-R /usr/lib/smbsrv
121
122DIRMODE = 0755
123FILEMODE = 0555
124
125lint_SRCS := CPPFLAGS += $(INCS) -D_REENTRANT $(RPC_MSGOUT_OPT)
126
127.KEEP_STATE:
128
129.PARALLEL: $(OBJS)
130
131all: $(PROG)
132
133$(PROG): $(OBJS) $$(MAPFILES)
134	$(LINK.c) -o $@ $(OBJS) $(LDLIBS)
135	$(POST_PROCESS)
136
137$(POFILE): $(POFILES)
138	$(RM) $(POFILE)
139	cat $(POFILES) > $(POFILE)
140
141install: all $(ROOTLIBPROG) $(ROOTMANIFEST)
142
143check: $(CHKMANIFEST)
144
145clean:
146	$(RM) $(OBJS) $(GENSRCS)
147
148lint:   lint_SRCS
149
150lint_SRCS:
151
152RPCGENFLAGS = -CMN
153
154adspriv_srv.o : adspriv_srv.c
155
156adspriv_srv.c:
157	$(RPCGEN) $(RPCGENFLAGS) -m $(ADS_CMN)/ads_priv.x > $@
158
159rpc_svc.o : rpc_svc.c
160
161rpc_svc.c : $(RPCSVC)/idmap_prot.x
162	$(RPCGEN) $(RPCGENFLAGS) -m $(RPCSVC)/idmap_prot.x > $@
163
164include ../../Makefile.targ
165