The first sentence here forms an excellent question, because it highlights the issue of tense in subordinate clauses, which can be counter-intuitive coming from an English background.
The English mind looks at this and thinks about the verb 作る relative to the time when this statement is made. Since we're talking about a future event, it would seem to make sense that the verbs (even in subordinate clauses) should match up and be in future tense. But the Japanese mind thinks about 作る relative to the time when the main action takes place. Since the main action is 食べる, at the point when 食べる takes place, the food will have already been made, so 作った, not 作る, is correct.
For another example, consider the following:
These are both valid sentences, but they mean different things! The first, because 行く is non-past, means you will buy a camera before going to Japan (because at the time とき, the action 行く has not happened yet). But the second, because 行った is past, means you will buy a camera after having arrived in Japan (because at the time とき, the action 行く has happened).