Merge pull request #9 from lha/master
[heimdal.git] / cf / Makefile.am.common
blob1470fe0d5c23e0099f2051a9f817d72be7f22729
1 # $Id$
3 SUFFIXES = .et .h
5 DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)/include -I$(top_srcdir)/include
7 AM_CPPFLAGS = $(INCLUDES_roken)
9 if do_roken_rename
10 ROKEN_RENAME = -DROKEN_RENAME
11 endif
13 AM_CFLAGS = $(WFLAGS)
15 CP      = cp
17 ## set build_HEADERZ to headers that should just be installed in build tree
19 buildinclude = $(top_builddir)/include
21 ## these aren't detected by automake
22 LIB_XauReadAuth         = @LIB_XauReadAuth@
23 LIB_crypt               = @LIB_crypt@
24 LIB_dbm_firstkey        = @LIB_dbm_firstkey@
25 LIB_dbopen              = @LIB_dbopen@
26 LIB_dlopen              = @LIB_dlopen@
27 LIB_dn_expand           = @LIB_dn_expand@
28 LIB_el_init             = @LIB_el_init@
29 LIB_getattr             = @LIB_getattr@
30 LIB_gethostbyname       = @LIB_gethostbyname@
31 LIB_getpwent_r          = @LIB_getpwent_r@
32 LIB_getpwnam_r          = @LIB_getpwnam_r@
33 LIB_getsockopt          = @LIB_getsockopt@
34 LIB_logout              = @LIB_logout@
35 LIB_logwtmp             = @LIB_logwtmp@
36 LIB_odm_initialize      = @LIB_odm_initialize@
37 LIB_openpty             = @LIB_openpty@
38 LIB_pidfile             = @LIB_pidfile@
39 LIB_res_search          = @LIB_res_search@
40 LIB_setpcred            = @LIB_setpcred@
41 LIB_setsockopt          = @LIB_setsockopt@
42 LIB_socket              = @LIB_socket@
43 LIB_syslog              = @LIB_syslog@
44 LIB_tgetent             = @LIB_tgetent@
45 LIB_com_err             = @LIB_com_err@
46 LIB_door_create         = @LIB_door_create@
48 HESIODLIB = @HESIODLIB@
49 HESIODINCLUDE = @HESIODINCLUDE@
50 INCLUDE_hesiod = @INCLUDE_hesiod@
51 LIB_hesiod = @LIB_hesiod@
53 INCLUDE_krb4 = @INCLUDE_krb4@
54 LIB_krb4 = @LIB_krb4@
56 INCLUDE_openldap = @INCLUDE_openldap@
57 LIB_openldap = @LIB_openldap@
59 INCLUDE_readline = @INCLUDE_readline@
60 LIB_readline = @LIB_readline@
62 LEXLIB = @LEXLIB@
64 libexec_heimdaldir = $(libexecdir)/heimdal
66 install-suid-programs:
67         @foo='$(bin_SUIDS)'; \
68         for file in $$foo; do \
69         x=$(DESTDIR)$(bindir)/$$file; \
70         if chown 0:0 $$x && chmod u+s $$x; then :; else \
71         echo "*"; \
72         echo "* Failed to install $$x setuid root"; \
73         echo "*"; \
74         fi; done
76 install-exec-hook: install-suid-programs
78 install-build-headers:: $(include_HEADERS) $(dist_include_HEADERS) $(nodist_include_HEADERS) $(build_HEADERZ) $(nobase_include_HEADERS)
79         @foo='$(include_HEADERS) $(dist_include_HEADERS) $(nodist_include_HEADERS) $(build_HEADERZ)'; \
80         for f in $$foo; do \
81                 f=`basename $$f`; \
82                 if test -f "$(srcdir)/$$f"; then file="$(srcdir)/$$f"; \
83                 else file="$$f"; fi; \
84                 if cmp -s  $$file $(buildinclude)/$$f 2> /dev/null ; then \
85                 : ; else \
86                         echo " $(CP) $$file $(buildinclude)/$$f"; \
87                         $(CP) $$file $(buildinclude)/$$f; \
88                 fi ; \
89         done ; \
90         foo='$(nobase_include_HEADERS)'; \
91         for f in $$foo; do \
92                 if test -f "$(srcdir)/$$f"; then file="$(srcdir)/$$f"; \
93                 else file="$$f"; fi; \
94                 $(mkdir_p) $(buildinclude)/`dirname $$f` ; \
95                 if cmp -s  $$file $(buildinclude)/$$f 2> /dev/null ; then \
96                 : ; else \
97                         echo " $(CP) $$file $(buildinclude)/$$f"; \
98                         $(CP) $$file $(buildinclude)/$$f; \
99                 fi ; \
100         done
102 all-local: install-build-headers
104 check-local::
105         @if test '$(CHECK_LOCAL)' = "no-check-local"; then \
106           foo=''; elif test '$(CHECK_LOCAL)'; then \
107           foo='$(CHECK_LOCAL)'; else \
108           foo='$(PROGRAMS)'; fi; \
109           if test "$$foo"; then \
110           failed=0; all=0; \
111           for i in $$foo; do \
112             all=`expr $$all + 1`; \
113             if (./$$i --version && ./$$i --help) > /dev/null 2>&1; then \
114               echo "PASS: $$i"; \
115             else \
116               echo "FAIL: $$i"; \
117               failed=`expr $$failed + 1`; \
118             fi; \
119           done; \
120           if test "$$failed" -eq 0; then \
121             banner="All $$all tests passed"; \
122           else \
123             banner="$$failed of $$all tests failed"; \
124           fi; \
125           dashes=`echo "$$banner" | sed s/./=/g`; \
126           echo "$$dashes"; \
127           echo "$$banner"; \
128           echo "$$dashes"; \
129           test "$$failed" -eq 0 || exit 1; \
130         fi
132 SUFFIXES += .x .z .hx
134 .x.c:
135         @cmp -s $< $@ 2> /dev/null || cp $< $@
137 .hx.h:
138         @cmp -s $< $@ 2> /dev/null || cp $< $@
140 SUFFIXES += .1 .3 .5 .8 .cat1 .cat3 .cat5 .cat8
142 NROFF_MAN = groff -mandoc -Tascii
143 #NROFF_MAN = nroff -man
144 .1.cat1:
145         $(NROFF_MAN) $< > $@
146 .3.cat3:
147         $(NROFF_MAN) $< > $@
148 .5.cat5:
149         $(NROFF_MAN) $< > $@
150 .8.cat8:
151         $(NROFF_MAN) $< > $@
153 ## MAINTAINERCLEANFILES += 
155 dist-cat1-mans:
156         @foo='$(man1_MANS)'; \
157         bar='$(man_MANS)'; \
158         for i in $$bar; do \
159         case $$i in \
160         *.1) foo="$$foo $$i";; \
161         esac; done ;\
162         for i in $$foo; do \
163                 x=`echo $$i | sed 's/\.[^.]*$$/.cat1/'`; \
164                 echo "$(NROFF_MAN) $(srcdir)/$$i > $(distdir)/$$x"; \
165                 $(NROFF_MAN) $(srcdir)/$$i > $(distdir)/$$x; \
166         done
168 dist-cat3-mans:
169         @foo='$(man3_MANS)'; \
170         bar='$(man_MANS)'; \
171         for i in $$bar; do \
172         case $$i in \
173         *.3) foo="$$foo $$i";; \
174         esac; done ;\
175         for i in $$foo; do \
176                 x=`echo $$i | sed 's/\.[^.]*$$/.cat3/'`; \
177                 echo "$(NROFF_MAN) $(srcdir)/$$i > $(distdir)/$$x"; \
178                 $(NROFF_MAN) $(srcdir)/$$i > $(distdir)/$$x; \
179         done
181 dist-cat5-mans:
182         @foo='$(man5_MANS)'; \
183         bar='$(man_MANS)'; \
184         for i in $$bar; do \
185         case $$i in \
186         *.5) foo="$$foo $$i";; \
187         esac; done ;\
188         for i in $$foo; do \
189                 x=`echo $$i | sed 's/\.[^.]*$$/.cat5/'`; \
190                 echo "$(NROFF_MAN) $(srcdir)/$$i > $(distdir)/$$x"; \
191                 $(NROFF_MAN) $(srcdir)/$$i > $(distdir)/$$x; \
192         done
194 dist-cat8-mans:
195         @foo='$(man8_MANS)'; \
196         bar='$(man_MANS)'; \
197         for i in $$bar; do \
198         case $$i in \
199         *.8) foo="$$foo $$i";; \
200         esac; done ;\
201         for i in $$foo; do \
202                 x=`echo $$i | sed 's/\.[^.]*$$/.cat8/'`; \
203                 echo "$(NROFF_MAN) $(srcdir)/$$i > $(distdir)/$$x"; \
204                 $(NROFF_MAN) $(srcdir)/$$i > $(distdir)/$$x; \
205         done
207 dist-hook: dist-cat1-mans dist-cat3-mans dist-cat5-mans dist-cat8-mans
209 install-cat-mans:
210         $(SHELL) $(top_srcdir)/cf/install-catman.sh install "$(INSTALL_DATA)" "$(mkinstalldirs)" "$(srcdir)" "$(DESTDIR)$(mandir)" '$(CATMANEXT)' $(man_MANS) $(man1_MANS) $(man3_MANS) $(man5_MANS) $(man8_MANS)
212 uninstall-cat-mans:
213         $(SHELL) $(top_srcdir)/cf/install-catman.sh uninstall "$(INSTALL_DATA)" "$(mkinstalldirs)" "$(srcdir)" "$(DESTDIR)$(mandir)" '$(CATMANEXT)' $(man_MANS) $(man1_MANS) $(man3_MANS) $(man5_MANS) $(man8_MANS)
215 install-data-hook: install-cat-mans
216 uninstall-hook: uninstall-cat-mans
219 .et.h:
220         $(COMPILE_ET) $<
221 .et.c:
222         $(COMPILE_ET) $<
224 LIB_kafs = $(top_builddir)/lib/kafs/libkafs.la $(AIX_EXTRA_KAFS)
226 if KRB5
227 LIB_krb5 = $(top_builddir)/lib/krb5/libkrb5.la \
228         $(top_builddir)/lib/asn1/libasn1.la
229 LIB_gssapi = $(top_builddir)/lib/gssapi/libgssapi.la
230 endif
232 LIB_heimbase = $(top_builddir)/base/libheimbase.la
234 if DCE
235 LIB_kdfs = $(top_builddir)/lib/kdfs/libkdfs.la
236 endif
239 # Useful target for debugging
242 check-valgrind:
243         tobjdir=`cd $(top_builddir) && pwd` ; \
244         tsrcdir=`cd $(top_srcdir) && pwd` ; \
245         env TESTS_ENVIRONMENT="$${tsrcdir}/cf/maybe-valgrind.sh -s $${tsrcdir} -o $${tobjdir}" make check
248 # Target to please samba build farm, builds distfiles in-tree.
249 # Will break when automake changes...
252 distdir-in-tree: $(DISTFILES) $(INFO_DEPS)
253         list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
254           if test "$$subdir" != .; then \
255           (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) distdir-in-tree) ; \
256           fi ; \
257         done