nfs-utils: clean up handling of libgssglue in gssd Makefile
[nfs-utils.git] / utils / gssd / Makefile.am
1 ## Process this file with automake to produce Makefile.in
2
3 man8_MANS       = gssd.man svcgssd.man
4
5 RPCPREFIX       = rpc.
6 KPREFIX         = @kprefix@
7 sbin_PREFIXED   = gssd svcgssd
8 sbin_PROGRAMS   = $(sbin_PREFIXED) gss_clnt_send_err
9 sbin_SCRIPTS    = gss_destroy_creds
10
11 EXTRA_DIST = \
12         gss_destroy_creds \
13         $(man8_MANS)
14
15 COMMON_SRCS = \
16         context.c \
17         context_mit.c \
18         context_heimdal.c \
19         context_lucid.c \
20         context_spkm3.c \
21         gss_util.c \
22         gss_oids.c \
23         err_util.c \
24         \
25         context.h \
26         err_util.h \
27         gss_oids.h \
28         gss_util.h
29
30 gssd_SOURCES = \
31         $(COMMON_SRCS) \
32         gssd.c \
33         gssd_main_loop.c \
34         gssd_proc.c \
35         krb5_util.c \
36         \
37         gssd.h \
38         krb5_util.h \
39         write_bytes.h
40
41 gssd_LDADD =    ../../support/nfs/libnfs.a \
42                 $(RPCSECGSS_LIBS) $(GSSGLUE_LIBS) $(KRBLIBS)
43 gssd_LDFLAGS = $(KRBLDFLAGS)
44
45 gssd_CFLAGS = $(AM_CFLAGS) $(CFLAGS) \
46               $(RPCSECGSS_CFLAGS) $(GSSGLUE_CFLAGS) $(KRBCFLAGS)
47
48 svcgssd_SOURCES = \
49         $(COMMON_SRCS) \
50         svcgssd.c \
51         svcgssd_main_loop.c \
52         svcgssd_mech2file.c \
53         svcgssd_proc.c \
54         \
55         svcgssd.h
56
57 svcgssd_LDADD = \
58         ../../support/nfs/libnfs.a \
59         $(RPCSECGSS_LIBS) $(GSSGLUE_LIBS) -lnfsidmap \
60         $(KRBLIBS)
61
62 svcgssd_LDFLAGS = $(KRBLDFLAGS)
63
64 svcgssd_CFLAGS = $(AM_CFLAGS) $(CFLAGS) \
65                  $(RPCSECGSS_CFLAGS) $(GSSGLUE_CFLAGS) $(KRBCFLAGS)
66
67 gss_clnt_send_err_SOURCES = gss_clnt_send_err.c
68
69 gss_clnt_send_err_CFLAGS = $(AM_CFLAGS) $(CFLAGS) \
70                  $(RPCSECGSS_CFLAGS) $(GSSGLUE_CFLAGS) $(KRBCFLAGS)
71
72 MAINTAINERCLEANFILES = Makefile.in
73
74 #######################################################################
75 # The following allows the current practice of having
76 # daemons renamed during the install to include RPCPREFIX
77 # and the KPREFIX
78 # This could all be done much easier with program_transform_name
79 # ( program_transform_name = s/^/$(RPCPREFIX)$(KPREFIX)/ )
80 # but that also renames the man pages, which the current
81 # practice does not do.
82 install-exec-hook:
83         (cd $(DESTDIR)$(sbindir) && \
84           for p in $(sbin_PREFIXED); do \
85             mv -f $$p$(EXEEXT) $(RPCPREFIX)$(KPREFIX)$$p$(EXEEXT) ;\
86           done)
87 uninstall-hook:
88         (cd $(DESTDIR)$(sbindir) && \
89           for p in $(sbin_PREFIXED); do \
90             rm -f $(RPCPREFIX)$(KPREFIX)$$p$(EXEEXT) ;\
91           done)
92
93
94 # XXX This makes some assumptions about what automake does.
95 # XXX But there is no install-man-hook or install-man-local.
96 install-man: install-man8 install-man-links
97 uninstall-man: uninstall-man8 uninstall-man-links
98
99 install-man-links:
100         (cd $(DESTDIR)$(man8dir) && \
101           for m in $(man8_MANS) $(dist_man8_MANS) $(nodist_man8_MANS); do \
102             inst=`echo $$m | sed -e 's/man$$/8/'`; \
103             rm -f $(RPCPREFIX)$$inst ; \
104             $(LN_S) $$inst $(RPCPREFIX)$$inst ; \
105           done)
106
107 uninstall-man-links:
108         (cd $(DESTDIR)$(man8dir) && \
109           for m in $(man8_MANS) $(dist_man8_MANS) $(nodist_man8_MANS); do \
110             inst=`echo $$m | sed -e 's/man$$/8/'`; \
111             rm -f $(RPCPREFIX)$$inst ; \
112           done)
113