在Tornado 2.2 下为vxworks5.5编译和链接ccmath的库
shell script
输入输出重定向
>,<这两个分别是输出重定向和输入重定向操作符。
两边都是文件描述符,默认值是1,standard output,其他两个常用的分别是0,standard input 和 2,standard error。
比如我们平时在linux下编译程序
$make,然后就会输出一些编译的信息。
如果你想把它导入到一个文件里,可以$ make > make_result,这就是把本应输出到stdout上面的信息输出到文件make_result里面。不过这个>,还是有些不同的用法的。
1、$make >> make_result,这是append的效果。
2、$make > make_result 2>&1 ,这样可以把stdout 和 stderr的输出合并输出到文件中。更好的写法是这样:
$make &> make_result
因为如果你记错了,写成:
$make 2>&1 make_result 则只会将stderr的输出写到文件中,因为这样写是相当于把文件描述符2做了个拷贝,1,然后再输出到make_result当中。
#! /bin/sh
# CCM Library compilation script
# run from distribution directory: 'makelibs_vxw.sh'
# When installing on an Intel based platform
# respond with y to the prompt
# otherwise abort and run the 'non_intel.sh' script first.
# Then run 'makelibs.sh' and respond with n at this prompt.
LST="cfit complex fft geom intg matrix roots sfunc simu sort statf tseries util xarm" #subdirectorys
MDR=`pwd`
LSOD=$MDR/tmp
TOR_FLAGS="-O3 -g -mcpu=pentium -march=pentium -nostdlib -fno-builtin -fno-defer-pop -I.\
-ID:/Tornado2.2/target/h -ID:/Tornado2.2/target/h/sys\
-DCPU=PENTIUM -DTOOL_FAMILY=gnu -DTOOL=gnu -DVXWORKS -c"
for dir in $LST
do
cd $MDR/$dir
echo `pwd`
ccpentium $TOR_FLAGS *.c
mv *.o $LSOD
done
# Compile corrected svd QR support without optimizing
# The GNU optimizer destroys the fix!
cd $MDR/matrix
ccpentium $TOR_FLAGS qrb*.c
mv *.o $LSOD
cd $MDR
cd $MDR/matrix
ccpentium $TOR_FLAGS solv.s
mv *.o $LSOD
cd $MDR/simu
ccpentium $TOR_FLAGS *.s
mv *.o $LSOD
cd $LSOD
arpentium -r libccm.a *.o
#ldpentium -shared -o libccm.o *.o
rm *.o
浙公网安备 33010602011771号