I have an application that I want to target pre- and post-3rd S60, and also want versions with different names and icons (for release in different geographies).

Does anyone have any tips for maintaining such an application in a single code base as automatically as possible?

Some of the issues are :

1) application name occurs in the package file and filename
2) application name occurs in the help (rtf) files - how to change that programattically?
3) names in language files
4) packaging different icons/etc

Obviously, code differences can be taken care of with macros in the mmp files - it's messy, but it works; but not everything is preprocessed...