当前位置: 技术问答>linux和unix
各位大侠,谁知道? 如何在makefile 中得到环境变量中路径,100分相送!!!!!
来源: 互联网 发布时间:2015-01-18
本文导语: makefile: TUXDIR = /home/tuxedo APPDIR = /apps/resbrow PCCINCLUDE=-I$(ORACLE_HOME)/precomp/public 想从.profile中得到TUXDIR,APPDIR 等路径? .profile: PS1=`hostname`'>'; export PS1 export EDITOR=vi ORACLE_HOME=/oracle/app/oracle/product/8.1.7;export ORACLE_HOME PATH...
makefile:
TUXDIR = /home/tuxedo
APPDIR = /apps/resbrow
PCCINCLUDE=-I$(ORACLE_HOME)/precomp/public
想从.profile中得到TUXDIR,APPDIR 等路径?
.profile:
PS1=`hostname`'>'; export PS1
export EDITOR=vi
ORACLE_HOME=/oracle/app/oracle/product/8.1.7;export ORACLE_HOME
PATH=/usr/bin:/usr/local/bin:/etc:/usr/sbin:/usr/ucb:$HOME/bin:/usr/bin/X11:/sbin:$ORACLE_HOME/bin:.
export PATH
if [ -s "$MAIL" ] # This is at Shell startup. In normal
then echo "$MAILMSG" # operation, the Shell checks
fi # periodically.
TUXDIR=/home/tuxedo; export TUXDIR
APPDIR=/apps/tuxserver; export APPDIR
TUXCONFIG=/apps/tuxserver/tuxconfig; export TUXCONFIG
SYBASE=/usr/sybase; export SYBASE
SYBASE_OCS=OCS-12_0; export SYBASE_OCS
SYBASE_ASE=ASE-12_0; export SYBASE_ASE
SYBASE_SYSAM=SYSAM-1_0; export SYBASE_SYSAM
export DSQUERY=sybase
这样在程序移植就不会再依赖于makefile中路径了!!!
TUXDIR = /home/tuxedo
APPDIR = /apps/resbrow
PCCINCLUDE=-I$(ORACLE_HOME)/precomp/public
想从.profile中得到TUXDIR,APPDIR 等路径?
.profile:
PS1=`hostname`'>'; export PS1
export EDITOR=vi
ORACLE_HOME=/oracle/app/oracle/product/8.1.7;export ORACLE_HOME
PATH=/usr/bin:/usr/local/bin:/etc:/usr/sbin:/usr/ucb:$HOME/bin:/usr/bin/X11:/sbin:$ORACLE_HOME/bin:.
export PATH
if [ -s "$MAIL" ] # This is at Shell startup. In normal
then echo "$MAILMSG" # operation, the Shell checks
fi # periodically.
TUXDIR=/home/tuxedo; export TUXDIR
APPDIR=/apps/tuxserver; export APPDIR
TUXCONFIG=/apps/tuxserver/tuxconfig; export TUXCONFIG
SYBASE=/usr/sybase; export SYBASE
SYBASE_OCS=OCS-12_0; export SYBASE_OCS
SYBASE_ASE=ASE-12_0; export SYBASE_ASE
SYBASE_SYSAM=SYSAM-1_0; export SYBASE_SYSAM
export DSQUERY=sybase
这样在程序移植就不会再依赖于makefile中路径了!!!
|
我记得是在MAKE时用-D带入(或者-I),自己看看MAKE的参数吧。这位兄弟现在也做TUXDEO吗?
|
直接用就是罗。
|
是啊,你如果没有在makefile中定义,它就回去找环境变量
|
yes!
|
use $TUXDEO