Re: GNU make builtin rules produce linker error due to command line arguments order

2010-04-06 Thread Robrecht Dewaele
Dave Korn wrote: On 07/04/2010 00:24, Robrecht Dewaele wrote: $ LDFLAGS=-lpopt make options Only put flags in LDFLAGS. Put libs in LDLIBS. The default rule is %: %.c # commands to execute (built-in): $(LINK.c) $^ $(LOADLIBES) $(LDLIBS) -o $@ and LINK.c embeds

Re: GNU make builtin rules produce linker error due to command line arguments order

2010-04-06 Thread Greg Chicares
On 2010-04-06 23:24Z, Robrecht Dewaele wrote: > > # Using builtin make rules and LDFLAGS seems to yield an incorrect > order of arguments for cc. > $ LDFLAGS=-lpopt make options http://www.gnu.org/software/make/manual/html_node/Catalogue-of-Rules.html#Catalogue-of-Rules | The precise command

Re: GNU make builtin rules produce linker error due to command line arguments order

2010-04-06 Thread Dave Korn
On 07/04/2010 00:24, Robrecht Dewaele wrote: > $ LDFLAGS=-lpopt make options Only put flags in LDFLAGS. Put libs in LDLIBS. The default rule is > %: %.c > # commands to execute (built-in): > $(LINK.c) $^ $(LOADLIBES) $(LDLIBS) -o $@ and LINK.c embeds LDFLAGS. On ELF platforms where

GNU make builtin rules produce linker error due to command line arguments order

2010-04-06 Thread Robrecht Dewaele
Hello everyone, I'm not sure whether this is a make or a cygwin issue, but it has occured to me only on cygwin, so I thought to ask here first. To illustrate my problem, I have written a little testcase (options.c) which uses libpopt and illustrate how to reproduce the behaviour at the bottom