xref: /illumos-gate/usr/src/cmd/idmap/idmapd/Makefile (revision 8226594fdd4479be135127f43632f1f995074654)
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 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)
101LDLIBS += \
102	-lsqlite-sys \
103	-lsecdb \
104	-lsocket \
105	-lnsl \
106	-lidmap \
107	-lscf \
108	-lsldap \
109	-lldap \
110	-luuid \
111	-ladutils \
112	-lads \
113	-lumem \
114	-lnvpair \
115	-luutil \
116	-L $(ROOT)/usr/lib/smbsrv \
117	-lsmb
118
119rpc_svc.o := CFLAGS += $(RPC_MSGOUT_OPT)
120
121$(PROG) := MAPFILES = $(MAPFILE.INT) $(MAPFILE.NGB)
122$(PROG) := LDFLAGS += $(MAPFILES:%=-Wl,-M%) \
123	-R /usr/lib/smbsrv
124
125DIRMODE = 0755
126FILEMODE = 0555
127
128.KEEP_STATE:
129
130.PARALLEL: $(OBJS)
131
132all: $(PROG)
133
134$(PROG): $(OBJS) $$(MAPFILES)
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