17c478bd9Sstevel@tonic-gate#
2ba7b222eSGlenn Barry# Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
37c478bd9Sstevel@tonic-gate# Use is subject to license terms.
47c478bd9Sstevel@tonic-gate#
5*5661bb76SJohn Levon# Copyright (c) 2018, Joyent, Inc.
67c478bd9Sstevel@tonic-gate
77c478bd9Sstevel@tonic-gatePROG= kadmind
87c478bd9Sstevel@tonic-gateMANIFEST=	kadmin.xml
97c478bd9Sstevel@tonic-gate
107c478bd9Sstevel@tonic-gateOBJS	= kadm_rpc_svc.o server_stubs.o ovsec_kadmd.o misc.o server_glue_v1.o \
117c478bd9Sstevel@tonic-gate          ipropd_svc.o
127c478bd9Sstevel@tonic-gate
137c478bd9Sstevel@tonic-gateDERIVED_OBJS= iprop_xdr.o
147c478bd9Sstevel@tonic-gate
157c478bd9Sstevel@tonic-gateSRCS=	$(OBJS:.o=.c)
167c478bd9Sstevel@tonic-gateSRCS+=	$(DERIVED_OBJS:.o=.c)
177c478bd9Sstevel@tonic-gate
187c478bd9Sstevel@tonic-gate# Definitions needed to rpcgen iprop-related files
197c478bd9Sstevel@tonic-gateISRC= iprop.h iprop_xdr.c
207c478bd9Sstevel@tonic-gateKRB5IPROPDIR= $(SRC)/cmd/krb5/iprop
217c478bd9Sstevel@tonic-gateCMD= grep -v "usr/src/cmd/krb5/iprop" > $@
227c478bd9Sstevel@tonic-gate
237c478bd9Sstevel@tonic-gateCLOBBERFILES += $(TESTPROG)
247c478bd9Sstevel@tonic-gate
257c478bd9Sstevel@tonic-gateinclude ../../../Makefile.cmd
267c478bd9Sstevel@tonic-gateinclude $(SRC)/lib/gss_mechs/mech_krb5/Makefile.mech_krb5
277c478bd9Sstevel@tonic-gate
287c478bd9Sstevel@tonic-gatePOFILE = $(PROG).po
297c478bd9Sstevel@tonic-gatePOFILES = generic.po
307c478bd9Sstevel@tonic-gate
317c478bd9Sstevel@tonic-gateROOTMANIFESTDIR=	$(ROOTSVCNETWORKSECURITY)
327c478bd9Sstevel@tonic-gate
337c478bd9Sstevel@tonic-gateDEFS = -DHAVE_LIBSOCKET=1 -DHAVE_LIBNSL=1 -DHAVE_COMPILE=1 -DHAVE_STEP=1  -DKRB5_KRB4_COMPAT
347c478bd9Sstevel@tonic-gate
357c478bd9Sstevel@tonic-gateCPPFLAGS += -I. -I$(SRC)/uts/common/gssapi/mechs/krb5/include \
36ba7b222eSGlenn Barry		-I$(SRC)/uts/common/gssapi \
377c478bd9Sstevel@tonic-gate		-I$(SRC)/lib/krb5 \
387c478bd9Sstevel@tonic-gate		-I$(SRC)/lib/krb5/kadm5 \
397c478bd9Sstevel@tonic-gate		-I$(SRC)/lib/krb5/kadm5/srv \
407c478bd9Sstevel@tonic-gate		-I$(SRC)/lib/gss_mechs/mech_krb5/include \
417c478bd9Sstevel@tonic-gate		-I$(KRB5IPROPDIR) \
427c478bd9Sstevel@tonic-gate		-I$(SRC)/uts/common/gssapi/include/ $(DEFS)
437c478bd9Sstevel@tonic-gate
447014882cSRichard LoweCERRWARN += -_gcc=-Wno-implicit-function-declaration
457014882cSRichard LoweCERRWARN += -_gcc=-Wno-unused-variable
467014882cSRichard LoweCERRWARN += -_gcc=-Wno-parentheses
477014882cSRichard LoweCERRWARN += -_gcc=-Wno-unused-function
487014882cSRichard Lowe
49*5661bb76SJohn Levon# not linted
50*5661bb76SJohn LevonSMATCH=off
51*5661bb76SJohn Levon
5267e3a03eSrieLDFLAGS += $(KRUNPATH) $(KERBRUNPATH)
537c478bd9Sstevel@tonic-gateLDLIBS += -lgss -L$(KRB5LIB) \
547c478bd9Sstevel@tonic-gate	-lmech_krb5 -lkadm5srv -lkdb -lnsl -lresolv -lbsm -lpam -lsocket
557c478bd9Sstevel@tonic-gate
567c478bd9Sstevel@tonic-gate.KEEP_STATE:
577c478bd9Sstevel@tonic-gate
587c478bd9Sstevel@tonic-gateall: $(PROG)
597c478bd9Sstevel@tonic-gate
607c478bd9Sstevel@tonic-gate$(PROG):	$(OBJS) $(DERIVED_OBJS)
617c478bd9Sstevel@tonic-gate	$(LINK.c) $(OBJS) $(DERIVED_OBJS) -o $@ $(LDLIBS)
627c478bd9Sstevel@tonic-gate	$(POST_PROCESS)
637c478bd9Sstevel@tonic-gate
647c478bd9Sstevel@tonic-gate# Rules to rpcgen-erate derived files from the iprop.x spec file
657c478bd9Sstevel@tonic-gateiprop.h:	$(KRB5IPROPDIR)/iprop.x
667c478bd9Sstevel@tonic-gate	$(RM) $@
677c478bd9Sstevel@tonic-gate	$(RPCGEN) -h $(KRB5IPROPDIR)/iprop.x > $@
687c478bd9Sstevel@tonic-gate
697c478bd9Sstevel@tonic-gateiprop_xdr.c:	iprop.h $(KRB5IPROPDIR)/iprop.x
707c478bd9Sstevel@tonic-gate	$(RM) $@
717c478bd9Sstevel@tonic-gate	$(RPCGEN) -c $(KRB5IPROPDIR)/iprop.x | $(CMD)
727c478bd9Sstevel@tonic-gate
737c478bd9Sstevel@tonic-gate# Explicitly state the dependancy on iprop.h
747c478bd9Sstevel@tonic-gate$(OBJS): iprop.h
757c478bd9Sstevel@tonic-gate
767c478bd9Sstevel@tonic-gate$(KRB5LIBPROG):=	FILEMODE = 0500
777c478bd9Sstevel@tonic-gate
78a192e900Samaguireinstall: $(KRB5LIBPROG) $(ROOTSVCMETHOD) $(ROOTMANIFEST)
797c478bd9Sstevel@tonic-gate
807c478bd9Sstevel@tonic-gatecheck:	$(CHKMANIFEST)
817c478bd9Sstevel@tonic-gate
827c478bd9Sstevel@tonic-gateclean:
837c478bd9Sstevel@tonic-gate	$(RM) $(OBJS) $(DERIVED_OBJS) $(ISRC)
847c478bd9Sstevel@tonic-gate
857c478bd9Sstevel@tonic-gateinclude ../../../Makefile.targ
867c478bd9Sstevel@tonic-gate
877c478bd9Sstevel@tonic-gate$(POFILE): $(DERIVED_FILES) .WAIT $(POFILES)
887c478bd9Sstevel@tonic-gate	$(RM) $@
897c478bd9Sstevel@tonic-gate	$(CAT) $(POFILES) > $@
907c478bd9Sstevel@tonic-gate
917c478bd9Sstevel@tonic-gategeneric.po: FRC
927c478bd9Sstevel@tonic-gate	$(RM) messages.po
937c478bd9Sstevel@tonic-gate	$(XGETTEXT) $(XGETFLAGS) `$(GREP) -l gettext *.[ch]`
947c478bd9Sstevel@tonic-gate	$(SED) "/^domain/d" messages.po > $@
957c478bd9Sstevel@tonic-gate	$(RM) messages.po
967c478bd9Sstevel@tonic-gate
977c478bd9Sstevel@tonic-gateFRC:
98