threads / patch / 2269

patchUse LDFLAGS instead of ALL_CFLAGS when linking.

Subject: [PATCH] Use LDFLAGS instead of ALL_CFLAGS when linking.

## tl;dr

2 messages between Oct 29, 2005 and Oct 29, 2005. Diffs are folded; open one to read it.

replies: 1people: 2as markdown or json

Andreas Ericsson· Oct 29, 2005, 07:30 UTC · lore

The patch says it all really. It lets users specify their own linking options and unclutters the build-output somewhat.

index 5b0306d..f547d45 100644
Show changes to Makefile +1 −1
--- a/Makefile
+++ b/Makefile
@@ -360,7 +360,7 @@ git-cherry-pick: git-revert
         $(CC) -o $*.o -c $(ALL_CFLAGS) $<

  git-%$X: %.o $(LIB_FILE)
-       $(CC) $(ALL_CFLAGS) -o $@ $(filter %.o,$^) $(LIBS)
+       $(CC) -o $@ $(filter %.o,$^) $(LIBS) $(LDFLAGS)

  git-mailinfo$X : SIMPLE_LIB += $(LIB_4_ICONV)
  $(SIMPLE_PROGRAMS) : $(LIB_FILE)
-- 
Andreas Ericsson                   andreas.ericsson@op5.se
OP5 AB                             www.op5.se
Tel: +46 8-230225                  Fax: +46 8-230231
H. Peter Anvin· Oct 29, 2005, 16:24 UTC · re: Andreas Ericsson · lore

Re: [PATCH] Use LDFLAGS instead of ALL_CFLAGS when linking.

Andreas Ericsson wrote:
Show 13 quoted lines
> The patch says it all really. It lets users specify their own linking 
> options and unclutters the build-output somewhat.
> 
> index 5b0306d..f547d45 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -360,7 +360,7 @@ git-cherry-pick: git-revert
>         $(CC) -o $*.o -c $(ALL_CFLAGS) $<
> 
>  git-%$X: %.o $(LIB_FILE)
> -       $(CC) $(ALL_CFLAGS) -o $@ $(filter %.o,$^) $(LIBS)
> +       $(CC) -o $@ $(filter %.o,$^) $(LIBS) $(LDFLAGS)
> 

Typically $(LDFLAGS) comes before $(LIBS). This is not insignificant, since some people put library seach options into LDFLAGS.

	-hpa

← back to recent threads