Squash using #if 0 a longstanding TODO to avoid warnings
[heimdal.git] / cf / Makefile.am.common
blob72b22d304ce0bc3c234b56175078bd354e6d5de3
1 # $Id$
3 SUFFIXES = .et .h .pc.in .pc
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 LIB_openssl_crypto      = @LIB_openssl_crypto@
49 INCLUDE_openssl_crypto  = @INCLUDE_openssl_crypto@
51 INCLUDE_krb4 = @INCLUDE_krb4@
52 LIB_krb4 = @LIB_krb4@
54 INCLUDE_openldap = @INCLUDE_openldap@
55 LIB_openldap = @LIB_openldap@
57 INCLUDE_readline = @INCLUDE_readline@
58 LIB_readline = @LIB_readline@
60 LEXLIB = @LEXLIB@
62 libexec_heimdaldir = $(libexecdir)/heimdal
64 install-suid-programs:
65         @foo='$(bin_SUIDS)'; \
66         for file in $$foo; do \
67                 x=$(DESTDIR)$(bindir)/$$file; \
68                 if chown 0:0 $$x && chmod u+s $$x; then :; else \
69                         echo "*"; \
70                         echo "* Failed to install $$x setuid root"; \
71                         echo "*"; \
72                 fi; \
73         done
75 install-exec-local: install-suid-programs
77 codesign-all:
78         @if [ X"$$CODE_SIGN_IDENTITY" != X ] ; then \
79                 foo='$(bin_PROGRAMS) $(sbin_PROGRAMS) $(libexec_PROGRAMS)' ; \
80                 for file in $$foo ; do \
81                         echo "CODESIGN $$file" ; \
82                         codesign -f -s "$$CODE_SIGN_IDENTITY" $$file || exit 1 ; \
83                 done ; \
84         fi
85         
88 all-local: codesign-all
90 install-build-headers:: $(include_HEADERS) $(dist_include_HEADERS) $(nodist_include_HEADERS) $(build_HEADERZ) $(nobase_include_HEADERS) $(noinst_HEADERS)
91         @foo='$(include_HEADERS) $(dist_include_HEADERS) $(nodist_include_HEADERS) $(build_HEADERZ) $(noinst_HEADERS)'; \
92         for f in $$foo; do \
93                 f=`basename $$f`; \
94                 if test -f "$(srcdir)/$$f"; then file="$(srcdir)/$$f"; \
95                 else file="$$f"; fi; \
96                 if cmp -s  $$file $(buildinclude)/$$f 2> /dev/null ; then \
97                 : ; else \
98                         echo " $(CP) $$file $(buildinclude)/$$f"; \
99                         $(CP) $$file $(buildinclude)/$$f || true; \
100                 fi ; \
101         done ; \
102         foo='$(nobase_include_HEADERS)'; \
103         for f in $$foo; do \
104                 if test -f "$(srcdir)/$$f"; then file="$(srcdir)/$$f"; \
105                 else file="$$f"; fi; \
106                 $(mkdir_p) $(buildinclude)/`dirname $$f` ; \
107                 if cmp -s  $$file $(buildinclude)/$$f 2> /dev/null ; then \
108                 : ; else \
109                         echo " $(CP) $$file $(buildinclude)/$$f"; \
110                         $(CP) $$file $(buildinclude)/$$f; \
111                 fi ; \
112         done
114 all-local: install-build-headers
116 check-local::
117         @if test '$(CHECK_LOCAL)' = "no-check-local"; then \
118           foo=''; elif test '$(CHECK_LOCAL)'; then \
119           foo='$(CHECK_LOCAL)'; else \
120           foo='$(PROGRAMS)'; fi; \
121           if test "$$foo"; then \
122           failed=0; all=0; \
123           for i in $$foo; do \
124             all=`expr $$all + 1`; \
125             if (./$$i --version && ./$$i --help) > /dev/null 2>&1; then \
126               echo "PASS: $$i"; \
127             else \
128               echo "FAIL: $$i"; \
129               failed=`expr $$failed + 1`; \
130             fi; \
131           done; \
132           if test "$$failed" -eq 0; then \
133             banner="All $$all tests passed"; \
134           else \
135             banner="$$failed of $$all tests failed"; \
136           fi; \
137           dashes=`echo "$$banner" | sed s/./=/g`; \
138           echo "$$dashes"; \
139           echo "$$banner"; \
140           echo "$$dashes"; \
141           test "$$failed" -eq 0 || exit 1; \
142         fi
144 SUFFIXES += .x .z .hx
146 .x.c:
147         @cmp -s $< $@ 2> /dev/null || cp $< $@
149 .hx.h:
150         @cmp -s $< $@ 2> /dev/null || cp $< $@
152 SUFFIXES += .1 .3 .5 .7 .8 .cat1 .cat3 .cat5 .cat7 .cat8
154 NROFF_MAN = groff -mandoc -Tascii
155 #NROFF_MAN = nroff -man
156 .1.cat1:
157         $(NROFF_MAN) $< > $@
158 .3.cat3:
159         $(NROFF_MAN) $< > $@
160 .5.cat5:
161         $(NROFF_MAN) $< > $@
162 .7.cat7:
163         $(NROFF_MAN) $< > $@
164 .8.cat8:
165         $(NROFF_MAN) $< > $@
167 ## MAINTAINERCLEANFILES += 
169 dist-cat1-mans:
170         @foo='$(man1_MANS)'; \
171         bar='$(man_MANS)'; \
172         for i in $$bar; do \
173         case $$i in \
174         *.1) foo="$$foo $$i";; \
175         esac; done ;\
176         for i in $$foo; do \
177                 x=`echo $$i | sed 's/\.[^.]*$$/.cat1/'`; \
178                 echo "$(NROFF_MAN) $(srcdir)/$$i > $(distdir)/$$x"; \
179                 $(NROFF_MAN) $(srcdir)/$$i > $(distdir)/$$x; \
180         done
182 dist-cat3-mans:
183         @foo='$(man3_MANS)'; \
184         bar='$(man_MANS)'; \
185         for i in $$bar; do \
186         case $$i in \
187         *.3) foo="$$foo $$i";; \
188         esac; done ;\
189         for i in $$foo; do \
190                 x=`echo $$i | sed 's/\.[^.]*$$/.cat3/'`; \
191                 echo "$(NROFF_MAN) $(srcdir)/$$i > $(distdir)/$$x"; \
192                 $(NROFF_MAN) $(srcdir)/$$i > $(distdir)/$$x; \
193         done
195 dist-cat5-mans:
196         @foo='$(man5_MANS)'; \
197         bar='$(man_MANS)'; \
198         for i in $$bar; do \
199         case $$i in \
200         *.5) foo="$$foo $$i";; \
201         esac; done ;\
202         for i in $$foo; do \
203                 x=`echo $$i | sed 's/\.[^.]*$$/.cat5/'`; \
204                 echo "$(NROFF_MAN) $(srcdir)/$$i > $(distdir)/$$x"; \
205                 $(NROFF_MAN) $(srcdir)/$$i > $(distdir)/$$x; \
206         done
208 dist-cat7-mans:
209         @foo='$(man7_MANS)'; \
210         bar='$(man_MANS)'; \
211         for i in $$bar; do \
212         case $$i in \
213         *.7) foo="$$foo $$i";; \
214         esac; done ;\
215         for i in $$foo; do \
216                 x=`echo $$i | sed 's/\.[^.]*$$/.cat7/'`; \
217                 echo "$(NROFF_MAN) $(srcdir)/$$i > $(distdir)/$$x"; \
218                 $(NROFF_MAN) $(srcdir)/$$i > $(distdir)/$$x; \
219         done
221 dist-cat8-mans:
222         @foo='$(man8_MANS)'; \
223         bar='$(man_MANS)'; \
224         for i in $$bar; do \
225         case $$i in \
226         *.8) foo="$$foo $$i";; \
227         esac; done ;\
228         for i in $$foo; do \
229                 x=`echo $$i | sed 's/\.[^.]*$$/.cat8/'`; \
230                 echo "$(NROFF_MAN) $(srcdir)/$$i > $(distdir)/$$x"; \
231                 $(NROFF_MAN) $(srcdir)/$$i > $(distdir)/$$x; \
232         done
234 dist-hook: dist-cat1-mans dist-cat3-mans dist-cat5-mans dist-cat7-mans dist-cat8-mans
236 install-cat-mans:
237         $(SHELL) $(top_srcdir)/cf/install-catman.sh install "$(INSTALL_DATA)" "$(mkinstalldirs)" "$(srcdir)" "$(DESTDIR)$(mandir)" '$(CATMANEXT)' $(man_MANS) $(man1_MANS) $(man3_MANS) $(man5_MANS) $(man7_MANS) $(man8_MANS)
239 uninstall-cat-mans:
240         $(SHELL) $(top_srcdir)/cf/install-catman.sh uninstall "$(INSTALL_DATA)" "$(mkinstalldirs)" "$(srcdir)" "$(DESTDIR)$(mandir)" '$(CATMANEXT)' $(man_MANS) $(man1_MANS) $(man3_MANS) $(man5_MANS) $(man7_MANS) $(man8_MANS)
242 install-data-hook: install-cat-mans
243 uninstall-hook: uninstall-cat-mans
246 .et.h:
247         $(COMPILE_ET) $<
248 .et.c:
249         $(COMPILE_ET) $<
251 if NO_AFS
252 LIB_kafs =
253 else
254 LIB_kafs = $(top_builddir)/lib/kafs/libkafs.la $(AIX_EXTRA_KAFS)
255 endif
257 if KRB5
258 LIB_krb5 = $(top_builddir)/lib/krb5/libkrb5.la \
259         $(top_builddir)/lib/asn1/libasn1.la
260 LIB_gssapi = $(top_builddir)/lib/gssapi/libgssapi.la
261 endif
263 LIB_heimbase = $(top_builddir)/lib/base/libheimbase.la
265 if DCE
266 LIB_kdfs = $(top_builddir)/lib/kdfs/libkdfs.la
267 endif
270 # Useful target for debugging
273 check-valgrind:
274         tobjdir=`cd $(top_builddir) && pwd` ; \
275         tsrcdir=`cd $(top_srcdir) && pwd` ; \
276         env TESTS_ENVIRONMENT="$${tsrcdir}/cf/maybe-valgrind.sh -s $${tsrcdir} -o $${tobjdir}" make check
279 # Target to please samba build farm, builds distfiles in-tree.
280 # Will break when automake changes...
283 distdir-in-tree: $(DISTFILES) $(INFO_DEPS)
284         list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
285           if test "$$subdir" != .; then \
286           (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) distdir-in-tree) ; \
287           fi ; \
288         done
291 #silent-rules
293 heim_verbose = $(heim_verbose_$(V))
294 heim_verbose_ = $(heim_verbose_$(AM_DEFAULT_VERBOSITY))
295 heim_verbose_0 = @echo "  GEN    "$@;
297 if ENABLE_GCOV
298 AM_CFLAGS += --coverage --no-inline
299 AM_LDFLAGS = -lgcov
300 endif