xref: /titanic_41/usr/src/cmd/krb5/slave/Makefile (revision 6d24d8e5e4f6a2d14992d9392981d8a16d695aec)
1#
2# Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
3# Use is subject to license terms.
4#
5
6PROG1=kprop
7PROG2=kpropd
8PROG3=kprop_script
9PROG=$(PROG1) $(PROG2) $(PROG3)
10MANIFEST=	krb5_prop.xml
11
12OBJS	= \
13	kprop.o\
14	utils.o\
15	kpropd.o \
16	kpropd_rpc.o \
17	iprop_xdr.o
18
19COMMONOBJS= utils.o
20COMMONSRCS= utils.c
21CLIENTOBJS= kprop.o
22CLIENTSRCS= kprop.c
23SERVEROBJS= kpropd.o kpropd_rpc.o
24SERVERSRCS= kpropd.c kpropd_rpc.c
25DERIVED_OBJS= iprop_xdr.o
26DERIVED_SRCS= iprop_xdr.c
27SRCS	= $(OBJS:.o=.c)
28
29# Definitions needed to rpcgen iprop-related files
30ISRC= iprop.h iprop_xdr.c
31KRB5IPROPDIR= $(SRC)/cmd/krb5/iprop
32CMD= grep -v "usr/src/cmd/krb5/iprop" > $@
33
34DEFS =  -DHAVE_LIBSOCKET=1 -DHAVE_LIBNSL=1 \
35	-DHAVE_COMPILE=1 \
36	-DHAVE_STEP=1
37
38CLOBBERFILES += $(RSRC)
39
40include ../../Makefile.cmd
41include $(SRC)/lib/gss_mechs/mech_krb5/Makefile.mech_krb5
42
43ROOTMANIFESTDIR=	$(ROOTSVCNETWORKSECURITY)
44
45TEXT_DOMAIN = SUNW_OST_OSCMD
46POFILE = kprop.po
47POFILES = generic.po
48
49CFLAGS += $(XESS) $(CCOPTS) $(DEFS) $(LOCALINCLUDE)
50CPPFLAGS +=	-I. \
51		-I$(KRB5IPROPDIR) \
52		-I$(SRC)/lib/gss_mechs/mech_krb5/include \
53		-I$(SRC)/lib/gss_mechs/mech_krb5/include/krb5\
54		-I$(SRC)/lib/krb5 \
55		-I$(SRC)/lib/krb5/kadm5 \
56		-I$(SRC)/uts/common/gssapi/mechs/krb5/include
57
58CERRWARN +=	-_gcc=-Wno-unused-variable
59CERRWARN +=	-_gcc=-Wno-unused-function
60CERRWARN +=	-_gcc=-Wno-implicit-function-declaration
61CERRWARN +=	-_gcc=-Wno-parentheses
62CERRWARN +=	-_gcc=-Wno-uninitialized
63CERRWARN +=	-_gcc=-Wno-unused-value
64CERRWARN +=	-_gcc=-Wno-address
65
66LDFLAGS +=	$(KRUNPATH) $(KERBRUNPATH)
67LDLIBS +=	-lmech_krb5 -lsocket
68$(PROG1) :=	LDLIBS += -L$(KRB5LIB) -lkadm5srv
69$(PROG2) :=	LDLIBS += -L$(KRB5LIB) -lnsl -lkdb -lkadm5clnt
70
71.KEEP_STATE:
72
73all: $(PROG)
74
75$(PROG1): $(CLIENTOBJS) $(COMMONOBJS)
76	$(LINK.c) $(CLIENTOBJS) $(COMMONOBJS) -o $@ $(DEPLIBS) $(LDFLAGS) $(LDARGS) $(LDLIBS)
77	$(POST_PROCESS)
78
79$(PROG2): $(SERVEROBJS) $(DERIVED_OBJS) $(COMMONOBJS) $(DEPLIBS)
80	$(LINK.c) $(SERVEROBJS) $(DERIVED_OBJS) $(COMMONOBJS) -o $@ $(DEPLIBS) $(LDFLAGS) $(LDARGS) $(LDLIBS)
81	$(POST_PROCESS)
82
83# Rules to rpcgen-erate derived files from the iprop.x spec file
84iprop.h:	$(KRB5IPROPDIR)/iprop.x
85	$(RM) $@
86	$(RPCGEN) -h $(KRB5IPROPDIR)/iprop.x > $@
87
88iprop_xdr.c:	iprop.h $(KRB5IPROPDIR)/iprop.x
89	$(RM) $@
90	$(RPCGEN) -c $(KRB5IPROPDIR)/iprop.x | $(CMD)
91
92# Make dependencies explicit so make sees it.
93$(KRB5LIB)/$(PROG3): $(PROG3)
94$(OBJS): iprop.h
95
96install: $(KRB5LIBPROG) $(ROOTSVCMETHOD) $(ROOTMANIFEST)
97
98check:	$(CHKMANIFEST)
99
100install_h:
101clean:
102	$(RM) $(CLIENTOBJS) $(SERVEROBJS) $(DERIVED_OBJS) $(COMMONOBJS) $(PROG) $(ISRC)
103
104lint:
105	$(LINT.c) $(CLIENTSRCS) $(COMMONSRCS) $(LDLIBS)
106	$(LINT.c) $(SERVERSRCS) $(DERIVED_SRCS) $(COMMONSRCS) $(LDLIBS)
107
108include ../../Makefile.targ
109
110$(POFILE): $(DERIVED_FILES) .WAIT $(POFILES)
111	$(RM) $@
112	$(CAT) $(POFILES) > $@
113
114generic.po: FRC
115	$(RM) messages.po
116	$(XGETTEXT) $(XGETFLAGS) `$(GREP) -l gettext *.[ch]`
117	$(SED) "/^domain/d" messages.po > $@
118	$(RM) messages.po
119
120FRC:
121