Root/scripts/dcm2desc

Source at commit dc5ce7a31aedb968753878e2cbaa857ffd79c5c8 created 10 years 6 months ago.
By Werner Almesberger, components/aat1217.lib: Skyworks AAT1217 step-up converter
1#!/bin/sh
2#
3# dcm2desc - Convert .dcm files to genex descriptions
4#
5# Copyright 2012 by Werner Almesberger
6#
7# This program is free software; you can redistribute it and/or modify
8# it under the terms of the GNU General Public License as published by
9# the Free Software Foundation; either version 2 of the License, or
10# (at your option) any later version.
11#
12
13
14usage()
15{
16    echo "usage: $0 [-L libdir ...] [-l lib ...]" 1>&2
17    exit 1
18}
19
20
21scan_dcm()
22{
23    for n in "$@"; do
24        sed -e '/^\$CMP /{s///;x;}' \
25            -e '/^[DKF] /{s///;x;G;s/\n/: /;p;s/: .*//;x;}' \
26            -e d <"$n"
27    done
28}
29
30
31while [ "$1" ]; do
32    case "$1" in
33    -L) shift
34        [ "`echo \"$1\"/*.dcm`" != "$1/*.dcm" ] &&
35            scan_dcm "$1"/*.dcm;;
36    -l) shift
37        scan_dcm "$1";;
38    -*) usage;;
39    *) usage;;
40    esac
41    shift
42done
43
44exit 0
45

Archive Download this file

Branches:
master



interactive