]> git.draconx.ca Git - cdecl99.git/blobdiff - Makefile.am
Add a basic "make installcheck" function.
[cdecl99.git] / Makefile.am
index 336e4439ba82f760cb776d09d7ef32fb8894cafd..220280ce76ff8f87a06827f36cd02a06d763f5a8 100644 (file)
@@ -335,6 +335,24 @@ atlocal: config.status
 check_DATA = atlocal
 CLEANFILES += atlocal
 
+# Note: to reliably test linking against the installed library we directly
+# refer to the just-installed .la file, rather than more typical library flags
+# (-Lfoo -lfoo).  Otherwise libtool can pick up libcdecl.la from the current
+# working directory which defeats the point of an install check.
+EXTRA_PROGRAMS = t/installcheck
+t_installcheck_CPPFLAGS = -I$(DESTDIR)$(includedir)
+t_installcheck_LDADD = $(DESTDIR)$(libdir)/libcdecl.la
+t_installcheck_CFLAGS =
+t_installcheck_SHORTNAME = x
+
+installcheck-local:
+       rm -f t/installcheck$(EXEEXT)
+       $(MAKE) $(AM_MAKEFLAGS) t/installcheck$(EXEEXT)
+       t/installcheck$(EXEEXT) | diff - $(srcdir)/t/installcheck.exp
+.PHONY: installcheck-local
+EXTRA_DIST += t/installcheck.c t/installcheck.exp
+CLEANFILES += t/installcheck$(EXEEXT)
+
 include $(top_srcdir)/lib/gnulib.mk
 include $(top_srcdir)/common/snippet/glconfig.mk
 include $(top_srcdir)/common/snippet/autotest.mk