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