Goodbye login
[heimdal.git] / cf / Makefile.am.common
blobba18933c81b4db21e5013467a1b1e973370c8e42
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 HESIODLIB = @HESIODLIB@
52 HESIODINCLUDE = @HESIODINCLUDE@
53 INCLUDE_hesiod = @INCLUDE_hesiod@
54 LIB_hesiod = @LIB_hesiod@
56 INCLUDE_krb4 = @INCLUDE_krb4@
57 LIB_krb4 = @LIB_krb4@
59 INCLUDE_openldap = @INCLUDE_openldap@
60 LIB_openldap = @LIB_openldap@
62 INCLUDE_readline = @INCLUDE_readline@
63 LIB_readline = @LIB_readline@
65 LEXLIB = @LEXLIB@
67 libexec_heimdaldir = $(libexecdir)/heimdal
69 install-suid-programs:
70         @foo='$(bin_SUIDS)'; \
71         for file in $$foo; do \
72                 x=$(DESTDIR)$(bindir)/$$file; \
73                 if chown 0:0 $$x && chmod u+s $$x; then :; else \
74                         echo "*"; \
75                         echo "* Failed to install $$x setuid root"; \
76                         echo "*"; \
77                 fi; \
78         done
80 install-exec-local: install-suid-programs
82 codesign-all:
83         @if [ X"$$CODE_SIGN_IDENTITY" != X ] ; then \
84                 foo='$(bin_PROGRAMS) $(sbin_PROGRAMS) $(libexec_PROGRAMS)' ; \
85                 for file in $$foo ; do \
86                         echo "CODESIGN $$file" ; \
87                         codesign -f -s "$$CODE_SIGN_IDENTITY" $$file || exit 1 ; \
88                 done ; \
89         fi
90         
93 all-local: codesign-all
95 install-build-headers:: $(include_HEADERS) $(dist_include_HEADERS) $(nodist_include_HEADERS) $(build_HEADERZ) $(nobase_include_HEADERS) $(noinst_HEADERS)
96         @foo='$(include_HEADERS) $(dist_include_HEADERS) $(nodist_include_HEADERS) $(build_HEADERZ) $(noinst_HEADERS)'; \
97         for f in $$foo; do \
98                 f=`basename $$f`; \
99                 if test -f "$(srcdir)/$$f"; then file="$(srcdir)/$$f"; \
100                 else file="$$f"; fi; \
101                 if cmp -s  $$file $(buildinclude)/$$f 2> /dev/null ; then \
102                 : ; else \
103                         echo " $(CP) $$file $(buildinclude)/$$f"; \
104                         $(CP) $$file $(buildinclude)/$$f || true; \
105                 fi ; \
106         done ; \
107         foo='$(nobase_include_HEADERS)'; \
108         for f in $$foo; do \
109                 if test -f "$(srcdir)/$$f"; then file="$(srcdir)/$$f"; \
110                 else file="$$f"; fi; \
111                 $(mkdir_p) $(buildinclude)/`dirname $$f` ; \
112                 if cmp -s  $$file $(buildinclude)/$$f 2> /dev/null ; then \
113                 : ; else \
114                         echo " $(CP) $$file $(buildinclude)/$$f"; \
115                         $(CP) $$file $(buildinclude)/$$f; \
116                 fi ; \
117         done
119 all-local: install-build-headers
121 check-local::
122         @if test '$(CHECK_LOCAL)' = "no-check-local"; then \
123           foo=''; elif test '$(CHECK_LOCAL)'; then \
124           foo='$(CHECK_LOCAL)'; else \
125           foo='$(PROGRAMS)'; fi; \
126           if test "$$foo"; then \
127           failed=0; all=0; \
128           for i in $$foo; do \
129             all=`expr $$all + 1`; \
130             if (./$$i --version && ./$$i --help) > /dev/null 2>&1; then \
131               echo "PASS: $$i"; \
132             else \
133               echo "FAIL: $$i"; \
134               failed=`expr $$failed + 1`; \
135             fi; \
136           done; \
137           if test "$$failed" -eq 0; then \
138             banner="All $$all tests passed"; \
139           else \
140             banner="$$failed of $$all tests failed"; \
141           fi; \
142           dashes=`echo "$$banner" | sed s/./=/g`; \
143           echo "$$dashes"; \
144           echo "$$banner"; \
145           echo "$$dashes"; \
146           test "$$failed" -eq 0 || exit 1; \
147         fi
149 SUFFIXES += .x .z .hx
151 .x.c:
152         @cmp -s $< $@ 2> /dev/null || cp $< $@
154 .hx.h:
155         @cmp -s $< $@ 2> /dev/null || cp $< $@
157 SUFFIXES += .1 .3 .5 .7 .8 .cat1 .cat3 .cat5 .cat7 .cat8
159 NROFF_MAN = groff -mandoc -Tascii
160 #NROFF_MAN = nroff -man
161 .1.cat1:
162         $(NROFF_MAN) $< > $@
163 .3.cat3:
164         $(NROFF_MAN) $< > $@
165 .5.cat5:
166         $(NROFF_MAN) $< > $@
167 .7.cat7:
168         $(NROFF_MAN) $< > $@
169 .8.cat8:
170         $(NROFF_MAN) $< > $@
172 ## MAINTAINERCLEANFILES += 
174 dist-cat1-mans:
175         @foo='$(man1_MANS)'; \
176         bar='$(man_MANS)'; \
177         for i in $$bar; do \
178         case $$i in \
179         *.1) foo="$$foo $$i";; \
180         esac; done ;\
181         for i in $$foo; do \
182                 x=`echo $$i | sed 's/\.[^.]*$$/.cat1/'`; \
183                 echo "$(NROFF_MAN) $(srcdir)/$$i > $(distdir)/$$x"; \
184                 $(NROFF_MAN) $(srcdir)/$$i > $(distdir)/$$x; \
185         done
187 dist-cat3-mans:
188         @foo='$(man3_MANS)'; \
189         bar='$(man_MANS)'; \
190         for i in $$bar; do \
191         case $$i in \
192         *.3) foo="$$foo $$i";; \
193         esac; done ;\
194         for i in $$foo; do \
195                 x=`echo $$i | sed 's/\.[^.]*$$/.cat3/'`; \
196                 echo "$(NROFF_MAN) $(srcdir)/$$i > $(distdir)/$$x"; \
197                 $(NROFF_MAN) $(srcdir)/$$i > $(distdir)/$$x; \
198         done
200 dist-cat5-mans:
201         @foo='$(man5_MANS)'; \
202         bar='$(man_MANS)'; \
203         for i in $$bar; do \
204         case $$i in \
205         *.5) foo="$$foo $$i";; \
206         esac; done ;\
207         for i in $$foo; do \
208                 x=`echo $$i | sed 's/\.[^.]*$$/.cat5/'`; \
209                 echo "$(NROFF_MAN) $(srcdir)/$$i > $(distdir)/$$x"; \
210                 $(NROFF_MAN) $(srcdir)/$$i > $(distdir)/$$x; \
211         done
213 dist-cat7-mans:
214         @foo='$(man7_MANS)'; \
215         bar='$(man_MANS)'; \
216         for i in $$bar; do \
217         case $$i in \
218         *.7) foo="$$foo $$i";; \
219         esac; done ;\
220         for i in $$foo; do \
221                 x=`echo $$i | sed 's/\.[^.]*$$/.cat7/'`; \
222                 echo "$(NROFF_MAN) $(srcdir)/$$i > $(distdir)/$$x"; \
223                 $(NROFF_MAN) $(srcdir)/$$i > $(distdir)/$$x; \
224         done
226 dist-cat8-mans:
227         @foo='$(man8_MANS)'; \
228         bar='$(man_MANS)'; \
229         for i in $$bar; do \
230         case $$i in \
231         *.8) foo="$$foo $$i";; \
232         esac; done ;\
233         for i in $$foo; do \
234                 x=`echo $$i | sed 's/\.[^.]*$$/.cat8/'`; \
235                 echo "$(NROFF_MAN) $(srcdir)/$$i > $(distdir)/$$x"; \
236                 $(NROFF_MAN) $(srcdir)/$$i > $(distdir)/$$x; \
237         done
239 dist-hook: dist-cat1-mans dist-cat3-mans dist-cat5-mans dist-cat7-mans dist-cat8-mans
241 install-cat-mans:
242         $(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)
244 uninstall-cat-mans:
245         $(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)
247 install-data-hook: install-cat-mans
248 uninstall-hook: uninstall-cat-mans
251 .et.h:
252         $(COMPILE_ET) $<
253 .et.c:
254         $(COMPILE_ET) $<
256 if NO_AFS
257 LIB_kafs =
258 else
259 LIB_kafs = $(top_builddir)/lib/kafs/libkafs.la $(AIX_EXTRA_KAFS)
260 endif
262 if KRB5
263 LIB_krb5 = $(top_builddir)/lib/krb5/libkrb5.la \
264         $(top_builddir)/lib/asn1/libasn1.la
265 LIB_gssapi = $(top_builddir)/lib/gssapi/libgssapi.la
266 endif
268 LIB_heimbase = $(top_builddir)/lib/base/libheimbase.la
270 if DCE
271 LIB_kdfs = $(top_builddir)/lib/kdfs/libkdfs.la
272 endif
275 # Useful target for debugging
278 check-valgrind:
279         tobjdir=`cd $(top_builddir) && pwd` ; \
280         tsrcdir=`cd $(top_srcdir) && pwd` ; \
281         env TESTS_ENVIRONMENT="$${tsrcdir}/cf/maybe-valgrind.sh -s $${tsrcdir} -o $${tobjdir}" make check
284 # Target to please samba build farm, builds distfiles in-tree.
285 # Will break when automake changes...
288 distdir-in-tree: $(DISTFILES) $(INFO_DEPS)
289         list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
290           if test "$$subdir" != .; then \
291           (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) distdir-in-tree) ; \
292           fi ; \
293         done
296 #silent-rules
298 heim_verbose = $(heim_verbose_$(V))
299 heim_verbose_ = $(heim_verbose_$(AM_DEFAULT_VERBOSITY))
300 heim_verbose_0 = @echo "  GEN    "$@;