All of lore.kernel.org
 help / color / mirror / Atom feed
From: Lee Schermerhorn <lee.schermerhorn@hp.com>
To: Cliff Wickman <cpi@sgi.com>
Cc: Kornilios Kourtis <kkourt@cslab.ece.ntua.gr>,
	Brice Goglin <Brice.Goglin@inria.fr>,
	linux-numa@vger.kernel.org, eric.whitney@hp.com
Subject: [PATCH 7/8] numactl/Makefile - Generalize Makefile .so Version
Date: Tue, 28 Apr 2009 12:37:02 -0400	[thread overview]
Message-ID: <20090428163702.24945.41315.sendpatchset@localhost.localdomain> (raw)
In-Reply-To: <20090428163621.24945.95516.sendpatchset@localhost.localdomain>

[PATCH 07/08] Generalize Makefile .so Version

Against:  numactl-2.0.3-rc2

When building "upstream" libnuma on a system with, e.g., a distro-supplied
numactl package installed, I find it useful to build a different version of
libnuma.so, so that both versions of the library can co-exist.  

This patch replaces all explicit usage of the libnuma.so.N file name with
the make variable LIBNUMA_SO.

Note that I'm building with 'libnuma.so.2'.  I think this makes sense for
numactl 2.x.y, but may not be what you want.


 Makefile |   20 +++++++++++---------
 1 files changed, 11 insertions(+), 9 deletions(-)

Index: numactl-2.0.3-rc2/Makefile
===================================================================
--- numactl-2.0.3-rc2.orig/Makefile	2009-01-30 10:10:15.000000000 -0500
+++ numactl-2.0.3-rc2/Makefile	2009-02-13 10:16:47.000000000 -0500
@@ -8,6 +8,8 @@ BENCH_CFLAGS := -O3 -ffast-math -funroll
 CFLAGS += ${OPT_CFLAGS}
 override CFLAGS += -I.
 
+LIBNUMA_SO =  libnuma.so.2
+
 # find out if compiler supports __thread
 THREAD_SUPPORT := $(shell if $(CC) $(CFLAGS) threadtest.c -o threadtest \
 			>/dev/null 2>/dev/null ; then echo "yes" ; else echo "no"; fi)
@@ -23,7 +25,7 @@ ifeq ($(THREAD_SUPPORT),yes)
 endif
 
 CLEANFILES := numactl.o libnuma.o numactl numademo numademo.o distance.o \
-	      memhog libnuma.so libnuma.so.1 numamon numamon.o syscall.o bitops.o \
+	      memhog libnuma.so $(LIBNUMA_SO) numamon numamon.o syscall.o bitops.o \
 	      memhog.o util.o stream_main.o stream_lib.o shm.o stream clearcache.o \
 	      test/pagesize test/tshared test/mynode.o test/tshared.o mt.o empty.o empty.c \
 	      test/mynode test/ftok test/prefered test/randmap \
@@ -77,13 +79,13 @@ stream: stream_lib.o stream_main.o  libn
 
 stream_main.o: stream_main.c
 
-libnuma.so.1: versions.ldscript
+$(LIBNUMA_SO): 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,$^)
+$(LIBNUMA_SO): libnuma.o syscall.o distance.o
+	${CC} -shared -Wl,-soname=$(LIBNUMA_SO) -Wl,--version-script,versions.ldscript -Wl,-init,numa_init -o $(LIBNUMA_SO) $(filter-out versions.ldscript,$^)
 
-libnuma.so: libnuma.so.1
-	ln -sf libnuma.so.1 libnuma.so
+libnuma.so: $(LIBNUMA_SO)
+	ln -sf $(LIBNUMA_SO) libnuma.so
 
 libnuma.o : CFLAGS += -fPIC
 
@@ -123,7 +125,7 @@ test/migrate_pages: test/migrate_pages.c
 
 MANPAGES := numa.3 numactl.8 numastat.8 migratepages.8 migspeed.8
 
-install: numactl migratepages migspeed numademo.c numamon memhog libnuma.so.1 numa.h numaif.h numacompat1.h numastat ${MANPAGES}
+install: numactl migratepages migspeed numademo.c numamon memhog $(LIBNUMA_SO) numa.h numaif.h numacompat1.h numastat ${MANPAGES}
 	mkdir -p ${prefix}/bin
 	install -m 0755 numactl ${prefix}/bin
 	install -m 0755 migratepages ${prefix}/bin
@@ -135,8 +137,8 @@ install: numactl migratepages migspeed n
 	install -m 0644 numa.3 ${prefix}/share/man/man3
 	( cd ${prefix}/share/man/man3 ; for i in $$(./manlinks) ; do ln -sf numa.3 $$i.3 ; done )
 	mkdir -p ${libdir}
-	install -m 0755 libnuma.so.1 ${libdir}
-	cd ${libdir} ; ln -sf libnuma.so.1 libnuma.so
+	install -m 0755 $(LIBNUMA_SO) ${libdir}
+	cd ${libdir} ; ln -sf $(LIBNUMA_SO) libnuma.so
 	install -m 0644 libnuma.a ${libdir}
 	mkdir -p ${prefix}/include
 	install -m 0644 numa.h numaif.h numacompat1.h ${prefix}/include

  parent reply	other threads:[~2009-04-28 16:37 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-04-28 16:36 [PATCH 0/8] numactl/libnuma - Fixes and Cleanup Lee Schermerhorn
2009-04-28 16:36 ` [PATCH 1/8] numactl/libnuma - Possibly already fixed leaks and cleanup Lee Schermerhorn
2009-04-28 16:36 ` [PATCH 2/8] numactl/libnuma - Simple bitmask leak fixes Lee Schermerhorn
2009-04-28 16:36 ` [PATCH 3/8] numactl/libnuma - more " Lee Schermerhorn
2009-04-28 16:36 ` [PATCH 4/8] numactl/libnuma - return freeable bitmasks Lee Schermerhorn
2009-04-28 16:36 ` [PATCH 5/8] numactl/libnuma - fix parsing of cpu, node mask Lee Schermerhorn
2009-04-28 16:36 ` [PATCH 6/8] numactl/numademo - eliminate page allocation overhead from memtest measurements Lee Schermerhorn
2009-04-28 16:37 ` Lee Schermerhorn [this message]
2009-04-28 16:46   ` [PATCH 7/8] numactl/Makefile - Generalize Makefile .so Version Andi Kleen
2009-04-28 17:01     ` Lee Schermerhorn
2009-04-28 17:10       ` Andi Kleen
2009-04-28 16:37 ` [PATCH 8/8] numactl/test - Make checkaffinity more robust Lee Schermerhorn
2009-04-28 19:38 ` [PATCH 0/8] numactl/libnuma - Fixes and Cleanup Cliff Wickman
2009-04-28 20:08   ` Lee Schermerhorn

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20090428163702.24945.41315.sendpatchset@localhost.localdomain \
    --to=lee.schermerhorn@hp.com \
    --cc=Brice.Goglin@inria.fr \
    --cc=cpi@sgi.com \
    --cc=eric.whitney@hp.com \
    --cc=kkourt@cslab.ece.ntua.gr \
    --cc=linux-numa@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.