[LLVMdev] ExtraSource Variable in Makefiles

Gregory Malecha gmalecha at eecs.harvard.edu
Fri Jul 8 18:33:10 PDT 2011


I was reading (http://llvm.org/docs/Projects.html) which mentions the use of
ExtraSource as a variable that can be set in project Makefiles to handle
code that is generated. I couldn't get this to work, and grepping through
all the Makefile.*s in all the directories I couldn't find any mention of
"ExtraSource" except for in the Makefile.common (where it is in a comment):

# 4. Source - If specified, this sets the source code filenames.  If this
#    is not set, it defaults to be all of the .cpp, .c, .y, and .l files
#    in the current directory.  Also, if you want to build files in addition
#    to the local files, you can use the ExtraSource variable

Is this a bug or has the documentation simply not been updated? Is there a
new way to do it?

On a slightly related note, I tend to like to put generated files in
subdirectories (maybe this is a bad thing?) to keep them from cluttering the
code that I'm working on. This breaks the default LLVM makefiles because it
compiles foo/bar.c to Debug+Asserts/foo/bar.o and the foo directory doesn't
exist in Debug+Asserts.

I'm pretty bad with Makefiles, but the attached patch seems to fix both
problems, though possibly not in the most elegant way.

gregory malecha
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20110708/6011ba2f/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Makefile.rules.patch
Type: text/x-patch
Size: 8275 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20110708/6011ba2f/attachment.bin>

More information about the llvm-dev mailing list