xref: /illumos-gate/usr/src/cmd/idmap/idmapd/Makefile (revision 5661bb76)
1c5c4113dSnw#
2c5c4113dSnw# CDDL HEADER START
3c5c4113dSnw#
4c5c4113dSnw# The contents of this file are subject to the terms of the
5c5c4113dSnw# Common Development and Distribution License (the "License").
6c5c4113dSnw# You may not use this file except in compliance with the License.
7c5c4113dSnw#
8c5c4113dSnw# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9c5c4113dSnw# or http://www.opensolaris.org/os/licensing.
10c5c4113dSnw# See the License for the specific language governing permissions
11c5c4113dSnw# and limitations under the License.
12c5c4113dSnw#
13c5c4113dSnw# When distributing Covered Code, include this CDDL HEADER in each
14c5c4113dSnw# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15c5c4113dSnw# If applicable, add the following below this CDDL HEADER, with the
16c5c4113dSnw# fields enclosed by brackets "[]" replaced with your own identifying
17c5c4113dSnw# information: Portions Copyright [yyyy] [name of copyright owner]
18c5c4113dSnw#
19c5c4113dSnw# CDDL HEADER END
20c5c4113dSnw#
21c5c4113dSnw#
22148c5f43SAlan Wright# Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved.
23b3700b07SGordon Ross# Copyright 2014 Nexenta Systems, Inc.  All rights reserved.
24c5c4113dSnw#
25*5661bb76SJohn Levon# Copyright (c) 2018, Joyent, Inc.
26c5c4113dSnw
27c5c4113dSnwPROG =		idmapd
28c5c4113dSnwMANIFEST =	idmap.xml
291fcced4cSJordan BrownSERVEROBJS =				\
30b3700b07SGordon Ross	adspriv_impl.o			\
311fcced4cSJordan Brown	directory_provider_builtin.o	\
321fcced4cSJordan Brown	directory_provider_nsswitch.o	\
331fcced4cSJordan Brown	directory_provider_ad.o		\
341fcced4cSJordan Brown	directory_server.o		\
351fcced4cSJordan Brown	adutils.o			\
361fcced4cSJordan Brown	dbutils.o			\
371fcced4cSJordan Brown	idmap_config.o			\
381fcced4cSJordan Brown	idmapd.o			\
391fcced4cSJordan Brown	init.o				\
40cb174861Sjoyce mcintosh	idmap_lsa.o			\
41b3700b07SGordon Ross	krb5_lookup.o			\
421fcced4cSJordan Brown	nldaputils.o			\
431fcced4cSJordan Brown	server.o			\
441fcced4cSJordan Brown	wksids.o
451fcced4cSJordan Brown
46b3700b07SGordon RossGENOBJS =				\
47b3700b07SGordon Ross	adspriv_srv.o			\
48b3700b07SGordon Ross	rpc_svc.o
49b3700b07SGordon Ross
50c5c4113dSnwSERVERSRCS =	$(SERVEROBJS:%.o=%.c)
51b3700b07SGordon RossGENSRCS = 	$(GENOBJS:%.o=%.c)
52b3700b07SGordon RossOBJS =		$(SERVEROBJS) $(GENOBJS)
53c5c4113dSnwSRCS =		$(SERVERSRCS)
54c5c4113dSnwPOFILES =	$(OBJS:%.o=%.po)
55c5c4113dSnw
56c5c4113dSnwall :=		TARGET = all
57c5c4113dSnwinstall :=	TARGET = install
58c5c4113dSnwclean :=	TARGET = clean
59c5c4113dSnwclobber :=	TARGET = clobber
60c5c4113dSnw
61c5c4113dSnwinclude ../../Makefile.cmd
62c5c4113dSnw
637014882cSRichard LoweCERRWARN +=	-_gcc=-Wno-type-limits
647014882cSRichard LoweCERRWARN +=	-_gcc=-Wno-switch
657014882cSRichard LoweCERRWARN +=	-_gcc=-Wno-uninitialized
667014882cSRichard Lowe
67*5661bb76SJohn Levon# not linted
68*5661bb76SJohn LevonSMATCH=off
69*5661bb76SJohn Levon
701fcced4cSJordan BrownTEXT_DOMAIN =	SUNW_OST_OSLIB
711fcced4cSJordan BrownXGETTEXT =	$(GNUXGETTEXT)
721fcced4cSJordan BrownXGETFLAGS =	--foreign-user --strict -n -E --width=72 \
731fcced4cSJordan Brown		--omit-header --keyword=directoryError:2 \
741fcced4cSJordan Brown		--language=C --force-po
751fcced4cSJordan Brown
76bd0ce624SYuri PankovCSTD = $(CSTD_GNU99)
77c5c4113dSnwPOFILE =	$(PROG)_all.po
78c5c4113dSnw
791fcced4cSJordan BrownRPC_MSGOUT_OPT = -DRPC_MSGOUT=idmap_rpc_msgout
801fcced4cSJordan Brown
81c5c4113dSnwROOTMANIFESTDIR = $(ROOTSVCSYSTEM)
82c5c4113dSnw$(ROOTMANIFEST) := FILEMODE= 444
83b3700b07SGordon RossRPCSVC= ../../../uts/common/rpcsvc
84b3700b07SGordon RossADS_CMN=../../../lib/libads/common
85c5c4113dSnw
86b3700b07SGordon RossINCS += -I. -I../../../lib/libidmap/common \
87b3700b07SGordon Ross	 -I../../../lib/libsldap/common \
88148c5f43SAlan Wright	 -I../../../lib/libadutils/common \
89b3700b07SGordon Ross	 -I $(ADS_CMN) \
90148c5f43SAlan Wright	 -I../../../lib/smbsrv/libsmb/common
91c5c4113dSnw
92b3700b07SGordon Ross# Should not have to do this, but the Kerberos includes are a mess.
93b3700b07SGordon RossINCS += -I $(ROOT)/usr/include/kerberosv5
94b3700b07SGordon Ross
95c5c4113dSnw$(OBJS) := CPPFLAGS += $(INCS) -D_REENTRANT
96c5c4113dSnw$(POFILE) := CPPFLAGS += $(INCS)
97c5c4113dSnw
98b3700b07SGordon RossLINTFLAGS += -xerroff=E_NAME_DEF_NOT_USED2
99b3700b07SGordon RossLINTFLAGS += -xerroff=E_NAME_USED_NOT_DEF2
100b3700b07SGordon Ross
1017014882cSRichard LoweCFLAGS += $(CCVERBOSE)
10291d7f85eSGordon RossLDLIBS += \
10391d7f85eSGordon Ross	-lsqlite-sys \
10491d7f85eSGordon Ross	-lsecdb \
1051fcced4cSJordan Brown	-lsocket \
1061fcced4cSJordan Brown	-lnsl \
1071fcced4cSJordan Brown	-lidmap \
1081fcced4cSJordan Brown	-lscf \
1091fcced4cSJordan Brown	-lsldap \
1101fcced4cSJordan Brown	-lldap \
1111fcced4cSJordan Brown	-luuid \
1121fcced4cSJordan Brown	-ladutils \
113b3700b07SGordon Ross	-lads \
114148c5f43SAlan Wright	-lumem \
115148c5f43SAlan Wright	-lnvpair \
116cb174861Sjoyce mcintosh	-luutil \
117148c5f43SAlan Wright	-L $(ROOT)/usr/lib/smbsrv \
118148c5f43SAlan Wright	-lsmb
1191fcced4cSJordan Brown
1201fcced4cSJordan Brownrpc_svc.o := CFLAGS += $(RPC_MSGOUT_OPT)
121c5c4113dSnw
122c5c4113dSnw$(PROG) := MAPFILES = $(MAPFILE.INT) $(MAPFILE.NGB)
123148c5f43SAlan Wright$(PROG) := LDFLAGS += $(MAPFILES:%=-M%) \
124148c5f43SAlan Wright	-R /usr/lib/smbsrv
125c5c4113dSnw
126c5c4113dSnwDIRMODE = 0755
127c5c4113dSnwFILEMODE = 0555
128c5c4113dSnw
1291fcced4cSJordan Brownlint_SRCS := CPPFLAGS += $(INCS) -D_REENTRANT $(RPC_MSGOUT_OPT)
130c5c4113dSnw
131c5c4113dSnw.KEEP_STATE:
132c5c4113dSnw
133c5c4113dSnw.PARALLEL: $(OBJS)
134c5c4113dSnw
135c5c4113dSnwall: $(PROG)
136c5c4113dSnw
1379b214d32SJordan Brown$(PROG): $(OBJS) $$(MAPFILES)
13891d7f85eSGordon Ross	$(LINK.c) -o $@ $(OBJS) $(LDLIBS)
139c5c4113dSnw	$(POST_PROCESS)
140c5c4113dSnw
141c5c4113dSnw$(POFILE): $(POFILES)
142c5c4113dSnw	$(RM) $(POFILE)
143c5c4113dSnw	cat $(POFILES) > $(POFILE)
144c5c4113dSnw
145c5c4113dSnwinstall: all $(ROOTLIBPROG) $(ROOTMANIFEST)
146c5c4113dSnw
147c5c4113dSnwcheck: $(CHKMANIFEST)
148c5c4113dSnw
149c5c4113dSnwclean:
150b3700b07SGordon Ross	$(RM) $(OBJS) $(GENSRCS)
151c5c4113dSnw
152c5c4113dSnwlint:   lint_SRCS
153c5c4113dSnw
154c5c4113dSnwlint_SRCS:
155c5c4113dSnw
156b3700b07SGordon RossRPCGENFLAGS = -CMN
157c5c4113dSnw
158b3700b07SGordon Rossadspriv_srv.o : adspriv_srv.c
159c5c4113dSnw
160b3700b07SGordon Rossadspriv_srv.c:
161b3700b07SGordon Ross	$(RPCGEN) $(RPCGENFLAGS) -m $(ADS_CMN)/ads_priv.x > $@
162b3700b07SGordon Ross
163b3700b07SGordon Rossrpc_svc.o : rpc_svc.c
164b3700b07SGordon Ross
165b3700b07SGordon Rossrpc_svc.c : $(RPCSVC)/idmap_prot.x
166b3700b07SGordon Ross	$(RPCGEN) $(RPCGENFLAGS) -m $(RPCSVC)/idmap_prot.x > $@
167b3700b07SGordon Ross
168b3700b07SGordon Rossinclude ../../Makefile.targ
169