maketablelist.sh
1.07 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#! /bin/sh
# Copyright (C) 2009, 2010 Christian Egli
# Copying and distribution of this file, with or without modification,
# are permitted in any medium without royalty provided the copyright
# notice and this notice are preserved. This file is offered as-is,
# without any warranty.
# Use this script to regenerate Makefile.am if you must. I recommend
# against it for the reasons explained in
# http://www.gnu.org/software/hello/manual/automake/Wildcards.html.
# It's easy to pick up some spurious files that you did not mean to
# distribute.
OUTFILE=Makefile.am.new
(
cat <<'EOF'
# generate the list of tables as follows:
# $ ls | grep -v Makefile | grep -v README | grep -v maketablelist.sh | grep -v '.*~$' | sort | sed -e 's/$/ \\/' -e 's/^/\t/' | head --bytes=-2
table_files = \
EOF
) > $OUTFILE
ls | grep -v Makefile | grep -v README | grep -v maketablelist.sh | grep -v '.*~$' | sort | sed -e 's/$/ \\/' -e 's/^/\t/' | head --bytes=-2 >> $OUTFILE
(
cat <<'EOF'
tablesdir = $(datadir)/liblouis/tables
tables_DATA = $(table_files)
EXTRA_DIST = $(table_files)
EOF
) >> $OUTFILE