aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2007-07-15 16:02:21 -0400
committerNishanth Aravamudan <nacc@us.ibm.com>2007-07-16 09:51:48 -0700
commit611685eae6f8678c4690c6406ee22f29256a0584 (patch)
tree15c1a06888991825ac821a922fe8af6e8f0ad3d1 /Makefile
parentcb57d54c0f12d1244d2f86c0ca01ef7220fb19d6 (diff)
downloadlibhugetlbfs-611685eae6f8678c4690c6406ee22f29256a0584.tar.gz
touchup libhugetlbfs Makefile1.2-pre1
Update the Makefile to: - respect env CFLAGS/LDFLAGS/CPPFLAGS - add proper SONAME to shared libs * quoting Mike: "so to answer your question simply, at this very moment in time, because of the way ld behaves (it will guess a SONAME if you dont encode one), linking with -Wl,-soname gains you nothing except it makes some automatic ELF QA checkers not warn. down the road, it will be needed if you start using ABI numbers if the filename. [Ed: e.g. libhugetlbfs.so.1.0, libhugetlbfs.so.1]" - make "install" target depend on "libs", not "all" otherwise test gets forced ... this allows package maintainers to split the test/install steps up properly in their distribution Signed-off-by: Mike Frysinger <vapier@gentoo.org> Signed-off-by: Nishanth Aravamudan <nacc@us.ibm.com>
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile13
1 files changed, 7 insertions, 6 deletions
diff --git a/Makefile b/Makefile
index ceda969..9bae027 100644
--- a/Makefile
+++ b/Makefile
@@ -12,9 +12,10 @@ NODEPTARGETS=<version.h> <clean>
INSTALL = install
-LDFLAGS = --no-undefined-version -Wl,--version-script=version.lds
-CFLAGS = -O2 -Wall -fPIC -g
-CPPFLAGS = -D__LIBHUGETLBFS__
+LDFLAGS += --no-undefined-version -Wl,--version-script=version.lds
+CFLAGS ?= -O2 -g
+CFLAGS += -Wall -fPIC
+CPPFLAGS += -D__LIBHUGETLBFS__
ARCH = $(shell uname -m | sed -e s/i.86/i386/)
@@ -187,11 +188,11 @@ obj64/libhugetlbfs.a: $(LIBOBJS64)
obj32/libhugetlbfs.so: $(LIBOBJS32)
@$(VECHO) LD32 "(shared)" $@
- $(CC32) $(LDFLAGS) -shared -o $@ $^ $(LDLIBS)
+ $(CC32) $(LDFLAGS) -Wl,-soname,$@ -shared -o $@ $^ $(LDLIBS)
obj64/libhugetlbfs.so: $(LIBOBJS64)
@$(VECHO) LD64 "(shared)" $@
- $(CC64) $(LDFLAGS) -shared -o $@ $^ $(LDLIBS)
+ $(CC64) $(LDFLAGS) -Wl,-soname,$@ -shared -o $@ $^ $(LDLIBS)
obj32/%.i: %.c
@$(VECHO) CPP $@
@@ -242,7 +243,7 @@ objscript.%: %
@$(VECHO) OBJSCRIPT $*
sed "s!### SET DEFAULT LDSCRIPT PATH HERE ###!HUGETLB_LDSCRIPT_PATH=$(LDSCRIPTDIR)!" < $< > $@
-install: all $(OBJDIRS:%=%/install) $(INSTALL_OBJSCRIPT:%=objscript.%)
+install: libs $(OBJDIRS:%=%/install) $(INSTALL_OBJSCRIPT:%=objscript.%)
@$(VECHO) INSTALL
$(INSTALL) -d $(DESTDIR)$(LDSCRIPTDIR)
$(INSTALL) -m 644 $(INSTALL_LDSCRIPTS:%=ldscripts/%) $(DESTDIR)$(LDSCRIPTDIR)