Re: Makefile.am target name prefix *.o

2020-02-02 Thread Vincent Blondel
Thank You for the detailed answer :-)
-V.

On Sat, Feb 1, 2020 at 9:58 PM Russ Allbery  wrote:

> Vincent Blondel  writes:
>
> > Encounter a strange behaviour with autoconf.
> > I do not understand why all the compiled *.o files are prefixed with
> > target-xxx.o.
>
> > Below an example ... have no progname yet for my executable hence let's
> > call it main for now ...
>
> > bin_PROGRAMS = main
> > main_SOURCES =  obj1.cc obj2.cc
>
> > Executable is OK but have no clue why I have something like this at the
> end
> > ? ...
>
> > src/main-obj1.o
> > src/main-obj2.o
>
> This is actually Automake rather than Autoconf (Makefile.am is Automake).
> This renaming is documented in the Automake manual:
>
> https://www.gnu.org/software/automake/manual/html_node/Renamed-Objects.html
>
> --
> Russ Allbery (ea...@eyrie.org) 
>


Re: Makefile.am target name prefix *.o

2020-02-01 Thread Russ Allbery
Vincent Blondel  writes:

> Encounter a strange behaviour with autoconf.
> I do not understand why all the compiled *.o files are prefixed with
> target-xxx.o.

> Below an example ... have no progname yet for my executable hence let's
> call it main for now ...

> bin_PROGRAMS = main
> main_SOURCES =  obj1.cc obj2.cc

> Executable is OK but have no clue why I have something like this at the end
> ? ...

> src/main-obj1.o
> src/main-obj2.o

This is actually Automake rather than Autoconf (Makefile.am is Automake).
This renaming is documented in the Automake manual:

https://www.gnu.org/software/automake/manual/html_node/Renamed-Objects.html

-- 
Russ Allbery (ea...@eyrie.org) 



Re: Makefile.am target name prefix *.o

2020-02-01 Thread Sébastien Hinderer
Hello,

Vincent Blondel (2020/02/01 17:10 +0100):
> Hello,
>
> Encounter a strange behaviour with autoconf.
> I do not understand why all the compiled *.o files are prefixed with
> target-xxx.o.
>
> Below an example ... have no progname yet for my executable hence let's
> call it main for now ...
>
> bin_PROGRAMS = main
> main_SOURCES =  obj1.cc obj2.cc
>
> Executable is OK but have no clue why I have something like this at the end
> ? ...
>
> src/main-obj1.o
> src/main-obj2.o

That's just a guess but to me this makes a lot of sense. It may happen
that your source files have to be compiled several times, e.g. with
different compiler options, in order to produce different targets. My
intuition is that it is to avoid collisions between potential multiple
compilations of the same source file that automake is generating such a
Makefile.

hth,

Sébastien.



Makefile.am target name prefix *.o

2020-02-01 Thread Vincent Blondel
Hello,

Encounter a strange behaviour with autoconf.
I do not understand why all the compiled *.o files are prefixed with
target-xxx.o.

Below an example ... have no progname yet for my executable hence let's
call it main for now ...

bin_PROGRAMS = main
main_SOURCES =  obj1.cc obj2.cc

Executable is OK but have no clue why I have something like this at the end
? ...

src/main-obj1.o
src/main-obj2.o

Thanks for your help ...
-V