Commit c908c2bc authored by Leonardo Solis's avatar Leonardo Solis

added script lic preamble

parent b8cc0f62
#!/bin/bash
# Copy license preamble to all OCLADock source and header files
# if license preamble is not present
# license preamble
LICENSE_PREAMBLE="./preamble_license"
# kernel-header files
KRNL_HEADER_DIR="./common"
KRNL_HEADERS="$KRNL_HEADER_DIR/*.h"
# kernel-source files
KRNL_SOURCE_DIR="./device"
KRNL_SOURCES="$KRNL_SOURCE_DIR/*.cl"
# host-header files
HOST_HEADER_DIR="./host/inc"
HOST_HEADERS="$HOST_HEADER_DIR/*.h"
# host-source files
HOST_SOURCE_DIR="./host/src"
HOST_SOURCES="$HOST_SOURCE_DIR/*.cpp"
# full list of source files
#OCLADOCK_SOURCE="$KRNL_HEADER_DIR/*.h $KRNL_SOURCE_DIR/*.cl $HOST_HEADER_DIR/*.h $HOST_SOURCE_DIR/*.cpp"
OCLADOCK_SOURCE="$KRNL_HEADERS $KRNL_SOURCES $HOST_HEADERS $HOST_SOURCES"
# Print variables
#echo $KRNL_HEADER_DIR/*.h
#echo $KRNL_SOURCE_DIR/*.cl
#echo $HOST_HEADER_DIR/*.h
#echo $HOST_SOURCE_DIR/*.cpp
#echo $OCLADOCK_SOURCE
# Add license-preamble
# Excluding sources that already have it, and
# excluding the automatically-generated ./host/inc/stringify.h
for f in $OCLADOCK_SOURCE; do
if [ "$f" != "$HOST_HEADER_DIR/stringify.h" ]; then
if (grep -q "Copyright (C)" $f); then
echo "License-preamble is already present in $f"
echo "No license-preamble is added."
cat $f > $f.oldlic
awk '/^\/\*/{c++} c!=1; /^ \*\//{c++}' "$f" > $f
echo "Done!"
else
echo "Adding license-preamble to $f ..."
cat $LICENSE_PREAMBLE $f > $f.new
cat $f > $f.nolic
mv $f.new $f
echo "Done!"
fi
echo " "
fi
done
/*
OCLADock, an OpenCL implementation of AutoDock 4.2 running a Lamarckian Genetic Algorithm
Copyright (C) 2017 Technische Universitaet Darmstadt, Embedded Systems and Applications Group, Germany. All rights reserved.
......@@ -16,3 +18,7 @@ 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, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment