Upgrade to new build system

This commit is contained in:
Laurence Withers 2006-12-13 21:38:45 +00:00
parent 6a64114854
commit a24c6ae302
8 changed files with 62 additions and 43 deletions

3
README
View File

@ -9,6 +9,7 @@ Really Quick Instructions
To build: ./make.sh To build: ./make.sh
To install: ./make.sh install To install: ./make.sh install
(you might want to set PREFIX, by default it's /usr/local)
You might want to edit 'config' first.
@TODO@ @TODO@

19
config Normal file
View File

@ -0,0 +1,19 @@
# libiso8601/config
# kate: replace-trailing-space-save true; space-indent true; tab-width 4;
# vim: expandtab:ts=4:sw=4
#
# (c)2006, Laurence Withers, <l@lwithers.me.uk>.
# Released under the GNU GPLv2. See file COPYING or
# http://www.gnu.org/copyleft/gpl.html for details.
#
# This file contains options used to build libiso8601.
#
[ -z "${PREFIX}" ] && PREFIX="/usr/local"
[ -z "${CC}" ] && CC="gcc"
[ -z "${CFLAGS}" ] && CFLAGS="-g -O2 -W -Wall"
[ -z "${BINDIR}" ] && BINDIR="${PREFIX}/bin"
[ -z "${LIBDIR}" ] && LIBDIR="${PREFIX}/lib"
[ -z "${INCLUDEDIR}" ] && INCLUDEDIR="${PREFIX}/include"
[ -z "${FINALLIBDIR}" ] && FINALLIBDIR="${LIBDIR}"
[ -z "${FINALINCLUDEDIR}" ] && FINALINCLUDEDIR="${INCLUDEDIR}"

28
make.sh
View File

@ -8,25 +8,14 @@
# This file is the script used to build libiso8601. There are some # This file is the script used to build libiso8601. There are some
# options that can be edited; these are set below (or you can pass them # options that can be edited; these are set in the file 'config' (or you
# in as variables). # can pass them in as environment variables).
[ -z "${CC}" ] && CC="gcc" if [ ! -e "config" ]
[ -z "${CXX}" ] && CXX="g++" then
[ -z "${CFLAGS}" ] && CFLAGS="-g -O2 -W -Wall" echo "Configuration file not found???"
[ -z "${PREFIX}" ] && PREFIX="/usr/local" exit 1
[ -z "${LIBDIR}" ] && LIBDIR="${PREFIX}/lib" fi
[ -z "${BINDIR}" ] && BINDIR="${PREFIX}/bin" source "config" # don't fail on error, since last command in config might return false
[ -z "${INCLUDEDIR}" ] && INCLUDEDIR="${PREFIX}/include"
[ -z "${DOCSDIR}" ] && DOCSDIR="${PREFIX}/share/doc/libiso8601"
# for pkg-config
[ -z "${PKGCONFDIR}" ] && PKGCONFDIR="${LIBDIR}/pkgconfig"
[ -z "${FINALLIBDIR}" ] && FINALLIBDIR="${LIBDIR}"
[ -z "${FINALINCLUDEDIR}" ] && FINALINCLUDEDIR="${INCLUDEDIR}"
# for SDCC-built firmware
[ -z "${HEXDIR}" ] && HEXDIR="${PREFIX}/share/firmware"
[ -z "${SDCC}" ] && SDCC="sdcc"
@ -272,6 +261,7 @@ do
echo "Cleaning..." echo "Cleaning..."
rm -rf ${OUTPUT_DIRS} rm -rf ${OUTPUT_DIRS}
print_success "Done" print_success "Done"
true
;; ;;
# bad Kdevelop! bad! # bad Kdevelop! bad!

21
scripts/.gitignore vendored
View File

@ -1,12 +1,13 @@
build.c++.app build.app.c
build.c++.lib build.app.c++
build.c++.qtapp build.app.c++-qt
build.c++.tests build.docs.doxygen
build.c.app build.files.none
build.c.lib build.firmware.gpasm
build.c.tests build.firmware.sdcc
build.doxygen.docs build.lib.c
build.none.files build.lib.c++
build.sdcc.firmware build.tests.c
build.tests.c++
module-create.sh module-create.sh
release.sh release.sh

View File

@ -1 +1 @@
c lib libiso8601 iso8601.h lib c libiso8601 iso8601.h

View File

@ -2,7 +2,7 @@ build_target libiso8601
# make paths (this is for Gentoo in particular) # make paths (this is for Gentoo in particular)
build_dir_tree "${LIBDIR}" || return 1 build_dir_tree "${LIBDIR}" || return 1
build_dir_tree "${PKGCONFDIR}" || return 1 build_dir_tree "${BINDIR}" || return 1
build_dir_tree "${INCLUDEDIR}" || return 1 build_dir_tree "${INCLUDEDIR}" || return 1
# install library # install library
@ -20,16 +20,20 @@ install_symlink "${BASE}" "${MAJOR}" "${LIBDIR}"
echo "Installing header file '${libiso8601_HEADER}' into ${INCLUDEDIR}" echo "Installing header file '${libiso8601_HEADER}' into ${INCLUDEDIR}"
install_header ${libiso8601_HEADER} ${INCLUDEDIR} 0644 || return 1 install_header ${libiso8601_HEADER} ${INCLUDEDIR} 0644 || return 1
# install pkgconfig file # install config script
echo "Installing package config file into ${PKGCONFDIR}" echo "Installing config script into ${BINDIR}"
PKGCONFFILE=${PKGCONFDIR}/libiso8601.pc CONFFILE="${BINDIR}/libiso8601-config"
do_cmd rm -f ${PKGCONFFILE}
do_cmd_redir ${PKGCONFFILE} sed \ do_cmd rm -f "${CONFFILE}"
do_cmd_redir "${CONFFILE}" sed \
-e "s,@VERSION@,${VERSION}," \ -e "s,@VERSION@,${VERSION}," \
-e "s,@LIBDIR@,${FINALLIBDIR}," \ -e "s,@DEP_CFLAGS@,${libiso8601_DEP_CFLAGS}," \
-e "s,@INCLUDEDIR@,${FINALINCLUDEDIR}," \ -e "s,@DEP_LIBS@,${libiso8601_DEP_LIBS}," \
src/libiso8601/pkgconf.in -e "s,@LIB_DIR@,${FINALLIBDIR}," \
do_cmd chmod 0644 ${PKGCONFFILE} -e "s,@INCLUDE_DIR@,${FINALINCLUDEDIR}," \
src/libiso8601/config-script
do_cmd chmod 0755 "${CONFFILE}"
print_success "Done" print_success "Done"
# kate: replace-trailing-space-save true; space-indent true; tab-width 4; # kate: replace-trailing-space-save true; space-indent true; tab-width 4;

View File

@ -3,6 +3,8 @@
# libiso8601_BUILT # libiso8601_BUILT
# libiso8601_HEADER # libiso8601_HEADER
# libiso8601_BASE # libiso8601_BASE
# libiso8601_DEP_CFLAGS
# libiso8601_DEP_LIBS
if [ -z ${libiso8601_BUILT} ] if [ -z ${libiso8601_BUILT} ]
then then
@ -10,7 +12,9 @@ then
source src/libiso8601/soversion source src/libiso8601/soversion
libiso8601="obj/${libiso8601_BASE}.so.${SOMAJOR}.${SOMINOR}.${SOMICRO}" libiso8601="obj/${libiso8601_BASE}.so.${SOMAJOR}.${SOMINOR}.${SOMICRO}"
SO_EXTRA="-lrt -lc" libiso8601_DEP_CFLAGS=""
libiso8601_DEP_LIBS=""
SO_EXTRA="${libiso8601_DEP_CFLAGS} ${libiso8601_DEP_LIBS} -lrt -lc"
echo "Building library ${libiso8601}..." echo "Building library ${libiso8601}..."

View File

@ -1 +1 @@
c tests tests libiso8601 tests c tests libiso8601