im really confused about this poem. What does it have to do with the three little pigs? or is it ot an allusion at all?

Foundations

Leopold Staff

I built on the sand
And it tumbled down,
I built on a rock
And it tumbled down.
Now when I build, I shall begin
With the smoke from the chimney

http://www.loc.gov/poetry/180/028.html