List Info

Thread: new makefile scheme..




new makefile scheme..
user name
2006-08-26 16:17:54
Manuel,

3 out of 4 problems solved.

..  ignore the $MAKE issue, not a problem only a style issue
..  pass SHELL=/tools/bin/sh inline.. (obvious in the light
of day)
..  make changingowner & kernfs dependencies before
entering the chroot 
environment ( only works if you originally issued >>
sudo make

mk_CHROOT: mk_LUSER 057-changingowner 059-kernfs
   $(call echo_CHROOT_request)
   (
sudo $(CHROOT1) "cd $(SCRIPT_ROOT) && make
SHELL=/tools/bin/sh 
CHROOT")
   touch $


.. I still have no method for making progress_bar run
without fuser. 
Ideas anyone???

   off for a coffee, G
-- 
http://linuxfromscratch.org/mailman/listinfo/alfs-discu
ss
FAQ: http://www.linux
fromscratch.org/faq/
Unsubscribe: See the above information page
new makefile scheme..
user name
2006-08-26 17:44:24
On 8/26/06, George Boudreau <georgeblinuxfromscratch.org> wrote:
>
> .. I still have no method for making progress_bar run
without fuser.
> Ideas anyone???

George, I think I finally figured out a way to do this. I'm
a little
short on time, so I'll try to explain. No time for diff's
but you
should be able to figure it out.

>From inside the script, I tried using $PPID, but it was
coming out to
strange values. I also ran ps with a lot of args, and found
that
sometimes the script parent was even pid 1. Seems there's
an extra
level of parenting or 2 when make actually runs a shell
command.

Then I found out that within the Makefile, each target
command has a
PPID of the actual make process. Try this.

fud:
    echo PPID=$$PPID

It will echo the PID of make itself. So, the answer to the
problem is
to use $$PPID in the Makefile and pass it as an argument to
progress_bar.sh. Here's a simple example that I found to
work.

$ cat Makefile
foo:
        echo -n "Building $"
        ./script.sh $ $$PPID &
        sleep 2
        touch $
        echo
bar:
        echo -n "Building $"
        ./script.sh $ $$PPID &
        sleep 2
        touch $
        echo
all: foo bar
clean:
        rm -f foo bar
$ cat script.sh
#!/bin/bash

TARGET=$
MAKE_PPID=$

until [[ -f $ ]] || [[ ! -e /proc/$ ]];
do
        echo -n '.'
        sleep .12
done
$ make all
Building foo.................
Building bar................

It works when I interrupted the process, too. What do you
think?

--
Dan
-- 
http://linuxfromscratch.org/mailman/listinfo/alfs-discu
ss
FAQ: http://www.linux
fromscratch.org/faq/
Unsubscribe: See the above information page
new makefile scheme..
user name
2006-08-26 18:00:01
El Sábado, 26 de Agosto de 2006 19:44, Dan Nicholson
escribió:

> Then I found out that within the Makefile, each target
command has a
> PPID of the actual make process. Try this.
>
> fud:
>     echo PPID=$$PPID

It will need some testing but looks great.

Many thanks 

-- 
Manuel Canales Esparcia
Usuario de LFS nº2886:       http://www.linuxfroms
cratch.org
LFS en castellano: http://www.escomp
oslinux.org/lfs-es http://www.lfs-es.info
TLDP-ES:                           http://es.tldp.org
-- 
http://linuxfromscratch.org/mailman/listinfo/alfs-discu
ss
FAQ: http://www.linux
fromscratch.org/faq/
Unsubscribe: See the above information page
[1-3]

about | contact  Other archives ( Real Estate discussion Medical topics )