On 3/15/07, Dan Nicholson <[EMAIL PROTECTED]> wrote:
>
> More generally, the targets can just be passed through for make. So,
> with my previous patch, you'd do
>
> @(sudo $(SU_LUSER) "... && make LUSER_TARGETS="$(LUSER_TARGETS)" LUSER)
>
> That should achieve the affect I'm after without really adding anything new.

An example.

$ cat Makefile
foo = bar baz
luser = dan
su_luser = su - $(luser) -c

target1:
        sudo make target2
        sudo $(su_luser) "make foo='$(foo)' target2"
target2:
        echo $(foo)

$ make
sudo make target2
make[1]: Entering directory `/home/dan'
echo bar baz
bar baz
make[1]: Leaving directory `/home/dan'
sudo su - dan -c "make foo='bar baz' target2"
echo bar baz
bar baz

$ make foo=bif
sudo make target2
make[1]: Entering directory `/home/dan'
echo bif
bif
make[1]: Leaving directory `/home/dan'
sudo su - dan -c "make foo='bif' target2"
echo bif
bif

I think this is the preferred way to pass variables to sub-makes anyway.

--
Dan
-- 
http://linuxfromscratch.org/mailman/listinfo/alfs-discuss
FAQ: http://www.linuxfromscratch.org/faq/
Unsubscribe: See the above information page

Reply via email to