help-make
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Executing a shell script in a Makefile


From: Noel Yap
Subject: Re: Executing a shell script in a Makefile
Date: Wed, 29 Sep 2004 16:47:07 -0400
User-agent: Mozilla Thunderbird 0.5 (Windows/20040212)

I also don't see any backgrounded processes.  The only other thing I can think 
of is what Paul had said about NFS.

G2345C wrote:

Hi, Here is the copyfile.sh script, there is no
background copy, I think.

if [ -r $GPS_ENGINE_MANIFEST_FILE ]; then
   while read LINE
   do
      OBJ_TO_COPY=""
      OBJ_LIBS_TO_COPY=""
      OROOT=`echo $LINE | awk -F":" '{print $1}'`
      OPATH=`echo $LINE | awk -F":" '{print $2}'`
      if [ "$OROOT" = "SLS_ROOT" ]; then
         OBJS_BASE_DIR=`dirname ${OPATH}`
         OBJS_BASE_NAME=`basename ${OPATH}`
         OBJ_TO_COPY="$SLS_ROOT/${OPATH}.lo
$SLS_ROOT/${OPATH}.o"
OBJ_LIBS_TO_COPY="$SLS_ROOT/${OBJS_BASE_DIR}/.libs/${OBJS_BASE_NAME}.o"
         cp -p $OBJ_TO_COPY $GPS_ENGINE_OBJS_DIR
         cp -p $OBJ_LIBS_TO_COPY
$GPS_ENGINE_OBJS_DIR/.libs
      fi
      if [ "$OROOT" = "COMMON_ROOT" ]; then
         OBJS_BASE_DIR=`dirname ${OPATH}`
         OBJS_BASE_NAME=`basename ${OPATH}`
         OBJ_TO_COPY="$COMMON_ROOT/${OPATH}.lo
$COMMON_ROOT/${OPATH}.o"
OBJ_LIBS_TO_COPY="$COMMON_ROOT/${OBJS_BASE_DIR}/.libs/${OBJS_BASE_NAME}.o"
         cp -p $OBJ_TO_COPY $GPS_ENGINE_OBJS_DIR
         cp -p $OBJ_LIBS_TO_COPY
$GPS_ENGINE_OBJS_DIR/.libs
      fi
   done < $GPS_ENGINE_MANIFEST_FILE
fi





--- "Paul D. Smith" <address@hidden> wrote:


%% G2345C <address@hidden> writes:

 g> because the next statement get executed and it
failed
 g> because foo.o is not yet get copy.

There is simply no way whatsoever that make is
invoking the second line
before the first finishes.  The code just doesn't
work that way.

 g> Now if I modified the makefile to this:
 g> all :
 g>        $(SHELL) ./copyfile.sh
 g> then run it.

 g> wait for about 1 minute....
 g> then modify the makefile to this:
 g> all :
 g>        cd $(OBJ_DIR) && mv foo.o newfoo

 g> then run again it work great

Is this directory an NFS partition?  Maybe there is
an issue where the
new file isn't visible immediately.

Or, maybe the copyfile.sh script puts the copy
command into the
background then the copyfile.sh script exits before
the copy command is
complete.  Try adding -x after the $(SHELL) line and
see what's going
on.

Otherwise, I don't have any idea, but it's not the
case that make is
invoking the second line before the first one
finishes.

--


-------------------------------------------------------------------------------

Paul D. Smith <address@hidden>          Find some
GNU make tips at:
http://www.gnu.org http://make.paulandlesley.org
"Please remain calm...I may be mad, but I am a
professional." --Mad Scientist




=====
-------------------------
http://www.nguyen.bz/dvd
-------------------------

__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com




reply via email to

[Prev in Thread] Current Thread [Next in Thread]