Merge illumos-gate
[unleashed.git] / usr / src / cmd / idmap / idmapd / Makefile
blob2615391a82ff6b877ab171ba56b05108040ccfc0
2 # CDDL HEADER START
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.
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.
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]
19 # CDDL HEADER END
22 # Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved.
23 # Copyright 2014 Nexenta Systems, Inc. All rights reserved.
25 # Copyright (c) 2018, Joyent, Inc.
27 PROG = idmapd
28 MANIFEST = idmap.xml
29 SERVEROBJS = \
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
46 GENOBJS = \
47 adspriv_srv.o \
48 rpc_svc.o
50 SERVERSRCS = $(SERVEROBJS:%.o=%.c)
51 GENSRCS = $(GENOBJS:%.o=%.c)
52 OBJS = $(SERVEROBJS) $(GENOBJS)
53 SRCS = $(SERVERSRCS)
54 POFILES = $(OBJS:%.o=%.po)
56 all := TARGET = all
57 install := TARGET = install
58 clean := TARGET = clean
59 clobber := TARGET = clobber
61 include ../../Makefile.cmd
63 CERRWARN += -Wno-type-limits
64 CERRWARN += -Wno-switch
65 CERRWARN += -Wno-uninitialized
67 # not linted
68 SMATCH=off
70 TEXT_DOMAIN = SUNW_OST_OSLIB
72 CSTD = $(CSTD_GNU99)
73 POFILE = $(PROG)_all.po
75 RPC_MSGOUT_OPT = -DRPC_MSGOUT=idmap_rpc_msgout
77 ROOTMANIFESTDIR = $(ROOTSVCSYSTEM)
78 $(ROOTMANIFEST) := FILEMODE= 444
79 RPCSVC= ../../../uts/common/rpcsvc
80 ADS_CMN=../../../lib/libads/common
82 INCS += -I. -I../../../lib/libidmap/common \
83 -I../../../lib/libsldap/common \
84 -I../../../lib/libadutils/common \
85 -I $(ADS_CMN) \
86 -I../../../lib/smbsrv/libsmb/common
88 # Should not have to do this, but the Kerberos includes are a mess.
89 INCS += -I $(ROOT)/usr/include/kerberosv5
91 $(OBJS) := CPPFLAGS += $(INCS)
92 $(POFILE) := CPPFLAGS += $(INCS)
95 LDLIBS += \
96 -lsqlite-sys \
97 -lsecdb \
98 -lidmap \
99 -lscf \
100 -lsldap \
101 -lldap \
102 -luuid \
103 -ladutils \
104 -lads \
105 -lumem \
106 -lnvpair \
107 -luutil \
108 -L $(ROOT)/usr/lib/smbsrv \
109 -lsmb
111 rpc_svc.o := CFLAGS += $(RPC_MSGOUT_OPT)
113 $(PROG) := MAPFILES = $(MAPFILE.INT) $(MAPFILE.NGB)
114 $(PROG) := LDFLAGS += $(MAPFILES:%=-Wl,-M%) \
115 -R/usr/lib/smbsrv
117 DIRMODE = 0755
118 FILEMODE = 0555
120 .KEEP_STATE:
122 .PARALLEL: $(OBJS)
124 all: $(PROG)
126 $(PROG): $(OBJS) $$(MAPFILES)
127 $(LINK.c) -o $@ $(OBJS) $(LDLIBS)
128 $(POST_PROCESS)
130 $(POFILE): $(POFILES)
131 $(RM) $(POFILE)
132 cat $(POFILES) > $(POFILE)
134 install: all $(ROOTLIBPROG) $(ROOTMANIFEST)
136 check: $(CHKMANIFEST)
138 clean:
139 $(RM) $(OBJS) $(GENSRCS)
141 RPCGENFLAGS = -CMN
143 adspriv_srv.o : adspriv_srv.c
145 adspriv_srv.c:
146 $(RPCGEN) $(RPCGENFLAGS) -m $(ADS_CMN)/ads_priv.x > $@
148 rpc_svc.o : rpc_svc.c
150 rpc_svc.c : $(RPCSVC)/idmap_prot.x
151 $(RPCGEN) $(RPCGENFLAGS) -m $(RPCSVC)/idmap_prot.x > $@
153 include ../../Makefile.targ