I realized my earlier question was a little confused about the rules and dependencies. The following .pro file generates a makefile which works correctly IF the source files in the directory 'generated' exist at the time qmake runs.
idl.target = generated/qmtest.h
idl.commands = code_generator
idl.config = no_link
idl.depends = $$SOURCES $$HEADERS $$FORMS
TEMPLATE = app
INCLUDEPATH += generated
SOURCES += generated/*.cpp
PRE_TARGETDEPS += generated/qmtest.h
QMAKE_EXTRA_UNIX_TARGETS += idl
But when qmake runs, its only generating a makefile, and PRE_TARGETDEPS & QMAKE_EXTRA_UNIX_TARGETS don't help me. How can I get qmake to generate a makefile which will add the contents of generated/ to SOURCES?