for loop in makefile

Hi All,

I dont know if this is a right forum to ask the questions about makefile. Please redirect me to correct forum in case this is not right place.

Below is the part of my makefile:
-------------------------------------------------

lista = abc
listb = xyz
LIST=$(lista) $(listb)
list:
    @echo "The list is :"
    for p in  $(LIST); \
    do \
    echo $p ; \
    $(MAKE) -C ../$$p list_all ; \
    done

-------------------------------------------------
i want to print abc and xyz . However, the above echo $p statement is not giving the expected result.
What exactly is going wrong in the above code.

Try

echo $$p

instead of

echo $p

i tried $$p too, still not getting the expected output.