xref: /titanic_44/usr/src/cmd/krb5/slave/Makefile (revision 40e5e17b3361b3eea56a9723071c406894a20b78)
1#
2# Copyright 2006 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
13SVCMETHOD=	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
48TEXT_DOMAIN = SUNW_OST_OSCMD
49POFILE = kprop.po
50POFILES = generic.po
51
52CFLAGS += $(XESS) $(CCOPTS) $(DEFS) $(LOCALINCLUDE)
53CPPFLAGS +=	-I. \
54		-I$(KRB5IPROPDIR) \
55		-I$(SRC)/lib/gss_mechs/mech_krb5/include \
56		-I$(SRC)/lib/gss_mechs/mech_krb5/include/krb5\
57		-I$(SRC)/lib/krb5 \
58		-I$(SRC)/lib/krb5/kadm5 \
59		-I$(SRC)/uts/common/gssapi/mechs/krb5/include
60
61LDFLAGS +=	$(KRUNPATH)
62LDLIBS +=	-lmech_krb5 -lsocket
63$(PROG1) :=	LDLIBS += -L$(KRB5LIB) -lkadm5srv
64$(PROG2) :=	LDLIBS += -L$(KRB5LIB) -lnsl -lkdb -lkadm5clnt
65
66.KEEP_STATE:
67
68all: $(PROG)
69
70$(PROG1): $(CLIENTOBJS) $(COMMONOBJS)
71	$(LINK.c) $(CLIENTOBJS) $(COMMONOBJS) -o $@ $(DEPLIBS) $(LDFLAGS) $(LDARGS) $(LDLIBS)
72	$(POST_PROCESS)
73
74$(PROG2): $(SERVEROBJS) $(DERIVED_OBJS) $(COMMONOBJS) $(DEPLIBS)
75	$(LINK.c) $(SERVEROBJS) $(DERIVED_OBJS) $(COMMONOBJS) -o $@ $(DEPLIBS) $(LDFLAGS) $(LDARGS) $(LDLIBS)
76	$(POST_PROCESS)
77
78# Rules to rpcgen-erate derived files from the iprop.x spec file
79iprop.h:	$(KRB5IPROPDIR)/iprop.x
80	$(RM) $@
81	$(RPCGEN) -h $(KRB5IPROPDIR)/iprop.x > $@
82
83iprop_xdr.c:	iprop.h $(KRB5IPROPDIR)/iprop.x
84	$(RM) $@
85	$(RPCGEN) -c $(KRB5IPROPDIR)/iprop.x | $(CMD)
86
87# Make dependencies explicit so make sees it.
88$(KRB5LIB)/$(PROG3): $(PROG3)
89$(OBJS): iprop.h
90
91install: $(KRB5LIBPROG) $(ROOTSVCMETHOD) $(ROOTMANIFEST)
92
93check:	$(CHKMANIFEST)
94
95install_h:
96clean:
97	$(RM) $(CLIENTOBJS) $(SERVEROBJS) $(DERIVED_OBJS) $(COMMONOBJS) $(PROG) $(ISRC)
98
99lint:
100	$(LINT.c) $(CLIENTSRCS) $(COMMONSRCS) $(LDLIBS)
101	$(LINT.c) $(SERVERSRCS) $(DERIVED_SRCS) $(COMMONSRCS) $(LDLIBS)
102
103include ../../Makefile.targ
104
105$(POFILE): $(DERIVED_FILES) .WAIT $(POFILES)
106	$(RM) $@
107	$(CAT) $(POFILES) > $@
108
109generic.po: FRC
110	$(RM) messages.po
111	$(XGETTEXT) $(XGETFLAGS) `$(GREP) -l gettext *.[ch]`
112	$(SED) "/^domain/d" messages.po > $@
113	$(RM) messages.po
114
115FRC:
116