[LLVMdev] Proposed Makefile Changes

Chris Lattner sabre at nondot.org
Fri Jan 14 10:14:55 PST 2005


On Fri, 14 Jan 2005, Reid Spencer wrote:

> In buildling XPS using LLVM's makefile system, I'm finding that there's
> a few things lacking in our support for LLVM-based projects. The items
> below should help but may require changes to project makefiles. I
> thought I'd check before just going and doing it.

ok.

>     1. Various autoconf generated variables (e.g. abs_top_srcdir) are
>        set in the makefiles but not used. They conflict with a user's
>        project that might want to use them. I propose removing them or
>        using names prefixed with llvm_ to ensure their use is only for
>        llvm

If these are really not used, I don't see any harm in removing them.  You 
should check with people running complex external projects (like the 
reoptimizer) to find out if they are really dead though.

>     2. BUILD_SRC_DIR and BUILD_OBJ_DIR are poorly named. This has been
>        a source of confusion for me personally and probably for others.
>        They should really be PROJ_SRC_DIR and PROJ_OBJ_DIR to indicate
>        they pertain to the project's src/obj dir not LLVM's

I totally agree here.

>     3. The LLVM makefiles require a Makefile.config in the project. I'm
>        going to try to make that optional because some projects can
>        just use LLVM's Makefile.config.

Ok.  Does this mean you want to make the project configure script 
optional, or just a Makefile.config?  What is the harm in leaving it? 
Does removing it actually gain anything?

>     4. There should be no "default" directives because it prevents the
>        use of a directive in the user's Makefile to document what will
>        be built. Currently, the only such case is that we build a
>        "relinked" object file by default for each library unless
>        DONT_BUILD_RELINKED is specified. While this is common for LLVM,
>        it isn't for projects which will want an archive or shared
>        library. If a relinked library is needed, something link
>        RELINKED_LIBRARY=1 should be specified so that it documents in
>        the makefile what is getting built.

I think this is fine.

>     5. Some of the names of the directives are a little confusing. We
>        have BUILD_ARCHIVE to specify building an archive. But, we have
>        SHARED_LIBRARY to specify building a shared library. I think
>        these should all be named BUILD_<thing_to_build> so we'd have
>        BUILD_ARCHIVE_LIBRARY and BUILD_SHARED_LIBRARY and
>        BUILD_RELINKD_LIBRARY and BUILD_TOOL

I would also like to see this happen, but it's a big change.  I suspect 
that people running projects would prefer to not change all of these.

>     6. The directive names are concatenated in some cases. I'd like to
>        see TOOL_NAME instead of TOOLNAME and LIBRARY_NAME instead of
>        LIBRARYNAME. Its easier for *me* to read, but I'd like some
>        feedback on this one as its as "gratuitous" change.

Likewise.

>     7. The documentation in MakefileGuide.html is lacking a tutorial on
>        how to use the LLVM Makefile system for projects (as opposed to
>        LLVM itself).  I think its time to add one. There are things in
>        the configure.ac file that are needed to support the makefile
>        system. Those need to be documented as well.

There is some information here:
http://llvm.cs.uiuc.edu/docs/Projects.html

But it's not really a tutorial.  A tutorial would be great to have, but we 
should figure out the relationship between these two docs.

> The end result should be that using the LLVM Makefile for things other
> than LLVM itself gets a easier/clearer and better documented.

yaay. :)

> I'm signing up to do the necessary changes in llvm and llvm-test. I'll
> also help anyone with the necessary changes in their project.

If you make these changes, please make sure to send instructions for 
exactly what needs to be done to update projects.  These kinds of things 
can lead to all sorts of obscure problems for those who aren't experts in 
the build system...

-Chris

-- 
http://nondot.org/sabre/
http://llvm.cs.uiuc.edu/




More information about the llvm-dev mailing list