##// END OF EJS Templates
SD card Library started, SDCARD init and detection OK
SD card Library started, SDCARD init and detection OK

File last commit:

r9:4ce02a06b2a6 default
r11:798f00e676fa default
Show More
functions
120 lines | 4.0 KiB | text/plain | TextLexer
Libuc make templates extracted from main script, to make it more modular
r7 #!/bin/bash
#/*------------------------------------------------------------------------------
#-- This file is a part of the libuc, microcontroler library
#-- Copyright (C) 2011, Alexis Jeandet
#--
#-- This program 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.
#--
#-- 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, write to the Free Software
#-- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#-------------------------------------------------------------------------------
#-- Author : Alexis Jeandet
#-- Mail : alexis.jeandet@gmail.com
#-------------------------------------------------------------------------------*/
function getFilesList {
sed ':a;N;$!ba;s/\\\n/ /g' $1 | sed ':a;N;$!ba;s/\\ \n/ /g' | grep -i $2 | sed 's/\t//g'
}
function Template {
TEMPLATE=`more $1 | grep -i "TEMPLATE " | sed s/TEMPLATE// | sed s/=// | sed 's/^[ \t]*//;s/[ \t]*$//'`
}
function Arch {
Multi target feature added, It's now possible to generate differents outputs from the same inputs files with differents options...
r9 if [ -z "$2" ] ; then
ARCH=`more $1 | grep -i "ARCH " | sed s/ARCH// | sed s/=// | sed 's/^[ \t]*//;s/[ \t]*$//'`
else
ARCH=`more $1 | grep -i "$2.ARCH " | sed s/$2'\.'ARCH// | sed s/=// | sed 's/^[ \t]*//;s/[ \t]*$//'`
fi
Libuc make templates extracted from main script, to make it more modular
r7 }
function Target {
Multi target feature added, It's now possible to generate differents outputs from the same inputs files with differents options...
r9 if [ -z "$2" ] ; then
TARGET=`more $1 | grep -i "TARGET " | sed s/TARGET// | sed s/=// | sed 's/^[ \t]*//;s/[ \t]*$//'`
else
TARGET=`more $1 | grep -i "$2.TARGET " | sed s/$2'\.'TARGET// | sed s/=// | sed 's/^[ \t]*//;s/[ \t]*$//'`
fi
}
function Targets {
TARGETS=`more $1 | grep -i ".SOURCES" | sed 's/\.SOURCES.*//'`
Libuc make templates extracted from main script, to make it more modular
r7 }
function Libs_Inc {
Multi target feature added, It's now possible to generate differents outputs from the same inputs files with differents options...
r9 if [ -z "$2" ] ; then
INCLUDEStmp=`more $1 | grep -i "LIBS " | sed s/LIBS// |sed s/+//|sed s/=//| sed 's/^[ \t]*//;s/[ \t]*$//'`
for FILES in $INCLUDEStmp
do
INCLUDES+='$('"LIBUC_INC_DIR_""$FILES""_CMD) "
done
else
INCLUDEStmp=`more $1 | grep -i "$2.LIBS " | sed s/$2'\.'LIBS// |sed s/+//|sed s/=//| sed 's/^[ \t]*//;s/[ \t]*$//'`
for FILES in $INCLUDEStmp
do
INCLUDES+='$('"LIBUC_INC_DIR_""$FILES""_CMD) "
done
fi
Libuc make templates extracted from main script, to make it more modular
r7 }
Multi target feature added, It's now possible to generate differents outputs from the same inputs files with differents options...
r9
Libuc make templates extracted from main script, to make it more modular
r7 function Libs_Link {
Multi target feature added, It's now possible to generate differents outputs from the same inputs files with differents options...
r9 if [ -z "$2" ] ; then
LIBRARIEStmp=`more $1 | grep -i "LIBS " | sed s/LIBS// |sed s/+//|sed s/=//| sed 's/^[ \t]*//;s/[ \t]*$//'`
for FILES in $LIBRARIEStmp
do
LIBRARIES+='$('"LIBUC_LIBS_DIR_""$FILES""_CMD) "'$('"LIBUC_LIBS_$FILES) "
done
else
LIBRARIEStmp=`more $1 | grep -i "$2.LIBS " | sed s/$2'\.'LIBS// |sed s/+//|sed s/=//| sed 's/^[ \t]*//;s/[ \t]*$//'`
for FILES in $LIBRARIEStmp
do
LIBRARIES+='$('"LIBUC_LIBS_DIR_""$FILES""_CMD) "'$('"LIBUC_LIBS_$FILES) "
done
fi
Libuc make templates extracted from main script, to make it more modular
r7 }
function HeadersInstallPath {
Multi target feature added, It's now possible to generate differents outputs from the same inputs files with differents options...
r9 if [ -z "$2" ] ; then
HEADERSINSTALLPATH=`more $1 | grep -i "HEADERSINSTALLPATH" | sed s/HEADERSINSTALLPATH// | sed s/=// | sed 's/^[ \t]*//;s/[ \t]*$//'`
else
HEADERSINSTALLPATH=`more $1 | grep -i "$2.HEADERSINSTALLPATH" | sed s/$2'\.'HEADERSINSTALLPATH// | sed s/=// | sed 's/^[ \t]*//;s/[ \t]*$//'`
fi
Libuc make templates extracted from main script, to make it more modular
r7 }
function TargetInstallPath {
Multi target feature added, It's now possible to generate differents outputs from the same inputs files with differents options...
r9 if [ -z "$2" ] ; then
TARGETINSTALLPATH=`more $1 | grep -i "TARGETINSTALLPATH" | sed s/TARGETINSTALLPATH// | sed s/=// | sed 's/^[ \t]*//;s/[ \t]*$//'`
else
TARGETINSTALLPATH=`more $1 | grep -i "$2.TARGETINSTALLPATH" | sed s/$2'\.'TARGETINSTALLPATH// | sed s/=// | sed 's/^[ \t]*//;s/[ \t]*$//'`
fi
Libuc make templates extracted from main script, to make it more modular
r7 }
function getBSP {
Multi target feature added, It's now possible to generate differents outputs from the same inputs files with differents options...
r9 if [ -z "$2" ] ; then
if(more $1 | grep -i "BSP ="); then
BSP=`more $1 | grep -i "BSP" | sed s/BSP// | sed s/=// | sed 's/^[ \t]*//;s/[ \t]*$//'`
fi
else
if(more $1 | grep -i "$2.BSP ="); then
BSP=`more $1 | grep -i "$2.BSP" | sed s/$2'\.'BSP// | sed s/=// | sed 's/^[ \t]*//;s/[ \t]*$//'`
fi
fi
Libuc make templates extracted from main script, to make it more modular
r7
}
Multi target feature added, It's now possible to generate differents outputs from the same inputs files with differents options...
r9