From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: From: Juergen Beisert Date: Fri, 29 Jun 2012 16:37:01 +0200 References: <201206261541.50811.jbe@pengutronix.de> <20120629140230.GT10551@pengutronix.de> In-Reply-To: <20120629140230.GT10551@pengutronix.de> MIME-Version: 1.0 Content-Disposition: inline Message-Id: <201206291637.01565.jbe@pengutronix.de> Subject: Re: [ptxdist] [PATCH] fbtest: Make its build-system aware of external CFLAGS and LDFLAGS Reply-To: ptxdist@pengutronix.de List-Id: PTXdist Development Mailing List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: ptxdist-bounces@pengutronix.de Errors-To: ptxdist-bounces@pengutronix.de To: ptxdist@pengutronix.de Cc: Michael Olbrich Michael Olbrich wrote: > [...] > > + > > + $(TARGET): $(OBJS) > > +- $(CC) -o $(TARGET) $(filter $(OBJS), $^) $(LIBS) > > ++ $(CC) -o $(TARGET) $(filter $(OBJS), $^) $(LIBS) $(LDFLAGS) > > $(CC) $(LDFLAGS) -o $(TARGET) $(filter $(OBJS), $^) $(LIBS) > > I think. I'm not sure it makes a difference here, but in general LDFLAGS > should come first. I took a look into the built-in rules of "make": To convert a C-file into a binary the following built-in rule will be used: $(LINK.c) $^ $(LOADLIBES) $(LDLIBS) -o $@ "LINK.c" is defined to: LINK.c = $(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) $(TARGET_ARCH) Which results into the following line: $(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) $(TARGET_ARCH) $^ $(LOADLIBES) $(LDLIBS) -o $@ So, you could be right. I will change it. jbe -- Pengutronix e.K. | Juergen Beisert | Linux Solutions for Science and Industry | http://www.pengutronix.de/ | -- ptxdist mailing list ptxdist@pengutronix.de