* Re: [PATCH] Makefile: cleanup linking to librttest.a
[not found] ` <1425408168-27325-1-git-send-email-m.olbrich@pengutronix.de>
@ 2015-03-03 18:58 ` John Kacur
0 siblings, 0 replies; only message in thread
From: John Kacur @ 2015-03-03 18:58 UTC (permalink / raw)
To: Michael Olbrich; +Cc: Clark Williams, John Kacur, rt-users
On Tue, 3 Mar 2015, Michael Olbrich wrote:
> Only add '-lrttest -L.' where it's actually needed.
> Use '$<' instead of '$^'. Otherwise librttest is added twice:
> As 'librttest.a' and as '-lrttest'.
>
> Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
> ---
>
> Better like this?
>
> Michael
>
> Makefile | 25 +++++++++++++------------
> 1 file changed, 13 insertions(+), 12 deletions(-)
>
> diff --git a/Makefile b/Makefile
> index da7b419c4bcd..5d7f449cc026 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -11,7 +11,8 @@ sources += signaltest.c ptsematest.c sigwaittest.c svsematest.c sendme.c \
>
> TARGETS = $(sources:.c=)
>
> -LIBS = -lrt -lpthread -lrttest -L.
> +LIBS = -lrt -lpthread
> +RTTESTLIB = -lrttest -L.
> EXTRA_LIBS ?= -ldl # for get_cpu
> DESTDIR ?=
> prefix ?= /usr/local
> @@ -68,41 +69,41 @@ all: $(TARGETS) hwlatdetect
> -include $(sources:.c=.d)
>
> cyclictest: cyclictest.o librttest.a
> - $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $^ $(LIBS) $(NUMA_LIBS)
> + $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $< $(LIBS) $(RTTESTLIB) $(NUMA_LIBS)
>
> signaltest: signaltest.o librttest.a
> - $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $^ $(LIBS)
> + $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $< $(LIBS) $(RTTESTLIB)
>
> pi_stress: pi_stress.o librttest.a
> - $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $^ $(LIBS)
> + $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $< $(LIBS) $(RTTESTLIB)
>
> hwlatdetect: src/hwlatdetect/hwlatdetect.py
> chmod +x src/hwlatdetect/hwlatdetect.py
> ln -s src/hwlatdetect/hwlatdetect.py hwlatdetect
>
> rt-migrate-test: rt-migrate-test.o
> - $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $^ $(LIBS)
> + $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $< $(LIBS)
>
> ptsematest: ptsematest.o librttest.a
> - $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $^ $(LIBS) $(EXTRA_LIBS)
> + $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $< $(LIBS) $(RTTESTLIB) $(EXTRA_LIBS)
>
> sigwaittest: sigwaittest.o librttest.a
> - $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $^ $(LIBS) $(EXTRA_LIBS)
> + $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $< $(LIBS) $(RTTESTLIB) $(EXTRA_LIBS)
>
> svsematest: svsematest.o librttest.a
> - $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $^ $(LIBS) $(EXTRA_LIBS)
> + $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $< $(LIBS) $(RTTESTLIB) $(EXTRA_LIBS)
>
> pmqtest: pmqtest.o librttest.a
> - $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $^ $(LIBS) $(EXTRA_LIBS)
> + $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $< $(LIBS) $(RTTESTLIB) $(EXTRA_LIBS)
>
> sendme: sendme.o librttest.a
> - $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $^ $(LIBS) $(EXTRA_LIBS)
> + $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $< $(LIBS) $(RTTESTLIB) $(EXTRA_LIBS)
>
> pip_stress: pip_stress.o librttest.a
> - $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $^ $(LIBS)
> + $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $< $(LIBS) $(RTTESTLIB)
>
> hackbench: hackbench.o
> - $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $^ $(LIBS)
> + $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $< $(LIBS)
>
> librttest.a: rt-utils.o error.o rt-get_cpu.o rt-sched.o
> $(AR) rcs librttest.a $^
> --
> 2.1.4
>
>
Thats better, thanks applied.
Signed-off-by: John Kacur <jkacur@redhat.com>
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2015-03-03 18:58 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <CAONaPpHd1Wbc3AcXH2+4DO=3=yKdFXRnM8LFbE-ebiZV8WOuMA@mail.gmail.com>
[not found] ` <1425408168-27325-1-git-send-email-m.olbrich@pengutronix.de>
2015-03-03 18:58 ` [PATCH] Makefile: cleanup linking to librttest.a John Kacur
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).