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