]> sourceware.org Git - systemtap.git/commitdiff
Make sure examples indexes are always generated in builddir.
authorMark Wielaard <mwielaard@redhat.com>
Fri, 8 Aug 2008 11:29:55 +0000 (13:29 +0200)
committerMark Wielaard <mwielaard@redhat.com>
Fri, 8 Aug 2008 11:29:55 +0000 (13:29 +0200)
ChangeLog
Makefile.am
Makefile.in
aclocal.m4
testsuite/systemtap.examples/ChangeLog
testsuite/systemtap.examples/examples-index-gen.pl

index 8b99e4dd948ef2ab7872a8f89994c59e66e1818d..7e0d47a013fd95b69273f1cab7dc04bf1c641381 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,17 @@
+2008-08-08  Mark Wielaard  <mwielaard@redhat.com>
+
+       * Makefile.am (all-local): Depend on example_index, which now
+       doesn't generate anything in $srcdir anymore, only $builddir.
+       (EXAMPLE_SOURCE_DIR): New var.
+       (EXAMPLE_BUILD_DIR): New var.
+       (EXAMPLE_META_FILES): New var.
+       (EXAMPLE_INDEX_GEN): New var.
+       (example_index): New target.
+       ($EXAMPLE_BUILD_DIR/index.html): Likewise.
+       (install-data-local): Install examples from $buildir.
+       * Makefile.in: Regenerated.
+       * aclocal.m4: Likewise.
+
 2008-08-07  Frank Ch. Eigler  <fche@elastic.org>
 
        * Makefile.am (all-local): Don't run indexing code, since $srcdir
index 2e5d69473b3a32a13b20fd7a38e8971e98cc4923..154d99442e0cba44993747a1a7fc97debd249bb7 100644 (file)
@@ -140,10 +140,12 @@ STAPLOG=staplog.so
 $(STAPLOG): staplog.c
        $(CC) $(staplog_CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -shared -rdynamic \
                $(AM_LDFLAGS) $(LDFLAGS) -fPIC -o $@ $<
-all-local: $(STAPLOG)
+all-local: $(STAPLOG) example_index
 install-exec-local: $(STAPLOG)
        $(MKDIR_P) $(DESTDIR)$(pkglibdir)
        $(INSTALL) $(STAPLOG) $(DESTDIR)$(pkglibdir)
+else
+all-local: example_index
 endif
 
 # Get extra libs as needed
@@ -158,6 +160,15 @@ EXTRA_DIST = auto_free.h buildrun.h elaborate.h loc2c.h session.h \
             stap-client stap-server stap-serverd stap-find-servers stap-start-server stap-find-or-start-server stap-stop-server \
             systemtap.spec
 
+EXAMPLE_SOURCE_DIR = $(srcdir)/testsuite/systemtap.examples
+EXAMPLE_BUILD_DIR = $(builddir)/testsuite/systemtap.examples
+EXAMPLE_META_FILES = $(EXAMPLE_SOURCE_DIR)/*/*.meta
+EXAMPLE_INDEX_GEN = $(EXAMPLE_SOURCE_DIR)/examples-index-gen.pl
+
+example_index: $(EXAMPLE_BUILD_DIR)/index.html
+
+$(EXAMPLE_BUILD_DIR)/index.html: $(EXAMPLE_META_FILES) $(EXAMPLE_INDEX_GEN)
+       perl $(EXAMPLE_INDEX_GEN) $(EXAMPLE_SOURCE_DIR) $(EXAMPLE_BUILD_DIR)
 
 dist-hook: dist-gitversion
        find $(distdir) -name CVS -o -name '*~' -o -name '.#*' | xargs rm -rf
@@ -174,7 +185,7 @@ install-data-local:
                do $(INSTALL_DATA) -D $$f $(DESTDIR)$(pkgdatadir)/runtime/uprobes/$$f; done)
        (cd $(srcdir)/tapset; find . \( -name '*.stp' -o -name README \) -print \
                | while read f; do $(INSTALL_DATA) -D $$f $(DESTDIR)$(pkgdatadir)/tapset/$$f; done)
-       (cd $(srcdir)/testsuite/systemtap.examples; find . -type f -print \
+       (cd $(builddir)/testsuite/systemtap.examples; find . -type f -print \
                | egrep -v 'check.exp|ChangeLog|examples-index-gen.pl' \
                | while read f; do $(INSTALL_DATA) -D $$f $(DESTDIR)$(docdir)/examples/$$f; done)
 
index 10dae8f157e91d4f871be79ec43151e26add6b8e..45d209ace2fc354866e63d2f7210c30db5cfa3df 100644 (file)
@@ -1,8 +1,8 @@
-# Makefile.in generated by automake 1.10 from Makefile.am.
+# Makefile.in generated by automake 1.10.1 from Makefile.am.
 # @configure_input@
 
 # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005, 2006  Free Software Foundation, Inc.
+# 2003, 2004, 2005, 2006, 2007, 2008  Free Software Foundation, Inc.
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
@@ -337,6 +337,10 @@ EXTRA_DIST = auto_free.h buildrun.h elaborate.h loc2c.h session.h \
             stap-client stap-server stap-serverd stap-find-servers stap-start-server stap-find-or-start-server stap-stop-server \
             systemtap.spec
 
+EXAMPLE_SOURCE_DIR = $(srcdir)/testsuite/systemtap.examples
+EXAMPLE_BUILD_DIR = $(builddir)/testsuite/systemtap.examples
+EXAMPLE_META_FILES = $(EXAMPLE_SOURCE_DIR)/*/*.meta
+EXAMPLE_INDEX_GEN = $(EXAMPLE_SOURCE_DIR)/examples-index-gen.pl
 TEST_COV_DIR = coverage
 # XXX: leaves behind man pages
 SUBDIRS = testsuite doc
@@ -1162,8 +1166,8 @@ ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
        unique=`for i in $$list; do \
            if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
          done | \
-         $(AWK) '    { files[$$0] = 1; } \
-              END { for (i in files) print i; }'`; \
+         $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \
+             END { if (nonempty) { for (i in files) print i; }; }'`; \
        mkid -fID $$unique
 tags: TAGS
 
@@ -1188,8 +1192,8 @@ TAGS: tags-recursive $(HEADERS) $(SOURCES) config.in $(TAGS_DEPENDENCIES) \
        unique=`for i in $$list; do \
            if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
          done | \
-         $(AWK) '    { files[$$0] = 1; } \
-              END { for (i in files) print i; }'`; \
+         $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+             END { if (nonempty) { for (i in files) print i; }; }'`; \
        if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
          test -n "$$unique" || unique=$$empty_fix; \
          $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
@@ -1199,13 +1203,12 @@ ctags: CTAGS
 CTAGS: ctags-recursive $(HEADERS) $(SOURCES) config.in $(TAGS_DEPENDENCIES) \
                $(TAGS_FILES) $(LISP)
        tags=; \
-       here=`pwd`; \
        list='$(SOURCES) $(HEADERS) config.in $(LISP) $(TAGS_FILES)'; \
        unique=`for i in $$list; do \
            if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
          done | \
-         $(AWK) '    { files[$$0] = 1; } \
-              END { for (i in files) print i; }'`; \
+         $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+             END { if (nonempty) { for (i in files) print i; }; }'`; \
        test -z "$(CTAGS_ARGS)$$tags$$unique" \
          || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
             $$tags $$unique
@@ -1278,6 +1281,10 @@ dist-bzip2: distdir
        tardir=$(distdir) && $(am__tar) | bzip2 -9 -c >$(distdir).tar.bz2
        $(am__remove_distdir)
 
+dist-lzma: distdir
+       tardir=$(distdir) && $(am__tar) | lzma -9 -c >$(distdir).tar.lzma
+       $(am__remove_distdir)
+
 dist-tarZ: distdir
        tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z
        $(am__remove_distdir)
@@ -1305,6 +1312,8 @@ distcheck: dist
          GZIP=$(GZIP_ENV) gunzip -c $(distdir).tar.gz | $(am__untar) ;;\
        *.tar.bz2*) \
          bunzip2 -c $(distdir).tar.bz2 | $(am__untar) ;;\
+       *.tar.lzma*) \
+         unlzma -c $(distdir).tar.lzma | $(am__untar) ;;\
        *.tar.Z*) \
          uncompress -c $(distdir).tar.Z | $(am__untar) ;;\
        *.shar.gz*) \
@@ -1366,7 +1375,6 @@ distcleancheck: distclean
 check-am: all-am
 check: $(BUILT_SOURCES)
        $(MAKE) $(AM_MAKEFLAGS) check-recursive
-@BUILD_CRASHMOD_FALSE@all-local:
 all-am: Makefile $(PROGRAMS) $(SCRIPTS) $(MANS) config.h all-local
 installdirs: installdirs-recursive
 installdirs-am:
@@ -1474,7 +1482,7 @@ uninstall-man: uninstall-man1 uninstall-man5 uninstall-man8
        clean-binPROGRAMS clean-generic clean-local \
        clean-noinstPROGRAMS clean-pkglibexecPROGRAMS ctags \
        ctags-recursive dist dist-all dist-bzip2 dist-gzip dist-hook \
-       dist-shar dist-tarZ dist-zip distcheck distclean \
+       dist-lzma dist-shar dist-tarZ dist-zip distcheck distclean \
        distclean-compile distclean-generic distclean-hdr \
        distclean-tags distcleancheck distdir distuninstallcheck dvi \
        dvi-am html html-am info info-am install install-am \
@@ -1545,10 +1553,16 @@ install-exec-hook:
 @BUILD_CRASHMOD_TRUE@$(STAPLOG): staplog.c
 @BUILD_CRASHMOD_TRUE@  $(CC) $(staplog_CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -shared -rdynamic \
 @BUILD_CRASHMOD_TRUE@          $(AM_LDFLAGS) $(LDFLAGS) -fPIC -o $@ $<
-@BUILD_CRASHMOD_TRUE@all-local: $(STAPLOG)
+@BUILD_CRASHMOD_TRUE@all-local: $(STAPLOG) example_index
 @BUILD_CRASHMOD_TRUE@install-exec-local: $(STAPLOG)
 @BUILD_CRASHMOD_TRUE@  $(MKDIR_P) $(DESTDIR)$(pkglibdir)
 @BUILD_CRASHMOD_TRUE@  $(INSTALL) $(STAPLOG) $(DESTDIR)$(pkglibdir)
+@BUILD_CRASHMOD_FALSE@all-local: example_index
+
+example_index: $(EXAMPLE_BUILD_DIR)/index.html
+
+$(EXAMPLE_BUILD_DIR)/index.html: $(EXAMPLE_META_FILES) $(EXAMPLE_INDEX_GEN)
+       perl $(EXAMPLE_INDEX_GEN) $(EXAMPLE_SOURCE_DIR) $(EXAMPLE_BUILD_DIR)
 
 dist-hook: dist-gitversion
        find $(distdir) -name CVS -o -name '*~' -o -name '.#*' | xargs rm -rf
@@ -1565,7 +1579,7 @@ install-data-local:
                do $(INSTALL_DATA) -D $$f $(DESTDIR)$(pkgdatadir)/runtime/uprobes/$$f; done)
        (cd $(srcdir)/tapset; find . \( -name '*.stp' -o -name README \) -print \
                | while read f; do $(INSTALL_DATA) -D $$f $(DESTDIR)$(pkgdatadir)/tapset/$$f; done)
-       (cd $(srcdir)/testsuite/systemtap.examples; find . -type f -print \
+       (cd $(builddir)/testsuite/systemtap.examples; find . -type f -print \
                | egrep -v 'check.exp|ChangeLog|examples-index-gen.pl' \
                | while read f; do $(INSTALL_DATA) -D $$f $(DESTDIR)$(docdir)/examples/$$f; done)
 
index 9d70920d70778417461d1ade1ea955e209c9974e..0e2027cd7ea85b329d55252cb00914a615ba5e12 100644 (file)
@@ -1,7 +1,7 @@
-# generated automatically by aclocal 1.10 -*- Autoconf -*-
+# generated automatically by aclocal 1.10.1 -*- Autoconf -*-
 
 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
-# 2005, 2006  Free Software Foundation, Inc.
+# 2005, 2006, 2007, 2008  Free Software Foundation, Inc.
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
 # even the implied warranty of MERCHANTABILITY or FITNESS FOR A
 # PARTICULAR PURPOSE.
 
-m4_if(m4_PACKAGE_VERSION, [2.61],,
-[m4_fatal([this file was generated for autoconf 2.61.
-You have another version of autoconf.  If you want to use that,
-you should regenerate the build system entirely.], [63])])
+m4_ifndef([AC_AUTOCONF_VERSION],
+  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
+m4_if(AC_AUTOCONF_VERSION, [2.61],,
+[m4_warning([this file was generated for autoconf 2.61.
+You have another version of autoconf.  It may work, but is not guaranteed to.
+If you have problems, you may need to regenerate the build system entirely.
+To do so, use the procedure documented by the package, typically `autoreconf'.])])
 
-# Copyright (C) 2002, 2003, 2005, 2006  Free Software Foundation, Inc.
+# Copyright (C) 2002, 2003, 2005, 2006, 2007  Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -31,7 +34,7 @@ AC_DEFUN([AM_AUTOMAKE_VERSION],
 [am__api_version='1.10'
 dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
 dnl require some minimum version.  Point them to the right macro.
-m4_if([$1], [1.10], [],
+m4_if([$1], [1.10.1], [],
       [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
 ])
 
@@ -47,8 +50,10 @@ m4_define([_AM_AUTOCONF_VERSION], [])
 # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
 # This function is AC_REQUIREd by AC_INIT_AUTOMAKE.
 AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
-[AM_AUTOMAKE_VERSION([1.10])dnl
-_AM_AUTOCONF_VERSION(m4_PACKAGE_VERSION)])
+[AM_AUTOMAKE_VERSION([1.10.1])dnl
+m4_ifndef([AC_AUTOCONF_VERSION],
+  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
+_AM_AUTOCONF_VERSION(AC_AUTOCONF_VERSION)])
 
 # AM_AUX_DIR_EXPAND                                         -*- Autoconf -*-
 
@@ -343,7 +348,7 @@ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
   # each Makefile.in and add a new line on top of each file to say so.
   # Grep'ing the whole file is not good either: AIX grep has a line
   # limit of 2048, but all sed's we know have understand at least 4000.
-  if sed 10q "$mf" | grep '^#.*generated by automake' > /dev/null 2>&1; then
+  if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
     dirpart=`AS_DIRNAME("$mf")`
   else
     continue
@@ -391,13 +396,13 @@ AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
 # Do all the work for Automake.                             -*- Autoconf -*-
 
 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
-# 2005, 2006 Free Software Foundation, Inc.
+# 2005, 2006, 2008 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
 
-# serial 12
+# serial 13
 
 # This macro actually does too much.  Some checks are only needed if
 # your package does certain things.  But this isn't really a big deal.
@@ -502,16 +507,17 @@ AC_PROVIDE_IFELSE([AC_PROG_OBJC],
 # our stamp files there.
 AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
 [# Compute $1's index in $config_headers.
+_am_arg=$1
 _am_stamp_count=1
 for _am_header in $config_headers :; do
   case $_am_header in
-    $1 | $1:* )
+    $_am_arg | $_am_arg:* )
       break ;;
     * )
       _am_stamp_count=`expr $_am_stamp_count + 1` ;;
   esac
 done
-echo "timestamp for $1" >`AS_DIRNAME([$1])`/stamp-h[]$_am_stamp_count])
+echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
 
 # Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
 #
@@ -872,7 +878,7 @@ AC_SUBST([INSTALL_STRIP_PROGRAM])])
 
 # _AM_SUBST_NOTMAKE(VARIABLE)
 # ---------------------------
-# Prevent Automake from outputing VARIABLE = @VARIABLE@ in Makefile.in.
+# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in.
 # This macro is traced by Automake.
 AC_DEFUN([_AM_SUBST_NOTMAKE])
 
index d5840f96c384136a9a63e752ef0e25f4ff32daae..31a981aaa5e9bf0b10574616fca159d79bcf3d57 100644 (file)
@@ -1,3 +1,10 @@
+2008-08-08  Mark Wielaard  <mwielaard@redhat.com>
+
+       * examples-index-gen.pl (inputdir): Make absolute.
+       (outputdir): Likewise.
+       (supportfiles): Copy from new html dir. Add README. Make sure
+       new html subdir is created in outputdir.
+
 2008-08-07  Frank Ch. Eigler  <fche@elastic.org>
 
        * *index.txt, *index.html: New generated files.
index 8e9681594dd745f38e406521207a924387f4c456..726df97331242e166320b983406b38094ff8e1ef 100644 (file)
@@ -10,6 +10,7 @@
 use strict;
 use warnings;
 
+use Cwd 'abs_path';
 use File::Copy;
 use File::Find;
 use File::Path;
@@ -21,6 +22,7 @@ if ($#ARGV >= 0) {
 } else {
     $inputdir = ".";
 }
+$inputdir = abs_path($inputdir);
 
 my $outputdir;
 if ($#ARGV >= 1) {
@@ -28,6 +30,7 @@ if ($#ARGV >= 1) {
 } else {
     $outputdir = $inputdir;
 }
+$outputdir = abs_path($outputdir);
 
 my %scripts = ();
 print "Parsing .meta files in $inputdir...\n";
@@ -198,17 +201,21 @@ close (KEYINDEX);
 close (KEYHTML);
 
 my @supportfiles
-    = ("systemtapcorner.gif",
-       "systemtap.css",
-       "systemtaplogo.png");
+    = ("html/systemtapcorner.gif",
+       "html/systemtap.css",
+       "html/systemtaplogo.png",
+       "README");
 if ($inputdir ne $outputdir) {
     my $file;
     print "Copying support files...\n";
+    if (! -d "$outputdir/html") {
+       mkpath("$outputdir/html", 1, 0711);
+    }
     foreach $file (@supportfiles) {
        my $orig = "$inputdir/$file";
        my $dest = "$outputdir/$file";
        print "Copying $file to $dest...\n";
-       copy("$orig", $dest) or die "$file cannot be copied to $dest, $!";
+       copy($orig, $dest) or die "$file cannot be copied to $dest, $!";
     }
 }
 
This page took 0.057351 seconds and 5 git commands to generate.