3 # Copyright (C) 2000 by Lineo, inc.
4 # Copyright (C) 2000-2002 Erik Andersen <andersen@uclibc.org>
6 # This program is free software; you can redistribute it and/or modify it under
7 # the terms of the GNU Library General Public License as published by the Free
8 # Software Foundation; either version 2 of the License, or (at your option) any
11 # This program is distributed in the hope that it will be useful, but WITHOUT
12 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
13 # FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more
16 # You should have received a copy of the GNU Library General Public License
17 # along with this program; if not, write to the Free Software Foundation, Inc.,
18 # 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
22 include $(TOPDIR)Rules.mak
24 XXFLAGS+=-DUCLIBC_TARGET_PREFIX=\"$(TARGET_PREFIX)\" \
25 -DUCLIBC_DEVEL_PREFIX=\"$(DEVEL_PREFIX)\" \
26 -DUCLIBC_BUILD_DIR=\"$(shell cd $(TOPDIR) && pwd)\"
27 ifeq ($(strip $(SUPPORT_LD_DEBUG)),y)
28 XXFLAGS+=-D__SUPPORT_LD_DEBUG__
34 LIBDL_SHARED_FULLNAME=libdl-$(MAJOR_VERSION).$(MINOR_VERSION).$(SUBLEVEL).so
40 all: $(OBJS) $(LIBDL) shared
44 ar-target: $(OBJS) $(PIC_OBJS)
45 $(AR) $(ARFLAGS) $(LIBDL) ../ldso/$(TARGET_ARCH)/resolve.o $(OBJS)
46 $(AR) $(ARFLAGS) $(LIBDL_PIC) $(PIC_OBJS)
47 install -d $(TOPDIR)lib
48 rm -f $(TOPDIR)lib/$(LIBDL)
49 install -m 644 $(LIBDL) $(TOPDIR)lib
53 $(CC) -I../ldso -I../ldso/$(TARGET_ARCH) $(CFLAGS_NOPIC) $(XXFLAGS) -c dlib.c -o dlib.o
54 $(STRIPTOOL) -x -R .note -R .comment $*.o
57 $(CC) -I../ldso -I../ldso/$(TARGET_ARCH) $(CFLAGS) -c dlib.c -o dlib_pic.o
58 $(STRIPTOOL) -x -R .note -R .comment $*.o
63 $(LD) $(LDFLAGS) -soname=$(LIBDL_SHARED).$(MAJOR_VERSION) \
64 -o $(LIBDL_SHARED_FULLNAME) --whole-archive $(LIBDL_PIC) \
65 --no-whole-archive $(TOPDIR)/libc/misc/internals/interp.o \
67 install -d $(TOPDIR)lib
68 rm -f $(TOPDIR)lib/$(LIBDL_SHARED_FULLNAME) $(TOPDIR)lib/$(LIBDL_SHARED).$(MAJOR_VERSION)
69 install -m 644 $(LIBDL_SHARED_FULLNAME) $(TOPDIR)lib;
70 (cd $(TOPDIR)lib && ln -sf $(LIBDL_SHARED_FULLNAME) $(LIBDL_SHARED));
71 (cd $(TOPDIR)lib && ln -sf $(LIBDL_SHARED_FULLNAME) $(LIBDL_SHARED).$(MAJOR_VERSION));
74 $(RM) -f .depend $(LIBDL_SHARED)* $(LIBDL_SHARED_FULLNAME) core *.o *.a *.s *.i tmp_make foo *~