source: trunk/kBuild/gnumake-append.sh@ 889

Last change on this file since 889 was 818, checked in by bird, 18 years ago

drop the set -x

  • Property svn:executable set to *
File size: 1.6 KB
RevLine 
[815]1#/bin/sh
2
3# $Id: $
4## @file
5#
6# kmk_append fake script for bootstrapping.
7#
8# Copyright (c) 2007 knut st. osmundsen <bird-src-spam@anduin.net>
9#
10#
11# This file is part of kBuild.
12#
13# kBuild is free software; you can redistribute it and/or modify
14# it under the terms of the GNU General Public License as published by
15# the Free Software Foundation; either version 2 of the License, or
16# (at your option) any later version.
17#
18# kBuild is distributed in the hope that it will be useful,
19# but WITHOUT ANY WARRANTY; without even the implied warranty of
20# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21# GNU General Public License for more details.
22#
23# You should have received a copy of the GNU General Public License
24# along with kBuild; if not, write to the Free Software
25# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
26#
27#
28
29
30set -e
31
[818]32#
[815]33# Parse args.
34#
35NEWLINE=0
36echo "$1"
37while test "$1" = "-n" -o "$1" = "-v" -o "$1" = "-nv" -o "$1" = "-vn";
38do
39 case "$1" in
40 -n)
41 NEWLINE=1
42 ;;
43 *)
44 echo "gnumake-append.sh: Unsupported argument: $1"
45 exit 1;
46 esac
47 shift
48done
49
50FILE="$1"
51if test -z "$FILE"; then
52 echo "gnumake-append.sh: No arguments given."
53 echo "syntax: gnumake-append.sh [-n] <file> [string [more strings]]"
54 exit 1
55fi
56shift
57
58
59#
60# Do work
61#
62if test "$#" -eq "0"; then
63 echo "" >> "$FILE"
64else
65 if test "$NEWLINE" = "0"; then
66 echo "$*" >> "$FILE"
67 else
68 while test "$#" -ne "0";
69 do
70 echo "$1" >> "$FILE"
71 shift
72 done
[818]73 fi
[815]74fi
75exit 0;
76
Note: See TracBrowser for help on using the repository browser.