view usr/src/cmd/idmap/idmapd/Makefile @ 20610:7616bf36dcb7

Merge illumos-gate
author Josef 'Jeff' Sipek <jeffpc@josefsipek.net>
date Sun, 19 May 2019 22:05:19 -0400
parents 494cd9276cfb d2c2cc412666
children
line wrap: on
line source

#
# CDDL HEADER START
#
# The contents of this file are subject to the terms of the
# Common Development and Distribution License (the "License").
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
# or http://www.opensolaris.org/os/licensing.
# See the License for the specific language governing permissions
# and limitations under the License.
#
# When distributing Covered Code, include this CDDL HEADER in each
# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
# If applicable, add the following below this CDDL HEADER, with the
# fields enclosed by brackets "[]" replaced with your own identifying
# information: Portions Copyright [yyyy] [name of copyright owner]
#
# CDDL HEADER END
#
#
# Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved.
# Copyright 2014 Nexenta Systems, Inc.  All rights reserved.
#
# Copyright (c) 2018, Joyent, Inc.

PROG =		idmapd
MANIFEST =	idmap.xml
SERVEROBJS =				\
	adspriv_impl.o			\
	directory_provider_builtin.o	\
	directory_provider_nsswitch.o	\
	directory_provider_ad.o		\
	directory_server.o		\
	adutils.o			\
	dbutils.o			\
	idmap_config.o			\
	idmapd.o			\
	init.o				\
	idmap_lsa.o			\
	krb5_lookup.o			\
	nldaputils.o			\
	server.o			\
	wksids.o

GENOBJS =				\
	adspriv_srv.o			\
	rpc_svc.o

SERVERSRCS =	$(SERVEROBJS:%.o=%.c)
GENSRCS = 	$(GENOBJS:%.o=%.c)
OBJS =		$(SERVEROBJS) $(GENOBJS)
SRCS =		$(SERVERSRCS)
POFILES =	$(OBJS:%.o=%.po)

all :=		TARGET = all
install :=	TARGET = install
clean :=	TARGET = clean
clobber :=	TARGET = clobber

include ../../Makefile.cmd

CERRWARN +=	-Wno-type-limits
CERRWARN +=	-Wno-switch
CERRWARN +=	-Wno-uninitialized

# not linted
SMATCH=off

TEXT_DOMAIN =	SUNW_OST_OSLIB

CSTD = $(CSTD_GNU99)
POFILE =	$(PROG)_all.po

RPC_MSGOUT_OPT = -DRPC_MSGOUT=idmap_rpc_msgout

ROOTMANIFESTDIR = $(ROOTSVCSYSTEM)
$(ROOTMANIFEST) := FILEMODE= 444
RPCSVC= ../../../uts/common/rpcsvc
ADS_CMN=../../../lib/libads/common

INCS += -I. -I../../../lib/libidmap/common \
	 -I../../../lib/libsldap/common \
	 -I../../../lib/libadutils/common \
	 -I $(ADS_CMN) \
	 -I../../../lib/smbsrv/libsmb/common

# Should not have to do this, but the Kerberos includes are a mess.
INCS += -I $(ROOT)/usr/include/kerberosv5

$(OBJS) := CPPFLAGS += $(INCS)
$(POFILE) := CPPFLAGS += $(INCS)


LDLIBS += \
	-lsqlite-sys \
	-lsecdb \
	-lidmap \
	-lscf \
	-lsldap \
	-lldap \
	-luuid \
	-ladutils \
	-lads \
	-lumem \
	-lnvpair \
	-luutil \
	-L $(ROOT)/usr/lib/smbsrv \
	-lsmb

rpc_svc.o := CFLAGS += $(RPC_MSGOUT_OPT)

$(PROG) := MAPFILES = $(MAPFILE.INT) $(MAPFILE.NGB)
$(PROG) := LDFLAGS += $(MAPFILES:%=-Wl,-M%) \
	-R/usr/lib/smbsrv

DIRMODE = 0755
FILEMODE = 0555

.KEEP_STATE:

.PARALLEL: $(OBJS)

all: $(PROG)

$(PROG): $(OBJS) $$(MAPFILES)
	$(LINK.c) -o $@ $(OBJS) $(LDLIBS)
	$(POST_PROCESS)

$(POFILE): $(POFILES)
	$(RM) $(POFILE)
	cat $(POFILES) > $(POFILE)

install: all $(ROOTLIBPROG) $(ROOTMANIFEST)

check: $(CHKMANIFEST)

clean:
	$(RM) $(OBJS) $(GENSRCS)

RPCGENFLAGS = -CMN

adspriv_srv.o : adspriv_srv.c

adspriv_srv.c: 
	$(RPCGEN) $(RPCGENFLAGS) -m $(ADS_CMN)/ads_priv.x > $@

rpc_svc.o : rpc_svc.c

rpc_svc.c : $(RPCSVC)/idmap_prot.x
	$(RPCGEN) $(RPCGENFLAGS) -m $(RPCSVC)/idmap_prot.x > $@

include ../../Makefile.targ