From: Hugo Villeneuve Date: Sat, 23 Aug 2014 22:03:00 +0000 (-0400) Subject: Add targets definition files X-Git-Url: http://gitweb.hugovil.com/?a=commitdiff_plain;h=59a2acf7509c2ddf54b9cf62eced739b11541ed9;p=hvlinux.git Add targets definition files Clean code to configure OS, architecture and ABI --- diff --git a/functions/main b/functions/main index 357eb19..b92bf26 100644 --- a/functions/main +++ b/functions/main @@ -94,34 +94,15 @@ DEFAULT_IPKG_SCRIPT="ipkg.def" HVMAKE="make -j ${MAKEJOBS}" -case "${HVL_TARGET}" in - arm926*) - CLFS_BUILDFLAGS="-mabi=aapcs-linux -mfloat-abi=soft" - CLFS_TARGET="arm-linux-gnueabi" - CLFS_ARCH=arm - ;; - "x86_64") - CLFS_BUILDFLAGS="-m64" - CLFS_TARGET="${HVL_TARGET}-unknown-linux-gnu" - CLFS_ARCH=${HVL_TARGET} - ;; - "x86") - # No special flags - CLFS_BUILDFLAGS="" - CLFS_TARGET="i686-unknown-linux-gnu" - CLFS_ARCH=${HVL_TARGET} - ;; - m68k*) - #CLFS_BUILDFLAGS="-mcpu=51jm" - CLFS_BUILDFLAGS="" - CLFS_TARGET="${HVL_TARGET}-unknown-linux-gnu" - CLFS_ARCH=${HVL_TARGET} - ;; - *) - echo "Unsupported target architecture: ${HVL_TARGET}" - return ${EXIT_FAILURE} - ;; -esac +# Load default values. They can be overriden +# by a target-specific file +source ../targets/default + +if [ -f ../targets/${HVL_TARGET} ]; then + source ../targets/${HVL_TARGET} +fi + +CLFS_TARGET="${CLFS_ARCH}-${CLFS_OS}-${CLFS_ABI}" CLFS_HOST="$(echo $MACHTYPE | \ sed "s/$(echo $MACHTYPE | cut -d- -f2)/cross/")" diff --git a/targets/arm926ejs b/targets/arm926ejs new file mode 100644 index 0000000..bade0e1 --- /dev/null +++ b/targets/arm926ejs @@ -0,0 +1,6 @@ +#!/bin/bash + +CLFS_BUILDFLAGS="-mabi=aapcs-linux -mfloat-abi=soft" +CLFS_ARCH=arm +CLFS_ABI="gnueabi" + diff --git a/targets/default b/targets/default new file mode 100644 index 0000000..a2be344 --- /dev/null +++ b/targets/default @@ -0,0 +1,6 @@ +#!/bin/bash + +CLFS_BUILDFLAGS="" +CLFS_ARCH=${HVL_TARGET} +CLFS_OS="linux" +CLFS_ABI="gnu" diff --git a/targets/m68k b/targets/m68k new file mode 100644 index 0000000..6bea319 --- /dev/null +++ b/targets/m68k @@ -0,0 +1,3 @@ +#!/bin/bash + +#CLFS_BUILDFLAGS="-mcpu=51jm" diff --git a/targets/x86 b/targets/x86 new file mode 100644 index 0000000..7a693aa --- /dev/null +++ b/targets/x86 @@ -0,0 +1,3 @@ +#!/bin/bash + + diff --git a/targets/x86_64 b/targets/x86_64 new file mode 100644 index 0000000..739bf95 --- /dev/null +++ b/targets/x86_64 @@ -0,0 +1,5 @@ +#!/bin/bash + +CLFS_BUILDFLAGS="-m64" +CLFS_OS="unknown-linux" +