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