Above all, the intention!
http://www.accesstoinsight.org/ptf/dhamma/dana/
Many motives, many fruits
"Sariputta, there is the case where a person gives a gift seeking his own profit, with a mind attached [to the reward], seeking to store up for himself [with the thought], 'I'll enjoy this after death.' He gives his gift — food, drink, clothing, a vehicle; a garland, perfume, & ointment; bedding, shelter, & a lamp — to a brahman or a contemplative. What do you think, Sariputta? Might a person give such a gift as this?"
"Yes, lord."
"Having given this gift seeking his own profit — with a mind attached [to the reward], seeking to store up for himself, [with the thought], 'I'll enjoy this after death' — on the break-up of the body, after death, reappears in the company of the Four Great Kings. Then, having exhausted that action, that power, that status, that sovereignty, he is a returner, coming back to this world.
"Then there is the case of a person who gives a gift not seeking his own profit, not with a mind attached [to the reward], not seeking to store up for himself, nor [with the thought], 'I'll enjoy this after death.' Instead, he gives a gift with the thought, 'Giving is good.' He gives his gift — food, drink, clothing, a vehicle; a garland, perfume, & ointment; bedding, shelter, & a lamp — to a brahman or a contemplative. What do you think, Sariputta? Might a person give such a gift as this?"
"Yes, lord."
"Having given this gift with the thought, 'Giving is good,' on the break-up of the body, after death, reappears in the company of the Devas of the Thirty-three. Then, having exhausted that action, that power, that status, that sovereignty, he is a returner, coming back to this world.
... (excerpt available on source page)
"This, Sariputta, is the cause, this is the reason, why a person gives a gift of a certain sort and it does not bear great fruit or great benefit, whereas another person gives a gift of the same sort and it bears great fruit and great benefit."
— AN 7.49
From the same page:
A gift of Dhamma conquers all gifts
— Dhp 354
With this basic understanding:
"Even if a person throws the rinsings of a bowl or a cup into a village pool or pond, thinking, 'May whatever animals live here feed on this,' that would be a source of merit, to say nothing of what is given to human beings. But I do say that what is given to a virtuous person is of great fruit, and not so much what is given to an unvirtuous person. And the virtuous person has abandoned five factors and is endowed with five.
Think to benefit all sentient beings with your gift, that the benefits may echo out into the cosmos and into all planes of existence. Set that mind when you give, and lose yourself in the action.