Place cut side of the squash down in a lightly oiled baking pan. Bake at 350 degrees F (175 degrees C) for 30 minutes, or until a sharp knife can be inserted with only a little resistance. Remove squash from oven, and set aside to cool enough to be easily handled. Shred squash with a fork.
In a large soup pot, saute onions and garlic in olive oil. Add curry powder, cumin, and turmeric. When onions are transparent, add stock and lentils and bring to a boil. Reduce to simmer and add chopped tomatoes and juice.
If using brown rice, add the rice 10 minutes after adding the lentils, if using white rice, add rice after 25 minutes along with the can of corn. (Add the can of corn at the same time you add rice, white or brown).
After 35 minutes, add the macaroni and spaghetti squash. Simmer until rice and pasta are cooked.