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