All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] cleanup build flags a bit
@ 2009-02-08 20:02 Mike Frysinger
  2009-03-02 13:56 ` Cliff Wickman
  0 siblings, 1 reply; 3+ messages in thread
From: Mike Frysinger @ 2009-02-08 20:02 UTC (permalink / raw)
  To: linux-numa

Make sure we respect LDFLAGS, use LDLIBS for libs and not LDFLAGS (so the
link ordering is correct), and allow people to set AR/RANLIB to the right
cross-toolchain.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
---
 Makefile |   15 +++++++++------
 1 files changed, 9 insertions(+), 6 deletions(-)

diff --git a/Makefile b/Makefile
index 52a7363..544cb54 100755
--- a/Makefile
+++ b/Makefile
@@ -48,8 +48,8 @@ numactl: numactl.o util.o shm.o bitops.o libnuma.so
 
 migratepages: migratepages.c util.o bitops.o libnuma.so
 
+migspeed: LDLIBS += -lrt
 migspeed: migspeed.o util.o libnuma.so
-	${CC} migspeed.c -o migspeed util.o libnuma.so -lrt
 
 util.o: util.c
 
@@ -57,7 +57,7 @@ memhog: util.o memhog.o libnuma.so
 
 numactl.o: numactl.c
 
-numademo: override LDFLAGS += -lm
+numademo: LDLIBS += -lm
 # GNU make 3.80 appends BENCH_CFLAGS twice. Bug? It's harmless though.
 numademo: CFLAGS += -DHAVE_STREAM_LIB -DHAVE_MT -DHAVE_CLEAR_CACHE ${BENCH_CFLAGS}
 stream_lib.o: CFLAGS += ${BENCH_CFLAGS}
@@ -72,24 +72,27 @@ numademo.o: numademo.c libnuma.so
 
 numamon: numamon.o
 
+stream: LDLIBS += -lm
 stream: stream_lib.o stream_main.o  libnuma.so util.o
-	${CC} -o stream ${CFLAGS} stream_lib.o stream_main.o util.o -L. -lnuma -lm
+	${CC} ${CFLAGS} ${LDFLAGS} -o $@ $^ ${LDLIBS}
 
 stream_main.o: stream_main.c
 
 libnuma.so.1: versions.ldscript
 
 libnuma.so.1: libnuma.o syscall.o distance.o
-	${CC} -shared -Wl,-soname=libnuma.so.1 -Wl,--version-script,versions.ldscript -Wl,-init,numa_init -o libnuma.so.1 $(filter-out versions.ldscript,$^)
+	${CC} ${LDFLAGS} -shared -Wl,-soname=libnuma.so.1 -Wl,--version-script,versions.ldscript -Wl,-init,numa_init -o libnuma.so.1 $(filter-out versions.ldscript,$^)
 
 libnuma.so: libnuma.so.1
 	ln -sf libnuma.so.1 libnuma.so
 
 libnuma.o : CFLAGS += -fPIC
 
+AR ?= ar
+RANLIB ?= ranlib
 libnuma.a: libnuma.o syscall.o distance.o
-	ar rc $@ $^
-	ranlib $@
+	$(AR) rc $@ $^
+	$(RANLIB) $@
 
 distance.o : CFLAGS += -fPIC
 
-- 
1.6.1.2


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] cleanup build flags a bit
  2009-02-08 20:02 [PATCH] cleanup build flags a bit Mike Frysinger
@ 2009-03-02 13:56 ` Cliff Wickman
  2009-03-03  1:54   ` Mike Frysinger
  0 siblings, 1 reply; 3+ messages in thread
From: Cliff Wickman @ 2009-03-02 13:56 UTC (permalink / raw)
  To: Mike Frysinger; +Cc: linux-numa

Hi Mike,

Thanks much for the patch.

It has sat in my inbox long enough (sorry).  I tested it along
with Amit's patches this morning.
The standard tests pass on ia64 (8 nodes).

The patch is in the numactl-2.0.3-rc2.tar.gz tarball at
ftp://oss.sgi.com/www/projects/libnuma/download/

Any other review and testing is welcome.

-Cliff

On Sun, Feb 08, 2009 at 03:02:52PM -0500, Mike Frysinger wrote:
> Make sure we respect LDFLAGS, use LDLIBS for libs and not LDFLAGS (so the
> link ordering is correct), and allow people to set AR/RANLIB to the right
> cross-toolchain.
> 
> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
> ---
>  Makefile |   15 +++++++++------
>  1 files changed, 9 insertions(+), 6 deletions(-)
> 
> diff --git a/Makefile b/Makefile
> index 52a7363..544cb54 100755
> --- a/Makefile
> +++ b/Makefile
> @@ -48,8 +48,8 @@ numactl: numactl.o util.o shm.o bitops.o libnuma.so
>  
>  migratepages: migratepages.c util.o bitops.o libnuma.so
>  
> +migspeed: LDLIBS += -lrt
>  migspeed: migspeed.o util.o libnuma.so
> -	${CC} migspeed.c -o migspeed util.o libnuma.so -lrt
>  
>  util.o: util.c
>  
> @@ -57,7 +57,7 @@ memhog: util.o memhog.o libnuma.so
>  
>  numactl.o: numactl.c
>  
> -numademo: override LDFLAGS += -lm
> +numademo: LDLIBS += -lm
>  # GNU make 3.80 appends BENCH_CFLAGS twice. Bug? It's harmless though.
>  numademo: CFLAGS += -DHAVE_STREAM_LIB -DHAVE_MT -DHAVE_CLEAR_CACHE ${BENCH_CFLAGS}
>  stream_lib.o: CFLAGS += ${BENCH_CFLAGS}
> @@ -72,24 +72,27 @@ numademo.o: numademo.c libnuma.so
>  
>  numamon: numamon.o
>  
> +stream: LDLIBS += -lm
>  stream: stream_lib.o stream_main.o  libnuma.so util.o
> -	${CC} -o stream ${CFLAGS} stream_lib.o stream_main.o util.o -L. -lnuma -lm
> +	${CC} ${CFLAGS} ${LDFLAGS} -o $@ $^ ${LDLIBS}
>  
>  stream_main.o: stream_main.c
>  
>  libnuma.so.1: versions.ldscript
>  
>  libnuma.so.1: libnuma.o syscall.o distance.o
> -	${CC} -shared -Wl,-soname=libnuma.so.1 -Wl,--version-script,versions.ldscript -Wl,-init,numa_init -o libnuma.so.1 $(filter-out versions.ldscript,$^)
> +	${CC} ${LDFLAGS} -shared -Wl,-soname=libnuma.so.1 -Wl,--version-script,versions.ldscript -Wl,-init,numa_init -o libnuma.so.1 $(filter-out versions.ldscript,$^)
>  
>  libnuma.so: libnuma.so.1
>  	ln -sf libnuma.so.1 libnuma.so
>  
>  libnuma.o : CFLAGS += -fPIC
>  
> +AR ?= ar
> +RANLIB ?= ranlib
>  libnuma.a: libnuma.o syscall.o distance.o
> -	ar rc $@ $^
> -	ranlib $@
> +	$(AR) rc $@ $^
> +	$(RANLIB) $@
>  
>  distance.o : CFLAGS += -fPIC
>  
> -- 
> 1.6.1.2
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-numa" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

-- 
Cliff Wickman
Silicon Graphics, Inc.
cpw@sgi.com
(651) 683-3824

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] cleanup build flags a bit
  2009-03-02 13:56 ` Cliff Wickman
@ 2009-03-03  1:54   ` Mike Frysinger
  0 siblings, 0 replies; 3+ messages in thread
From: Mike Frysinger @ 2009-03-03  1:54 UTC (permalink / raw)
  To: Cliff Wickman; +Cc: linux-numa

[-- Attachment #1: Type: text/plain, Size: 645 bytes --]

On Monday 02 March 2009 08:56:41 Cliff Wickman wrote:
> The patch is in the numactl-2.0.3-rc2.tar.gz tarball at
> ftp://oss.sgi.com/www/projects/libnuma/download/
>
> Any other review and testing is welcome.

the install target creates a man2 dir but doesnt use it

the package comes with a bunch of man8 pages but doesnt install them.   
migratepages.8 and migspeed.8 and numastat.8 ...

it'd be nice if the install target supported $(DESTDIR) ... atm it can be 
mostly faked by only setting prefix when installing ...

the optional install of numa examples is a little odd ... why not just always 
install them ?

HTH
-mike

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2009-03-03  1:54 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-02-08 20:02 [PATCH] cleanup build flags a bit Mike Frysinger
2009-03-02 13:56 ` Cliff Wickman
2009-03-03  1:54   ` Mike Frysinger

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.