1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46
|
#!/bin/bash
#This script is used to re-create the Makefile.am using ccbuild
# and then run allt the necessary autotools. Configure.in should
# be edited separately.
#
# This file is part of ccbuild.
# ccbuild is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
# ccbuild 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 ccbuild. If not, see <http://www.gnu.org/licenses/>.
if [ "x$1" = "xclean" ]; then
echo Cleaning
rm -rf CMakeFiles
exit
fi
## Generate Makefile.am from ccbuild
PSOURCE=src/ccbuild.cc
PNAME=`basename "${PSOURCE}" .cc`
echo "Updating MD5SUMS file"
which ccbuild && (ccbuild md5 --recursive-include . "${PSOURCE}" > MD5SUMS)
SOURCES=`egrep .cc$ MD5SUMS | sed -r 's/^[a-z0-9]+ //; s/ /\\ /' | tr '\n' ' '`
VERSION=`egrep -o 'VERSION=.+"[0-9.]+' src/ccResolutions |cut -d '"' -f 2`
#Write CMakeLists.txt
cat > CMakeLists.txt <<EOF
cmake_minimum_required (VERSION 2.6)
project (ccbuild)
add_definitions(-DVERSION="${VERSION}")
link_libraries(gomp bobcat gnutls)
add_definitions(-fopenmp)
add_executable(ccbuild ${SOURCES})
install(TARGETS ccbuild DESTINATION bin)
install(FILES doc/ccbuild/ccbuild.1 DESTINATION share/man/man1)
EOF
|