OpenCores
URL https://opencores.org/ocsvn/usb_fpga_1_2/usb_fpga_1_2/trunk

Subversion Repositories usb_fpga_1_2

[/] [usb_fpga_1_2/] [trunk/] [makecopyright] - Rev 2

Go to most recent revision | Compare with Previous | Blame | View Log

#!/bin/sh
#
# makecopyright - put a copyright info into source files
# Copyright (C) 2008-2009 ZTEX e.K., http://www.ztex.de
#

# writes the copyright info to stdout
# $1    short description
# $2    begin of comment
# $3    end of comment
msg () {
echo "$2
   $1
   Copyright (C) 2008-2009 ZTEX e.K.
   http://www.ztex.de

   This program is free software; you can redistribute it and/or modify
   it under the terms of the GNU General Public License version 3 as
   published by the Free Software Foundation.

   This program is distributed in the hope that it will be useful, but
   WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
   General Public License for more details.

   You should have received a copy of the GNU General Public License
   along with this program; if not, see http://www.gnu.org/licenses/.
$3"
}

readonly=no

# copyright info for single file
# $1    file
# $2    short description
# $3    begin of comment
# $4    end of comment
singlefile () {
#    if [ ! -f "$1" -o -f "$1.tmp" ]; then
    if [ ! -f "$1" ]; then
        return
    fi
    echo "$1"
    if [ "$readonly" = "no" ]; then
        mv "$1" "$1.tmp"
        (
            msg "$2" "$3" "$4"
            echo "@@@define[$3][$4
][]" | bmp -mm "@@@" - "$1.tmp"
        ) > "$1"
        rm -f "$1.tmp"
    fi
    echo "$1" >> files.tmp
}


# copyright info for single directory
# $1    dir
# $2    description
singledir () {
    for i in $1/*.pas $1/*.inc; do
        singlefile "$i" "$2" "{*!" "!*}"
    done
    for i in $1/*.c $1/*.h $1/*.java; do
        singlefile "$i" "$2" "/*!" "!*/"
    done
}

rm -f files.tmp

singledir bmp/src "bmp -- babel macro processor"
singledir examples/usb-fpga-1.2/ucecho "ucecho -- example for ZTEX USB FPGA Module 1.2"
singledir include "ZTEX Firmware Kit for EZ-USB Microcontrollers"
#singledir java "Java utilities for the ZTEX Firmware Kit / Driver API"
singledir java "Firmware / Bitstream loader for the ZTEX Firmware Kit"
singledir java/ztex "Java Driver API for the ZTEX Firmware Kit"

files=`cat files.tmp`
wc $files
rm -f files.tmp

Go to most recent revision | Compare with Previous | Blame | View Log

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.