xref: /illumos-gate/usr/src/cmd/idmap/idmapd/Makefile (revision e59325b74ca0760391c4b4d3acd8d3294ffc521a)
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 +=	-_gcc=-Wno-uninitialized
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
98LINTFLAGS += -xerroff=E_NAME_DEF_NOT_USED2
99LINTFLAGS += -xerroff=E_NAME_USED_NOT_DEF2
100
101CFLAGS += $(CCVERBOSE)
102LDLIBS += \
103	-lsqlite-sys \
104	-lsecdb \
105	-lsocket \
106	-lnsl \
107	-lidmap \
108	-lscf \
109	-lsldap \
110	-lldap \
111	-luuid \
112	-ladutils \
113	-lads \
114	-lumem \
115	-lnvpair \
116	-luutil \
117	-L $(ROOT)/usr/lib/smbsrv \
118	-lsmb
119
120rpc_svc.o := CFLAGS += $(RPC_MSGOUT_OPT)
121
122$(PROG) := MAPFILES = $(MAPFILE.INT) $(MAPFILE.NGB)
123$(PROG) := LDFLAGS += $(MAPFILES:%=-M%) \
124	-R /usr/lib/smbsrv
125
126DIRMODE = 0755
127FILEMODE = 0555
128
129lint_SRCS := CPPFLAGS += $(INCS) -D_REENTRANT $(RPC_MSGOUT_OPT)
130
131.KEEP_STATE:
132
133.PARALLEL: $(OBJS)
134
135all: $(PROG)
136
137$(PROG): $(OBJS) $$(MAPFILES)
138	$(LINK.c) -o $@ $(OBJS) $(LDLIBS)
139	$(POST_PROCESS)
140
141$(POFILE): $(POFILES)
142	$(RM) $(POFILE)
143	cat $(POFILES) > $(POFILE)
144
145install: all $(ROOTLIBPROG) $(ROOTMANIFEST)
146
147check: $(CHKMANIFEST)
148
149clean:
150	$(RM) $(OBJS) $(GENSRCS)
151
152lint:   lint_SRCS
153
154lint_SRCS:
155
156RPCGENFLAGS = -CMN
157
158adspriv_srv.o : adspriv_srv.c
159
160adspriv_srv.c:
161	$(RPCGEN) $(RPCGENFLAGS) -m $(ADS_CMN)/ads_priv.x > $@
162
163rpc_svc.o : rpc_svc.c
164
165rpc_svc.c : $(RPCSVC)/idmap_prot.x
166	$(RPCGEN) $(RPCGENFLAGS) -m $(RPCSVC)/idmap_prot.x > $@
167
168include ../../Makefile.targ
169