# vim:ft=automake
-# Copyright (c) 2005 Zmanda, Inc. All Rights Reserved.
+# Copyright (c) 2005-2008 Zmanda Inc. All Rights Reserved.
#
# This library is free software; you can redistribute it and/or modify it
# under the terms of the GNU Lesser General Public License version 2.1 as
# along with this library; if not, write to the Free Software Foundation,
# Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
#
-# Contact information: Zmanda Inc., 505 N Mathlida Ave, Suite 120
-# Sunnyvale, CA 94085, USA, or: http://www.zmanda.com
+# Contact information: Zmanda Inc., 465 S Mathlida Ave, Suite 300
+# Sunnyvale, CA 94086, USA, or: http://www.zmanda.com
# SYNOPSIS:
#
# Files which support it are syntax-checked when the user invokes 'make check'.
#
# All *target* filenames must be listed in SCRIPTS_SHELL, SCRIPTS_PERL, and
-# SCRIPTS_AWK to support 'make check', 'make dist', and 'make distclean'.
+# SCRIPTS_AWK to support 'make check', 'make dist', and 'make distclean'. No
+# files which are not substituted by config.status should be included in
+# SCRIPTS_PERL, SCRIPTS_SHELL, or SCRIPTS_AWK. If non-generated files are listed
+# for installation, then Automake will figure out that they should be distributed;
+# otherwise, include them in EXTRA_DIST.
#
# USAGE:
#
# SCRIPTS_PERL = fooscript barscript perl-lib.pl perlmod.pm
# SCRIPTS_SHELL = shell1 shell2 sh-lib.sh
# SCRIPTS_AWK = talk balk chalk awk-lib.awk
+# sbin_SCRIPTS = not-subbed
+# EXTRA_DIST = util-script.pl
#
# with the corresponding files in the repository:
#
# fooscript.pl barscript.pl perl-lib.pl.in perlmod.pm.in
# shell1.sh shell2.sh sh-lib.sh.in
# talk.awk balk.awk chalk.awk awk-lib.awk.in
+# not-subbed util-script.pl
#
# by default, all shell and perl scripts are syntax checked. If this is
# a problem (for example, perl scripts depending on Amanda extension
%: %.pl $(top_builddir)/config.status
$(top_builddir)/config.status --file=$@:$<
chmod a+x $@
+ @if test -f $(top_builddir)/perl/.libs/libCmdline.so -o -f $(top_builddir)/perl/libCmdline.so; then \
+ grep -v '^use lib' $@ > $@.nouselib; \
+ $(PERL) $(CHECK_PERL_FLAGS) -I$(top_builddir)/perl -I$(top_builddir)/perl/.libs -I$(top_srcdir)/perl -c -w -T $@.nouselib || exit 1; \
+ rm $@.nouselib; \
+ fi
%.pl: %.pl.in $(top_builddir)/config.status
$(top_builddir)/config.status --file=$@:$<
CLEANFILES += config.log
# and we'll need to clean up our generated files for distclean
-DISTCLEANFILES += $(SCRIPTS_SHELL) $(SCRIPTS_PERL) $(SCRIPTS_AWK)
+DISTCLEANFILES += $(SCRIPTS_SHELL) $(SCRIPTS_PERL) $(SCRIPTS_AWK) $(SCRIPTS_INCLUDE)
# syntax-check perl scripts on 'make check'
check-perl: $(CHECK_PERL)
+ @CHECK_PERL="$(CHECK_PERL)"; \
+ if test -f $(top_builddir)/perl/.libs/libCmdline.so -o -f $(top_builddir)/perl/libCmdline.so; then \
+ if test -n "$(PERL)"; then \
+ for perlobj in $$CHECK_PERL; do \
+ grep -v '^use lib' $$perlobj > $$perlobj.nouselib; \
+ $(PERL) $(CHECK_PERL_FLAGS) -I$(top_builddir)/perl -I$(top_builddir)/perl/.libs -I$(top_srcdir)/perl -c -w -T $$perlobj.nouselib || exit 1; \
+ rm $$perlobj.nouselib; \
+ done; \
+ fi \
+ fi
+check-local: check-perl
+
+# syntax-check perl scripts on 'make installcheck'
+installcheck-perl: $(CHECK_PERL)
@CHECK_PERL="$(CHECK_PERL)"; \
if test -n "$(PERL)"; then \
for perlobj in $$CHECK_PERL; do \
$(PERL) $(CHECK_PERL_FLAGS) -c -w -T $$perlobj || exit 1; \
done; \
fi
-check-local: check-perl
+installcheck-local: installcheck-perl
# syntax-check shell scripts on 'make check'
CHECK_SHELL = $(SCRIPTS_SHELL)