|

楼主 |
发表于 2005-8-22 20:02
|
显示全部楼层
thanks gaga!
Sorry, If I could not express myslef clearly. ( I still prefer to write in En. PiYing always make my thinking discret :lol )
I would like to compile my subroutine(e.g. mysub.f) in local DIR. and the other LIBs( namely, lib1.o, lib2.o, lib3.o) in other DIR(e.g. /home/BeBe/Objects). 'cause they are from 3rd-party and ready to use.
Yes! it is possible to write the Makefile like:
#===================================
# test Makefile for IFORT@linux
#
SOURCE=/home/Bebe/Objects
main:mysub.o
ifort [options] -o main mysub.o\
${SOURCE}/lib1.o\
${SOURCE}/lib2.o \
... ...
[other options]
mysub.o:mysub.f
ifort [options] mysub.f
#===================================
There are dozens of LIBs in ${SOURE}, so maybe it is possible to use e.g. -L, so that Makefile search LIBs in the DIR. automatically and no need to add so many ${SOURCE} for each line.
BTW: -o: output excutable file(e.g. main), "chmod u+x main" not needed laterly. |
|