xref: /illumos-gate/usr/src/cmd/idmap/idmapd/Makefile (revision b3700b07)
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.
23*b3700b07SGordon Ross# Copyright 2014 Nexenta Systems, Inc.  All rights reserved.
24c5c4113dSnw#
25c5c4113dSnw
26c5c4113dSnwPROG =		idmapd
27c5c4113dSnwMANIFEST =	idmap.xml
281fcced4cSJordan BrownSERVEROBJS =				\
29*b3700b07SGordon Ross	adspriv_impl.o			\
301fcced4cSJordan Brown	directory_provider_builtin.o	\
311fcced4cSJordan Brown	directory_provider_nsswitch.o	\
321fcced4cSJordan Brown	directory_provider_ad.o		\
331fcced4cSJordan Brown	directory_server.o		\
341fcced4cSJordan Brown	adutils.o			\
351fcced4cSJordan Brown	dbutils.o			\
361fcced4cSJordan Brown	idmap_config.o			\
371fcced4cSJordan Brown	idmapd.o			\
381fcced4cSJordan Brown	init.o				\
39cb174861Sjoyce mcintosh	idmap_lsa.o			\
40*b3700b07SGordon Ross	krb5_lookup.o			\
411fcced4cSJordan Brown	nldaputils.o			\
421fcced4cSJordan Brown	server.o			\
431fcced4cSJordan Brown	wksids.o
441fcced4cSJordan Brown
45*b3700b07SGordon RossGENOBJS =				\
46*b3700b07SGordon Ross	adspriv_srv.o			\
47*b3700b07SGordon Ross	rpc_svc.o
48*b3700b07SGordon Ross
49c5c4113dSnwSERVERSRCS =	$(SERVEROBJS:%.o=%.c)
50*b3700b07SGordon RossGENSRCS = 	$(GENOBJS:%.o=%.c)
51*b3700b07SGordon RossOBJS =		$(SERVEROBJS) $(GENOBJS)
52c5c4113dSnwSRCS =		$(SERVERSRCS)
53c5c4113dSnwPOFILES =	$(OBJS:%.o=%.po)
54c5c4113dSnw
55c5c4113dSnwall :=		TARGET = all
56c5c4113dSnwinstall :=	TARGET = install
57c5c4113dSnwclean :=	TARGET = clean
58c5c4113dSnwclobber :=	TARGET = clobber
59c5c4113dSnw
60c5c4113dSnwinclude ../../Makefile.cmd
61c5c4113dSnw
627014882cSRichard LoweCERRWARN +=	-_gcc=-Wno-type-limits
637014882cSRichard LoweCERRWARN +=	-_gcc=-Wno-switch
647014882cSRichard LoweCERRWARN +=	-_gcc=-Wno-uninitialized
657014882cSRichard Lowe
661fcced4cSJordan BrownTEXT_DOMAIN =	SUNW_OST_OSLIB
671fcced4cSJordan BrownXGETTEXT =	$(GNUXGETTEXT)
681fcced4cSJordan BrownXGETFLAGS =	--foreign-user --strict -n -E --width=72 \
691fcced4cSJordan Brown		--omit-header --keyword=directoryError:2 \
701fcced4cSJordan Brown		--language=C --force-po
711fcced4cSJordan Brown
721fcced4cSJordan BrownC99MODE = $(C99_ENABLE)
73c5c4113dSnwPOFILE =	$(PROG)_all.po
74c5c4113dSnw
751fcced4cSJordan BrownRPC_MSGOUT_OPT = -DRPC_MSGOUT=idmap_rpc_msgout
761fcced4cSJordan Brown
77c5c4113dSnwROOTMANIFESTDIR = $(ROOTSVCSYSTEM)
78c5c4113dSnw$(ROOTMANIFEST) := FILEMODE= 444
79*b3700b07SGordon RossRPCSVC= ../../../uts/common/rpcsvc
80*b3700b07SGordon RossADS_CMN=../../../lib/libads/common
81c5c4113dSnw
82*b3700b07SGordon RossINCS += -I. -I../../../lib/libidmap/common \
83*b3700b07SGordon Ross	 -I../../../lib/libsldap/common \
84148c5f43SAlan Wright	 -I../../../lib/libadutils/common \
85*b3700b07SGordon Ross	 -I $(ADS_CMN) \
86148c5f43SAlan Wright	 -I../../../lib/smbsrv/libsmb/common
87c5c4113dSnw
88*b3700b07SGordon Ross# Should not have to do this, but the Kerberos includes are a mess.
89*b3700b07SGordon RossINCS += -I $(ROOT)/usr/include/kerberosv5
90*b3700b07SGordon Ross
91c5c4113dSnw$(OBJS) := CPPFLAGS += $(INCS) -D_REENTRANT
92c5c4113dSnw$(POFILE) := CPPFLAGS += $(INCS)
93c5c4113dSnw
94*b3700b07SGordon RossLINTFLAGS += -xerroff=E_NAME_DEF_NOT_USED2
95*b3700b07SGordon RossLINTFLAGS += -xerroff=E_NAME_USED_NOT_DEF2
96*b3700b07SGordon Ross
977014882cSRichard LoweCFLAGS += $(CCVERBOSE)
9891d7f85eSGordon RossLDLIBS += \
9991d7f85eSGordon Ross	-lsqlite-sys \
10091d7f85eSGordon Ross	-lsecdb \
1011fcced4cSJordan Brown	-lsocket \
1021fcced4cSJordan Brown	-lnsl \
1031fcced4cSJordan Brown	-lidmap \
1041fcced4cSJordan Brown	-lscf \
1051fcced4cSJordan Brown	-lsldap \
1061fcced4cSJordan Brown	-lldap \
1071fcced4cSJordan Brown	-luuid \
1081fcced4cSJordan Brown	-ladutils \
109*b3700b07SGordon Ross	-lads \
110148c5f43SAlan Wright	-lumem \
111148c5f43SAlan Wright	-lnvpair \
112cb174861Sjoyce mcintosh	-luutil \
113148c5f43SAlan Wright	-L $(ROOT)/usr/lib/smbsrv \
114148c5f43SAlan Wright	-lsmb
1151fcced4cSJordan Brown
1161fcced4cSJordan Brownrpc_svc.o := CFLAGS += $(RPC_MSGOUT_OPT)
117c5c4113dSnw
118c5c4113dSnw$(PROG) := MAPFILES = $(MAPFILE.INT) $(MAPFILE.NGB)
119148c5f43SAlan Wright$(PROG) := LDFLAGS += $(MAPFILES:%=-M%) \
120148c5f43SAlan Wright	-R /usr/lib/smbsrv
121c5c4113dSnw
122c5c4113dSnwDIRMODE = 0755
123c5c4113dSnwFILEMODE = 0555
124c5c4113dSnw
1251fcced4cSJordan Brownlint_SRCS := CPPFLAGS += $(INCS) -D_REENTRANT $(RPC_MSGOUT_OPT)
126c5c4113dSnw
127c5c4113dSnw.KEEP_STATE:
128c5c4113dSnw
129c5c4113dSnw.PARALLEL: $(OBJS)
130c5c4113dSnw
131c5c4113dSnwall: $(PROG)
132c5c4113dSnw
1339b214d32SJordan Brown$(PROG): $(OBJS) $$(MAPFILES)
13491d7f85eSGordon Ross	$(LINK.c) -o $@ $(OBJS) $(LDLIBS)
135c5c4113dSnw	$(POST_PROCESS)
136c5c4113dSnw
137c5c4113dSnw$(POFILE): $(POFILES)
138c5c4113dSnw	$(RM) $(POFILE)
139c5c4113dSnw	cat $(POFILES) > $(POFILE)
140c5c4113dSnw
141c5c4113dSnwinstall: all $(ROOTLIBPROG) $(ROOTMANIFEST)
142c5c4113dSnw
143c5c4113dSnwcheck: $(CHKMANIFEST)
144c5c4113dSnw
145c5c4113dSnwclean:
146*b3700b07SGordon Ross	$(RM) $(OBJS) $(GENSRCS)
147c5c4113dSnw
148c5c4113dSnwlint:   lint_SRCS
149c5c4113dSnw
150c5c4113dSnwlint_SRCS:
151c5c4113dSnw
152*b3700b07SGordon RossRPCGENFLAGS = -CMN
153c5c4113dSnw
154*b3700b07SGordon Rossadspriv_srv.o : adspriv_srv.c
155c5c4113dSnw
156*b3700b07SGordon Rossadspriv_srv.c:
157*b3700b07SGordon Ross	$(RPCGEN) $(RPCGENFLAGS) -m $(ADS_CMN)/ads_priv.x > $@
158*b3700b07SGordon Ross
159*b3700b07SGordon Rossrpc_svc.o : rpc_svc.c
160*b3700b07SGordon Ross
161*b3700b07SGordon Rossrpc_svc.c : $(RPCSVC)/idmap_prot.x
162*b3700b07SGordon Ross	$(RPCGEN) $(RPCGENFLAGS) -m $(RPCSVC)/idmap_prot.x > $@
163*b3700b07SGordon Ross
164*b3700b07SGordon Rossinclude ../../Makefile.targ
165