Heat the oil in a deep, heavy-based pan over medium heat, add the turmeric, coriander seeds, cumin seeds, asafoetida, dried red chillies and the dals and stir-fry for about 2 minutes, or until all the spices and chillies are fragrant and the dais turn golden.
Put the tamarind extract in a bowl, add the spice and dal mixture, and season with salt. Transfer the mixture to a mortar or small blender and pound with a pestle or process until ground.
Slice the aubergines into quarters, keeping them joined at the stem. Fill the aubergines with the spice mixture and set aside.
Heat the oil for the tempering in a large, heavy-based pan over medium heat, add the mustard seeds, cumin seeds, dried red chilli, curry leaves and dal and stir-fry for 1 minute, or until the mustard seeds start to splutter. Add the onions and stir-fry for about 1-2 minutes.
Add the aubergines and turmeric, then season with salt and fry for about 2 minutes, turning the aubergines around gently. Sprinkle over 1-2 tablespoons of water, then reduce the heat, cover, and simmer, turning them occasionally and taking care not to break them, for about 15-20 minutes, or until the aubergines are cooked. Serve hot.