Commit 79995e43 authored by Niels Möller's avatar Niels Möller
Browse files

Generate the Makefile.am files.

Rev: src/Makefile.am:1.3(DEAD)
Rev: src/Makefile.am.in:1.1
Rev: src/cvs_headers:1.1
Rev: src/make_am:1.1
Rev: src/symmetric/Makefile.am:1.2(DEAD)
Rev: src/symmetric/Makefile.am.in:1.1
Rev: src/symmetric/include/Makefile.am.in:1.1
Rev: src/used_headers:1.1
parent 21d1424f
## Process this file with automake to produce Makefile.in ## Process this file with make_am to produce Makefile.am
SUBDIRS: lib include
CVS_HEADERS: cvs_headers
BODY:
AUTOMAKE_OPTIONS = foreign AUTOMAKE_OPTIONS = foreign
SUBDIRS = lib SUBDIRS = lib include
# To remake all Makefile.am-files, run
#
# ./used_headers . $(SUBDIRS) | ./make_am
#
# You should run this after recompiling, but before making a dist, as
# it uses dependency information to figure out which header files
# should be included in th dist. How to tell this to make?
bin_PROGRAMS = lsh lshd bin_PROGRAMS = lsh lshd
...@@ -17,7 +28,7 @@ common_sources = alist.c atoms.c bignum.c channel.c \ ...@@ -17,7 +28,7 @@ common_sources = alist.c atoms.c bignum.c channel.c \
randomness.c \ randomness.c \
read_data.c read_line.c read_packet.c service.c \ read_data.c read_line.c read_packet.c service.c \
translate_signal.c unpad.c \ translate_signal.c unpad.c \
werror.c write_buffer.c xalloc.c werror.c write_buffer.c xalloc.c
lsh_SOURCES = $(common_sources) lsh.c client.c client_keyexchange.c \ lsh_SOURCES = $(common_sources) lsh.c client.c client_keyexchange.c \
client_password.c client_userauth.c client_password.c client_userauth.c
...@@ -44,5 +55,6 @@ lshd_DEPENDENCIES = @LIBOBJS@ symmetric ...@@ -44,5 +55,6 @@ lshd_DEPENDENCIES = @LIBOBJS@ symmetric
symmetric: symmetric:
(cd lib && $(MAKE) libsymmetric.a) (cd lib && $(MAKE) libsymmetric.a)
EXTRA_DIST = atoms.in process_atoms $(generated_sources) HACKING EXTRA_DIST = atoms.in process_atoms $(generated_sources) HACKING \
$(cvs_headers)
#! /bin/bash
# Extract the names of all header files in this directory (or the
# directory given on the command line) which are known to CVS.
if [ x$1 != x -a -d ''$1 ]; then
cd $1
fi
if [ -d CVS ]; then
sed -f - CVS/Entries <<'EOF' | sort
s%^/\([^/]\+\.h\)/.*$%\1%
t
d
EOF
fi
#! /bin/bash
# This program wants to recieve a list of needed headers on stdin. It
# reads Makefile.am.in and creates Makefile.am.
if [ x$1 != x ]; then
dir=$1
top=n0
else
dir=.
top=yes
fi
echo 1>&2 "make_am: dir='$dir'"
# Input file on fd 3
if [ -f $dir/Makefile.am.in ]; then
exec 3<$dir/Makefile.am.in
else
# echo 1>&2 "make_am: No Makefile.am.in in $dir"
exit 0
fi
# Output file on fd 4
exec 4>$dir/Makefile.am
echo 1>&4 '##' "Automatically generated by make_am, `date`"
echo 1>&4 '##' "Process this file with automake to produce Makefile.in"
echo 1>&4
function get_header() {
keyword=''
while [ x$keyword = x ]; do
read <&3 keyword args
if [ $? != 0 ]; then
echo 1>&2 "make_am: Unexpected end of file"
exit 1
fi
case $keyword in
\#*)
keyword=''
;;
*:)
keyword=`echo $keyword | sed 's/^\(.*\):$/\1/'`
;;
esac ;
done
echo "get_header: '$keyword'"
}
# Run commands with the same data on stdin
commands=""
function add_command {
commands="$commands tee >($1 ; cat >/dev/null) |"
}
function run_commands {
echo 1>&2 "run_commands: $commands cat >/dev/null"
/bin/bash -c "$commands cat >/dev/null"
}
subdirs=''
while true; do
get_header;
case $keyword in
CVS_HEADERS)
add_command "(echo $args=\\\\;
comm -12 - <(./cvs_headers $dir) | sed 's/\$/ \\\\/';
echo) 1>&4"
;;
SUBDIRS)
subdirs=$args
echo 1>&4 "SUBDIRS = $args"
for d in $args; do
add_command "$0 $dir/$d"
done
;;
BODY)
if [ $top = yes ]; then
exec <(./used_headers . $subdirs)
fi
run_commands && cat <&3 >&4
exit 0
;;
*)
echo 1>&2 "make_am: Unknown keyword '$keyword'"
exit 1
;;
esac
done
## Process this file with automake to produce Makefile.in ## Process this file with make_am to produce Makefile.am
CVS_HEADERS: EXTRA_DIST
BODY:
AUTOMAKE_OPTIONS = foreign AUTOMAKE_OPTIONS = foreign
......
## Process this file with make_am to produce Makefile.am
CVS_HEADERS: EXTRA_DIST
BODY:
#! /bin/bash
# Extracts the names of all header files mentioned in the dependency
# files. Headers with absolute paths are ignored, leading directories
# of relative file names are deleted.
(for d in "$@"; do
if [ -d $d/.deps ]; then
cat $d/.deps/*.P
fi
done) | tr ' ' '\n' \
| grep '^[^/].*\.h$' \
| sed 's%^.*/\([^/]\+\)$%\1%' \
| sort | uniq
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment