"Miles Bader" <[EMAIL PROTECTED]> wrote in message 
news:[EMAIL PROTECTED]
> "Ron Baker,    Pluralitas!" <[EMAIL PROTECTED]> writes:
>>> It just sets the environment variable AUTOMAKE to "automake --foreign"
>>> and then runs autoreconf -i (when autoreconf tries to run automake, it
>>
>> Did you leave out a semicolon?
>>       AUTOMAKE="automake --foreign"; autoreconf -i
>
> No; without the semicolon, "V1=x V2=y cmd ..." sets the environment
> variables V1 and V2 only during the execution of "cmd ...", and
> furthermore will make sure they're exported so "cmd" can see them (in
> sh/bash, a variable must be exported to be visible to commands).

Interesting.  I consider myself pretty experienced
with bash but I didn't know that setting variable
on the same command line before the command exports
them to the command.
Thanks for the tip.

>
>> Then I wanted to add some source files to the project.
>> It seems the makefile made per autotools will do it
>> automatically but only if there is a .h for the new .c
>> and you put the .h in every .c that calls the new .c.
>
> I'm not really sure what you mean.
>
> A simple Makefile.am might look like:
>
>    bin_PROGRAMS = foo
>    foo_SOURCES = file1.c file2.c hdr1.h
>
> If you add "file3.c", just make sure it's included in foo_SOURCES:
>
>    foo_SOURCES = file1.c file2.c file3.c hdr1.h
>
> That will make sure it gets built and linked into foo, and will take
> care of all dependency generation etc.

I did that and it didn't take.
I added file3.c to foo_SOURCES but it didn't compile
file3.c when I ran make.
But when I added #include "header3.h" in file2.c then
it compiled file3.c.

Does the order that the
files are listed make a difference?

>
> [Header files mentioned in foo_SOURCES will not have any effect at
> build-time, but having them there ensures they're considered part of the
> source files, so that "make dist" etc. will do the right thing.]
>
> -Miles

--
rb 


_______________________________________________
gnu-misc-discuss mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/gnu-misc-discuss

Reply via email to