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

Last change on this file since 817 was 815, checked in by bird, 18 years ago

Fixed bootstrap problem caused by missing kmk_append.

  • 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
31set -x
32
33#
34# Parse args.
35#
36NEWLINE=0
37echo "$1"
38while test "$1" = "-n" -o "$1" = "-v" -o "$1" = "-nv" -o "$1" = "-vn";
39do
40 case "$1" in
41 -n)
42 NEWLINE=1
43 ;;
44 *)
45 echo "gnumake-append.sh: Unsupported argument: $1"
46 exit 1;
47 esac
48 shift
49done
50
51FILE="$1"
52if test -z "$FILE"; then
53 echo "gnumake-append.sh: No arguments given."
54 echo "syntax: gnumake-append.sh [-n] <file> [string [more strings]]"
55 exit 1
56fi
57shift
58
59
60#
61# Do work
62#
63if test "$#" -eq "0"; then
64 echo "" >> "$FILE"
65else
66 if test "$NEWLINE" = "0"; then
67 echo "$*" >> "$FILE"
68 else
69 while test "$#" -ne "0";
70 do
71 echo "$1" >> "$FILE"
72 shift
73 done
74 fi
75fi
76exit 0;
77
Note: See TracBrowser for help on using the repository browser.