Update "missing" (automake) script to a later version
[geda-pcb/pcjc2.git] / lib / CreateLibrary.sh.in
blob6dd4f3964a8f1c901a1f116bef04da3e066fa471
1 #!/bin/sh
3 # COPYRIGHT
4 #
5 # PCB, interactive printed circuit board design
6 # Copyright (C) 1994,1995,1996 Thomas Nau
7 #
8 # This program is free software; you can redistribute it and/or modify
9 # it under the terms of the GNU General Public License as published by
10 # the Free Software Foundation; either version 2 of the License, or
11 # (at your option) any later version.
13 # This program is distributed in the hope that it will be useful,
14 # but WITHOUT ANY WARRANTY; without even the implied warranty of
15 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 # GNU General Public License for more details.
18 # You should have received a copy of the GNU General Public License
19 # along with this program; if not, write to the Free Software
20 # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
22 # Contact addresses for paper mail and Email:
23 # Thomas Nau, Schlehenweg 15, 88471 Baustetten, Germany
24 # Thomas.Nau@rz.uni-ulm.de
27 # creates a library
29 # usage: CreateContents.sh library common_macro_file file...
31 M4=@GNUM4@
33 while test -n "$1" ; do
34 case "$1"
36 -I|--include)
37 m4_flags="$m4_flags -I $2"
38 shift 2
41 -*)
42 echo "error: unknown flag $1 to $0"
43 exit 1
47 break
49 esac
50 done
52 if [ $# -lt 3 ]; then
53 echo "usage: $0 library common_macro_file file..." >&2; exit 1
55 Library=$1
56 CommonFile=$2
57 shift; shift
59 if [ ! -r $CommonFile ]; then
60 echo "$0: file '$CommonFile' isn't readable or doesn't exit" >&2; exit 1
63 echo "$M4 $m4_flags -F $Library $CommonFile $@"
64 $M4 $m4_flags -F $Library $CommonFile $@