fcb583c5924096a45eb425714c605b0ab95974d6
[openafs.git] / src / cf / Makefile.am.common
1 # $Id$
2
3 AUTOMAKE_OPTIONS = foreign no-dependencies
4
5 SUFFIXES = .et .h
6
7 INCLUDES = -I$(top_builddir)/include $(INCLUDES_roken)
8
9 AM_CFLAGS += $(WFLAGS)
10
11 CP      = cp
12
13 COMPILE_ET = $(top_builddir)/lib/com_err/compile_et
14
15 ## set build_HEADERZ to headers that should just be installed in build tree
16
17 buildinclude = $(top_builddir)/include
18
19 ## these aren't detected by automake
20 LIB_XauReadAuth         = @LIB_XauReadAuth@
21 LIB_crypt               = @LIB_crypt@
22 LIB_dbm_firstkey        = @LIB_dbm_firstkey@
23 LIB_dbopen              = @LIB_dbopen@
24 LIB_dlopen              = @LIB_dlopen@
25 LIB_dn_expand           = @LIB_dn_expand@
26 LIB_el_init             = @LIB_el_init@
27 LIB_getattr             = @LIB_getattr@
28 LIB_gethostbyname       = @LIB_gethostbyname@
29 LIB_getpwent_r          = @LIB_getpwent_r@
30 LIB_getpwnam_r          = @LIB_getpwnam_r@
31 LIB_getsockopt          = @LIB_getsockopt@
32 LIB_logout              = @LIB_logout@
33 LIB_logwtmp             = @LIB_logwtmp@
34 LIB_odm_initialize      = @LIB_odm_initialize@
35 LIB_pidfile             = @LIB_pidfile@
36 LIB_readline            = @LIB_readline@
37 LIB_res_search          = @LIB_res_search@
38 LIB_setpcred            = @LIB_setpcred@
39 LIB_setsockopt          = @LIB_setsockopt@
40 LIB_socket              = @LIB_socket@
41 LIB_syslog              = @LIB_syslog@
42 LIB_tgetent             = @LIB_tgetent@
43
44 LIBS                    = @LIBS@
45
46 HESIODLIB = @HESIODLIB@
47 HESIODINCLUDE = @HESIODINCLUDE@
48 INCLUDE_hesiod = @INCLUDE_hesiod@
49 LIB_hesiod = @LIB_hesiod@
50
51 INCLUDE_krb4 = @INCLUDE_krb4@
52 LIB_krb4 = @LIB_krb4@
53
54 INCLUDE_openldap = @INCLUDE_openldap@
55 LIB_openldap = @LIB_openldap@
56
57 INCLUDE_readline = @INCLUDE_readline@
58 LIB_readline = @LIB_readline@
59
60 LEXLIB = @LEXLIB@
61
62 install-suid-programs:
63         @foo='$(bin_SUIDS)'; \
64         for file in $$foo; do \
65         x=$(DESTDIR)$(bindir)/$$file; \
66         if chown 0:0 $$x && chmod u+s $$x; then :; else \
67         echo "*"; \
68         echo "* Failed to install $$x setuid root"; \
69         echo "*"; \
70         fi; done
71
72 install-exec-hook: install-suid-programs
73
74 install-build-headers:: $(include_HEADERS) $(build_HEADERZ)
75         @foo='$(include_HEADERS) $(build_HEADERZ)'; \
76         for f in $$foo; do \
77                 f=`basename $$f`; \
78                 if test -f "$(srcdir)/$$f"; then file="$(srcdir)/$$f"; \
79                 else file="$$f"; fi; \
80                 if cmp -s  $$file $(buildinclude)/$$f 2> /dev/null ; then \
81                 : ; else \
82                         echo " $(CP) $$file $(buildinclude)/$$f"; \
83                         $(CP) $$file $(buildinclude)/$$f; \
84                 fi ; \
85         done
86
87 all-local: install-build-headers
88
89 SUFFIXES += .1 .3 .5 .8 .cat1 .cat3 .cat5 .cat8
90
91 NROFF_MAN = groff -mandoc -Tascii
92 #NROFF_MAN = nroff -man
93 .1.cat1:
94         $(NROFF_MAN) $< > $@
95 .3.cat3:
96         $(NROFF_MAN) $< > $@
97 .5.cat5:
98         $(NROFF_MAN) $< > $@
99 .8.cat8:
100         $(NROFF_MAN) $< > $@
101
102 ## MAINTAINERCLEANFILES += 
103
104 dist-cat1-mans:
105         @foo='$(man1_MANS)'; \
106         bar='$(man_MANS)'; \
107         for i in $$bar; do \
108         case $$i in \
109         *.1) foo="$$foo $$i";; \
110         esac; done ;\
111         for i in $$foo; do \
112                 x=`echo $$i | sed 's/\.[^.]*$$/.cat1/'`; \
113                 echo "$(NROFF_MAN) $(srcdir)/$$i > $(distdir)/$$x"; \
114                 $(NROFF_MAN) $(srcdir)/$$i > $(distdir)/$$x; \
115         done
116
117 dist-cat3-mans:
118         @foo='$(man3_MANS)'; \
119         bar='$(man_MANS)'; \
120         for i in $$bar; do \
121         case $$i in \
122         *.3) foo="$$foo $$i";; \
123         esac; done ;\
124         for i in $$foo; do \
125                 x=`echo $$i | sed 's/\.[^.]*$$/.cat3/'`; \
126                 echo "$(NROFF_MAN) $(srcdir)/$$i > $(distdir)/$$x"; \
127                 $(NROFF_MAN) $(srcdir)/$$i > $(distdir)/$$x; \
128         done
129
130 dist-cat5-mans:
131         @foo='$(man5_MANS)'; \
132         bar='$(man_MANS)'; \
133         for i in $$bar; do \
134         case $$i in \
135         *.5) foo="$$foo $$i";; \
136         esac; done ;\
137         for i in $$foo; do \
138                 x=`echo $$i | sed 's/\.[^.]*$$/.cat5/'`; \
139                 echo "$(NROFF_MAN) $(srcdir)/$$i > $(distdir)/$$x"; \
140                 $(NROFF_MAN) $(srcdir)/$$i > $(distdir)/$$x; \
141         done
142
143 dist-cat8-mans:
144         @foo='$(man8_MANS)'; \
145         bar='$(man_MANS)'; \
146         for i in $$bar; do \
147         case $$i in \
148         *.8) foo="$$foo $$i";; \
149         esac; done ;\
150         for i in $$foo; do \
151                 x=`echo $$i | sed 's/\.[^.]*$$/.cat8/'`; \
152                 echo "$(NROFF_MAN) $(srcdir)/$$i > $(distdir)/$$x"; \
153                 $(NROFF_MAN) $(srcdir)/$$i > $(distdir)/$$x; \
154         done
155
156 dist-hook: dist-cat1-mans dist-cat3-mans dist-cat5-mans dist-cat8-mans
157
158 install-cat-mans:
159         $(SHELL) $(top_srcdir)/cf/install-catman.sh "$(INSTALL_DATA)" "$(mkinstalldirs)" "$(srcdir)" "$(DESTDIR)$(mandir)" '$(CATMANEXT)' $(man_MANS) $(man1_MANS) $(man3_MANS) $(man5_MANS) $(man8_MANS)
160
161 install-data-local: install-cat-mans
162
163
164 .et.h:
165         ${COMPILE_ET} $<
166 .et.c:
167         ${COMPILE_ET} $<
168
169 if KRB4
170 LIB_kafs = $(top_builddir)/lib/kafs/libkafs.la $(AIX_EXTRA_KAFS)
171 endif
172
173 if KRB5
174 LIB_krb5 = $(top_builddir)/lib/krb5/libkrb5.la \
175         $(top_builddir)/lib/asn1/libasn1.la
176 LIB_gssapi = $(top_builddir)/lib/gssapi/libgssapi.la
177 endif
178