automake
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Defining variables shared between Makefile.am files


From: vicious3030
Subject: Re: Defining variables shared between Makefile.am files
Date: Fri, 2 Oct 2009 14:29:34 -0700 (PDT)

Cool thanks.
How do I make the variable "configurable"?

Additionally, is there a way I can call a shell command during the build:
specifically, due to typos there are a number of "*.H" as opposed to "*.h"
rather than fixing that issue I'd like to simply make a rule like:
   typofile.H: typofile.h
          ln -s typofile.h typofile.H
This would have to be defined in the Makefile.am right?

I appreciate the help!


Ralf Wildenhues wrote:
> 
> * vicious3030 wrote on Tue, Sep 29, 2009 at 12:01:28AM CEST:
>> 
>> I'm working on putting together my first automake project, 3 executables,
>> multiple convenience libraries, among a few folders.
>> It includes some third party libraries and header files that are stored
>> elsewhere.
>> I'd like to have a central variable (thirdPartyPath=/home/blah/third)
>> that
>> holds the path to this directory (as well as other include dirs) that can
>> be
>> accessed by all Makefile.am's (mine_CPPFLAGS = -I$(thirdPartyPath)) so I
>> don't have to define it in every file. At the moment I can't seem to get
>> the
>> .am files to share variable definitions. 
> 
> You can either
>   AC_SUBST([thirdPartyPath], [/home/blah/third])
> 
> in configure.ac, or have a common fragment that you
>   include fragment.am
> 
> in each Makefile.am.
> 
> I suggest using the former, and also making the path configurable/
> overridable.  Fixed paths are likely going to be wrong on your users'
> systems.
> 
>> Additionally is there a way that I can have all the PROGRAMS build into
>> one
>> common bin directory even though the sources and makefiles reside in
>> different folders?
> 
> You mean in the build tree or in the install tree?  For the latter,
> listing them all in bin_PROGRAMS is sufficient.  For the former, you
> could simply go with only one Makefile.am in a non-recursive makefile
> setup, or write something like
>   bin_PROGRAMS = ../bin/foo
> 
> but that will likely cause distcheck problems, at least when you also
> use libtool.  I suggest not bothering too much with build tree layout.
> 
> Hope that helps.
> 
> Cheers,
> Ralf
> 
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Defining-variables-shared-between-Makefile.am-files-tp25653731p25722077.html
Sent from the Gnu - Automake - General mailing list archive at Nabble.com.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]