Fri Apr 5 00:22:14 1996 Tom Tromey <tromey@creche.cygnus.com>
+ * mkinstalldirs (errstatus): Don't necessarily die if mkdir
+ fails.
+
* automake.in (handle_source_transform): Typo fix.
Thu Apr 4 15:10:50 1996 Tom Tromey <tromey@creche.cygnus.com>
AC_CONFIG_AUX_DIR.
* Removed DIST_SUBDIRS, DIST_OTHER
* AC_ARG_PROGRAM only required when an actual program exists
-* dist-local target now run before distribution packaged up; idea from
- Dieter Baron.
+* dist-hook target now run before distribution packaged up; idea from
+ Dieter Baron. Other hooks exist, too.
* Preliminary (unfinished) support for libtool
\f
New in 0.31:
* Fix all mkinstalldirs invocations
* Add support for libtool
* At top level, config.h is not depended on...
-* Rename dist-local -> dist-hook
-* Add install-data-hook, install-exec-hook
* Must look for/enforce existence of stamp-h.in in srcdir?
+ ... there is something broken here...
* Should be a way to have "nobuild_PROGRAMS" which aren't even built,
but which could be by running the magic make command.
* Rewrite clean targets.
* Must rewrite error handling code. Right now it is a real mess
Should fix up require_file junk at the same time
-* Add EXTRA_prog_SOURCES, for eg Apache
Things to finish libtool support:
* Handle grody compilation issue
Think about ways to make automake fit better with Cygnus-style trees.
-Omit program transform vars from header if no program installed. This
-is currently pretty hard to do.
-
Use recode in dist target when MAINT_CHARSET specified. Read caveats
in automake.in before doing this. Note the same problem used to apply
to the no-dependencies option; maybe it still should? Note also that
* regularize how backslash-newline is done. Just one space between text
and backslash should be the rule. Update makefile-mode to allow this.
(set column to 0, probably)
+Omit program transform vars from header if no program installed. This
+is currently pretty hard to do. (But with beautification code it
+would probably be easy)
It should be possible to have ansi2knr in just one place in a package.
Jim Meyering says just rely on configure to make links as appropriate.
local ($objpat) = $obj;
$objpat =~ s/(\W)/\\$1/g;
- # Look for file_SOURCES and file_OBJECTS.
- if (defined $contents{$one_file . "_SOURCES"})
+ if (defined $contents{$one_file . "_OBJECTS"})
{
- if (! defined $contents{$one_file . "_OBJECTS"})
+ &am_line_error ($one_file . '_OBJECTS',
+ $one_file . '_OBJECTS', 'should not be defined');
+ # No point in continuing.
+ return;
+ }
+
+ local ($source_list);
+ local ($prefix);
+ foreach $prefix ('', 'EXTRA_')
+ {
+ $source_list = '';
+ if (defined $contents{$prefix . $one_file . "_SOURCES"})
+ {
+ push (@sources, '$(' . $prefix . $one_file . "_SOURCES)");
+ push (@objects, '$(' . $prefix . $one_file . "_OBJECTS)")
+ unless $prefix eq 'EXTRA_';
+ $source_list = $contents{$prefix . $one_file . "_SOURCES"};
+ }
+ elsif ($prefix eq '')
+ {
+ $output_vars .= ($one_file . "_SOURCES = " . $one_file . ".c\n"
+ . $one_file . "_OBJECTS = ". $one_file
+ . $obj . "\n");
+ push (@sources, $one_file . '.c');
+ push (@objects, $one_file . $obj);
+ $source_list = $one_file . ".c ";
+ }
+ else
+ {
+ $output_vars .= "EXTRA_" . $one_file . "_SOURCES =\n";
+ }
+
+ if ($source_list)
{
# Turn sources into objects.
- local (@files) = split (/\s+/, $contents{$one_file . "_SOURCES"});
+ local (@files) = split (/\s+/, $source_list);
local (@result) = ();
foreach (@files)
{
s/\.cc$/$obj/g;
s/\.cxx$/$obj/g;
s/\.[cCmylfs]$/$obj/g;
- push (@result, $_);
+ push (@result, $_)
+ unless $prefix eq 'EXTRA_';
# Transform .o or $o file into .P file (for automatic
# dependency code).
$dep_files{'$(srcdir)/.deps/' . $_} = 1;
}
- &pretty_print ($one_file . "_OBJECTS =", "", @result);
- }
- else
- {
- &am_line_error ($one_file . '_OBJECTS',
- $one_file . '_OBJECTS', 'should not be defined');
+ &pretty_print ($one_file . "_OBJECTS =", "", @result)
+ unless $prefix eq 'EXTRA_';
}
-
- push (@sources, '$(' . $one_file . "_SOURCES)");
- push (@objects, '$(' . $one_file . "_OBJECTS)");
- }
- else
- {
- $output_vars .= ($one_file . "_SOURCES = " . $one_file . ".c\n"
- . $one_file . "_OBJECTS = ". $one_file
- . $obj . "\n");
- push (@sources, $one_file . '.c');
- push (@objects, $one_file . $obj);
- $dep_files{'$(srcdir)/.deps/' . $one_file . '.P'} = 1;
}
if (defined $contents{'CONFIG_HEADER'})
';
}
- # If the target `dist-local' exists, run it now. This allows
+ # If the target `dist-hook' exists, run it now. This allows
# users to do random weird things to the distribution before it is
# packaged up.
- if (defined $contents{'dist-local'})
+ if (defined $contents{'dist-hook'})
{
- $output_rules .= "\t\$(MAKE) dist-local\n";
+ $output_rules .= "\t\$(MAKE) dist-hook\n";
}
# Finalize.
# Step three: print definitions users can use.
$output_rules .= ("install-exec: "
. join (' ', @install_exec)
- . "\n\n");
+ . "\n");
+ if (defined $contents{'install-exec-hook'})
+ {
+ $output_rules .= "\t" . '$(MAKE) install-exec-hook' . "\n";
+ }
+ $output_rules .= "\n";
push (@install, 'install-exec') if !$recursive_install;
push (@phony, 'install-exec');
$output_rules .= ("install-data: "
. join (' ', @install_data)
- . "\n\n");
+ . "\n");
+ if (defined $contents{'install-data-hook'})
+ {
+ $output_rules .= "\t" . '$(MAKE) install-data-hook' . "\n";
+ }
+ $output_rules .= "\n";
push (@install, 'install-data') if !$recursive_install;
push (@phony, 'install-data');
@vindex EXTRA_DIST
Occasionally it is useful to be able to change the distribution before
-it is packaged up. If the @code{dist-local} target exists, it is run
+it is packaged up. If the @code{dist-hook} target exists, it is run
after the distribution directory is filled, but before the actual tar
(or shar) file is created. One way to use this is for distributing file
in subdirectories for which a new @file{Makefile.am} is overkill:
@example
-dist-local:
+dist-hook:
mkdir $(distdir)/random
cp -p random/a1 random/a2 $(distdir)/random
@end example
$(INSTALL_DATA) $(srcdir)/afile /etc/afile
@end example
+Some targets also have a way to run another target, called a @dfn{hook},
+after their work is done. The hook is named after the principal target,
+with @samp{-hook} appended. The targets allowing hooks are
+@code{install-data}, @code{install-exec}, and @code{dist}.
+@trindex install-data-hook
+@trindex install-exec-hook
+@trindex dist-hook
+
+For instance, here is how to create a hard link to an installed program:
+
+@example
+install-exec-hook:
+ $(LN) $(bindir)/program $(bindir)/proglink
+@end example
+
@c FIXME should include discussion of variables you can use in these
@c rules
if test ! -d "$pathcomp"; then
echo "mkdir $pathcomp" 1>&2
- mkdir "$pathcomp" || errstatus=$?
+ mkdir "$pathcomp" > /dev/null 2>&1 || lasterr=$?
+ fi
+
+ if test ! -d "$pathcomp"; then
+ errstatus=$lasterr
fi
pathcomp="$pathcomp/"
if test ! -d "$pathcomp"; then
echo "mkdir $pathcomp" 1>&2
- mkdir "$pathcomp" || errstatus=$?
+ mkdir "$pathcomp" > /dev/null 2>&1 || lasterr=$?
+ fi
+
+ if test ! -d "$pathcomp"; then
+ errstatus=$lasterr
fi
pathcomp="$pathcomp/"
-@set UPDATED 28 March 1996
+@set UPDATED 4 April 1996
@set EDITION 0.32
@set VERSION 0.32