comparison extra/ar @ 189:1936ea52b83e

Added 'front-end' script for lwar
author lost
date Sun, 22 Mar 2009 06:52:06 +0000
parents
children 0926c29426f4
comparison
equal deleted inserted replaced
188:bb2665c7005c 189:1936ea52b83e
1 #!/bin/sh
2 #
3 #
4 # Copyright 2009 by William Astle <lost@l-w.ca>
5 #
6 #This file is part of LWTOOLS.
7 #
8 #LWTOOLS is free software: you can redistribute it and/or modify it under the
9 #terms of the GNU General Public License as published by the Free Software
10 #Foundation, either version 3 of the License, or (at your option) any later
11 #version.
12 #
13 #This program is distributed in the hope that it will be useful, but WITHOUT
14 #ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
15 #FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
16 #more details.
17 #
18 #You should have received a copy of the GNU General Public License along with
19 #this program. If not, see <http://www.gnu.org/licenses/>.
20
21 # this was based somewhat on the "ar" script from gcc6809
22
23 # This script is a frontend to the lwar library manager, to make it
24 # look more like GNU ar. Not all ar features are supported here.
25 # It basically translates ar style options into lwar format.
26
27 # Parse and translate command-line options
28
29 # ar options cheatsheet:
30 # r: insert (with replace)
31 # c: create archive
32 # u: only replace newer files
33 # v: verbose mode
34 # x: extract files from archive
35
36 options=$1; shift
37 case $options in
38 rc|cru|-rc|-cru)
39 options="--replace --create"
40 ;;
41 rv)
42 options="--replace"
43 ;;
44 x|-x)
45 options="--extract"
46 ;;
47 *)
48 options="--replace --create $options"
49 if [ "$libname" = "" ]; then
50 libname=$options
51 fi
52 ;;
53 esac
54
55 if [ "x$options" = "x" ]; then
56 echo "ar (m6809): no options given"
57 exit 1
58 fi
59
60 # Run the real lwar with translated options.
61 exec lwar $options $*