[LLVMdev] fudging the top-level Makefile

Stuart Hastings stuart at apple.com
Wed Oct 14 09:35:23 PDT 2009


On Oct 9, 2009, at 12:34 PM, Mike Stump wrote:

>
> On Oct 9, 2009, at 8:40 AM, Stuart Hastings wrote:
>
>>
>> On Oct 8, 2009, at 5:18 PM, Mike Stump wrote:
>>
>>> On Oct 8, 2009, at 4:52 PM, Stuart Hastings wrote:
>>>> Currently, to get LLVM to build "Apple-style," it's necessary to  
>>>> copy two files (utils/buildit/GNUmakefile and utils/buildit/ 
>>>> build_llvm) into the top-level directory.
>>>
>>> Why not:
>>>
>>> $ RC_ARCHS="x86" make
>>> echo Apple Build.
>>> Apple Build.
>>> $ make
>>> echo Standard Build
>>> Standard Build
>>> $ cat Makefile
>>> ifneq ($(RC_ARCHS),)
>>> include Makefile.apple
>>> else
>>> all:
>>> 	echo Standard Build
>>> endif
>>> mrs $ cat Makefile.apple
>>> all:
>>> 	echo Apple Build.
>>>
>>> It leaves Makefile mostly alone, all except for three lines at the  
>>> top and one line at the end of it.
>>
>> Because the existing top-level Makefile includes "Makefile.config".
>
> ?  Only if you want it:
>
> $ cat Makefile
> ifdef FOO
> include no_such_file
> endif
>
>
> all:
> 	echo ok
> mrs $ make all
> echo ok
> ok

I don't think that solves the problem.  If I elide both of the  
includes in the top-level Makefile, then I'm obliged to make the  
combined Makefile + included GNUmakefile coexist.  I think it could be  
done, but I'd rather not.  :-)  The alternative is to wrap the entire  
body of the top-level Makefile in a conditional.  IMHO this is uglier  
and more fragile than my original proposal, but it's still workable:

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: llvmCore.diffs.txt
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20091014/98278eb6/attachment.txt>
-------------- next part --------------


stuart


More information about the llvm-dev mailing list