By naming your source files as you intend the output to be, then appending rather than replacing the extension with '.rl', Xcode can use the following single build rule to process '.rl' files targeting C, C++, Objective-C, and Objective-C++.
*.c.rl *.cpp.rl *.cp.rl *.cxx.rl *.m.rl *.mm.rl
This script uses an intermediate file with the extension '.ragel', this same file is processed by 'rlcodegen' to generate the source code and '.dot' graph.
RAGEL=/opt/local/bin/ragel
RLCODEGEN=/opt/local/bin/rlcodegen
${RAGEL} -o ${DERIVED_FILES_DIR}/${INPUT_FILE_BASE}.ragel ${INPUT_FILE_PATH} || exit
${RLCODEGEN} -G2 -C -o ${DERIVED_FILES_DIR}/${INPUT_FILE_BASE} ${DERIVED_FILES_DIR}/${INPUT_FILE_BASE}.ragel || exit
${RLCODEGEN} -V ${DERIVED_FILES_DIR}/${INPUT_FILE_BASE}.ragel > ${DERIVED_FILES_DIR}/${INPUT_FILE_BASE}.dot
$(DERIVED_FILES_DIR)/$(INPUT_FILE_BASE) $(DERIVED_FILES_DIR)/$(INPUT_FILE_BASE).dot
In case you want to download the latest:
© 2005-2008 Alan West