From f70602be19ff8042c369ea33b29f90b8c0f5d02e Mon Sep 17 00:00:00 2001 From: "Peter S. Mazinger" Date: Wed, 28 Sep 2005 12:34:41 +0000 Subject: Remove ar-target and shared targets, at build time now we traverse the tree only once. Generalize all toplevel makefiles. Make sure, that libdl.so is built against libc.so and not libc.a --- libintl/Makefile | 42 ++++++++++++++++++++++-------------------- 1 file changed, 22 insertions(+), 20 deletions(-) (limited to 'libintl/Makefile') diff --git a/libintl/Makefile b/libintl/Makefile index 8977b5ba9..86a6b8deb 100644 --- a/libintl/Makefile +++ b/libintl/Makefile @@ -26,9 +26,10 @@ include $(TOPDIR)Rules.mak CFLAGS+=$(SSP_ALL_CFLAGS) -LIBINTL=libintl.a -LIBINTL_SHARED=libintl.so -LIBINTL_SHARED_FULLNAME=libintl-$(MAJOR_VERSION).$(MINOR_VERSION).$(SUBLEVEL).so +LIB_NAME=libintl +AR_LIB_NAME=$(TOPDIR)lib/$(LIB_NAME).a +SO_LIB_NAME=$(TOPDIR)lib/$(LIB_NAME).so +SO_FULL_NAME=$(LIB_NAME)-$(MAJOR_VERSION).$(MINOR_VERSION).$(SUBLEVEL).so MSRC= intl.c MOBJ= gettext.o ngettext.o dgettext.o dcgettext.o dngettext.o dcngettext.o \ @@ -37,28 +38,29 @@ MOBJ= gettext.o ngettext.o dgettext.o dcgettext.o dngettext.o dcngettext.o \ OBJS=$(MOBJ) -all: $(LIBINTL) +ifeq ($(strip $(HAVE_SHARED)),y) +all: $(SO_LIB_NAME) +else +all: $(AR_LIB_NAME) +endif -$(LIBINTL) ar-target: $(OBJS) - $(AR) $(ARFLAGS) $(LIBINTL) $(OBJS) +$(AR_LIB_NAME): $(OBJS) $(INSTALL) -d $(TOPDIR)lib - $(RM) $(TOPDIR)lib/$(LIBINTL) - $(INSTALL) -m 644 $(LIBINTL) $(TOPDIR)lib/ + $(RM) $(AR_LIB_NAME) + $(AR) $(ARFLAGS) $(AR_LIB_NAME) $(OBJS) + +$(SO_LIB_NAME): $(AR_LIB_NAME) + $(RM) $(TOPDIR)lib/$(SO_FULL_NAME) $(SO_LIB_NAME).$(MAJOR_VERSION) $(SO_LIB_NAME) + $(LD) $(LDFLAGS) -soname=$(LIB_NAME).so.$(MAJOR_VERSION) \ + -o $(TOPDIR)lib/$(SO_FULL_NAME) --whole-archive $(AR_LIB_NAME) \ + --no-whole-archive $(TOPDIR)libc/misc/internals/interp.o \ + -L$(TOPDIR)lib -lc $(LDADD_LIBFLOAT) $(LIBGCC) + $(LN) -sf $(SO_FULL_NAME) $(SO_LIB_NAME).$(MAJOR_VERSION) + $(LN) -sf $(SO_FULL_NAME) $(SO_LIB_NAME) $(MOBJ): $(MSRC) $(CC) $(CFLAGS) -DL_$* $< -c -o $*.o $(STRIPTOOL) -x -R .note -R .comment $*.o -shared: all - $(LD) $(LDFLAGS) -soname=$(LIBINTL_SHARED).$(MAJOR_VERSION) \ - -o $(LIBINTL_SHARED_FULLNAME) --whole-archive $(LIBINTL) \ - --no-whole-archive $(TOPDIR)libc/misc/internals/interp.o \ - -L$(TOPDIR)lib -lc $(LDADD_LIBFLOAT) $(LIBGCC) - $(INSTALL) -d $(TOPDIR)lib - $(RM) $(TOPDIR)lib/$(LIBINTL_SHARED_FULLNAME) $(TOPDIR)lib/$(LIBINTL_SHARED).$(MAJOR_VERSION) - $(INSTALL) -m 644 $(LIBINTL_SHARED_FULLNAME) $(TOPDIR)lib - $(LN) -sf $(LIBINTL_SHARED_FULLNAME) $(TOPDIR)lib/$(LIBINTL_SHARED) - $(LN) -sf $(LIBINTL_SHARED_FULLNAME) $(TOPDIR)lib/$(LIBINTL_SHARED).$(MAJOR_VERSION) - clean: - $(RM) *.[oa] *~ core $(LIBINTL) $(LIBINTL_SHARED_FULLNAME) + $(RM) *.o *~ core -- cgit v1.2.3