Patrick Welche <prlw1@cam.ac.uk>
[netbsd-mini2440.git] / external / bsd / atf / dist / admin / generate-makefile.sh
blob6e6f22f25fd506fca2d8aad07a0a6ed72b0d86ef
1 #! /bin/sh
3 # Automated Testing Framework (atf)
5 # Copyright (c) 2009 The NetBSD Foundation, Inc.
6 # All rights reserved.
8 # Redistribution and use in source and binary forms, with or without
9 # modification, are permitted provided that the following conditions
10 # are met:
11 # 1. Redistributions of source code must retain the above copyright
12 # notice, this list of conditions and the following disclaimer.
13 # 2. Redistributions in binary form must reproduce the above copyright
14 # notice, this list of conditions and the following disclaimer in the
15 # documentation and/or other materials provided with the distribution.
17 # THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND
18 # CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
19 # INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
20 # MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
21 # IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS BE LIABLE FOR ANY
22 # DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23 # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
24 # GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
25 # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
26 # IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
27 # OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
28 # IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32 # Generates Makefile.am from a simplified version in M4 version.
35 set -e
37 Prog_Name=${0##*/}
40 # usage
42 usage() {
43 echo "Usage: ${Prog_Name} input output" 1>&2
44 exit 1
48 # main
50 # Entry point.
52 main() {
53 [ ${#} -eq 2 ] || usage
54 input=${1}
55 output=${2}
57 cat >${output}.tmp <<EOF
59 # DO NOT EDIT! DO NOT EDIT! DO NOT EDIT! DO NOT EDIT! DO NOT EDIT!
61 # This file is automatically generated by admin/generate-makefile.sh.
62 # Edit its source version, Makefile.am.m4, instead or your changes will
63 # be lost.
65 # DO NOT EDIT! DO NOT EDIT! DO NOT EDIT! DO NOT EDIT! DO NOT EDIT!
68 EOF
69 ${M4:-m4} -P ${input} | sed -e 's, *$,,g' >>${output}.tmp
70 mv ${output}.tmp ${output}
73 main "${@}"
75 # vim: syntax=sh:expandtab:shiftwidth=4:softtabstop=4