xref: /illumos-gate/usr/src/cmd/krb5/kproplog/Makefile (revision 30165b7f6753bc3d48c52319bed7ec7b3ea36b3c)
1#
2# Copyright 2004 Sun Microsystems, Inc.  All rights reserved.
3# Use is subject to license terms.
4#
5# Copyright (c) 2018, Joyent, Inc.
6
7PROG		=	kproplog
8
9OBJS		=	kproplog.o
10DERIVED_OBJS	=	iprop_xdr.o
11
12SRCS=	$(OBJS:.o=.c)
13SRCS+=	$(DERIVED_OBJS:.o=.c)
14
15RSRC=	kproplog.c
16
17# Definitions needed to rpcgen iprop-related files
18ISRC= iprop.h iprop_xdr.c
19KRB5IPROPDIR= $(SRC)/cmd/krb5/iprop
20CMD= grep -v "usr/src/cmd/krb5/iprop" > $@
21
22include	../../Makefile.cmd
23include $(SRC)/lib/gss_mechs/mech_krb5/Makefile.mech_krb5
24
25TEXT_DOMAIN = SUNW_OST_OSCMD
26POFILE	= kproplog.po
27POFILES	= generic.po
28
29LDFLAGS		+=	-R$(KRB5RUNPATH) $(KRUNPATH)
30LDLIBS		+=	-L$(KRB5LIB) $(KLIB) -lnsl -lkdb -lkadm5clnt
31
32CPPFLAGS	+=	-I. -I$(SRC)/lib/krb5 \
33			-I$(KRB5IPROPDIR) \
34			-I$(SRC)/lib/gss_mechs/mech_krb5/include \
35			-I$(SRC)/uts/common/gssapi/mechs/krb5/include
36
37CERRWARN	+=	-_gcc=-Wno-unused-variable
38CERRWARN	+=	-_gcc=-Wno-unused-function
39CERRWARN	+=	-_gcc=-Wno-implicit-function-declaration
40
41# not linted
42SMATCH=off
43
44all:		$(PROG)
45
46$(PROG):	$(OBJS) $(DERIVED_OBJS)
47	$(LINK.c) $(OBJS) $(DERIVED_OBJS) -o $@ $(LDLIBS)
48	$(POST_PROCESS)
49
50# Rules to rpcgen-erate derived files from the iprop.x spec file
51iprop.h:	$(KRB5IPROPDIR)/iprop.x
52	$(RM) $@
53	$(RPCGEN) -h $(KRB5IPROPDIR)/iprop.x > $@
54
55iprop_xdr.c:	iprop.h $(KRB5IPROPDIR)/iprop.x
56	$(RM) $@
57	$(RPCGEN) -c $(KRB5IPROPDIR)/iprop.x | $(CMD)
58
59# Explicitly state the dependancy on iprop.h
60$(OBJS): iprop.h
61
62install:	$(KRB5SBINPROG)
63
64lint:	$(ISRC) .WAIT lint_SRCS
65
66clean:
67	$(RM) $(OBJS) $(DERIVED_OBJS) $(ISRC)
68
69include ../../Makefile.targ
70
71$(POFILE): $(DERIVED_FILES) .WAIT $(POFILES)
72	$(RM) $@
73	$(CAT) $(POFILES) > $@
74
75generic.po:
76	$(RM) messages.po
77	$(XGETTEXT) $(XGETFLAGS) `$(GREP) -l gettext *.[ch]`
78	$(SED) "/^domain/d" messages.po > $@
79	$(RM) messages.po
80