OSDN Git Service

I wasn't building the libdl shared lib anymore. Make each lib install a
[uclinux-h8/uClibc.git] / ldso / libdl / Makefile
1 # Makefile for uClibc
2 #
3 # Copyright (C) 2000 by Lineo, inc.
4 #
5 # This program is free software; you can redistribute it and/or modify it under
6 # the terms of the GNU Library General Public License as published by the Free
7 # Software Foundation; either version 2 of the License, or (at your option) any
8 # later version.
9 #
10 # This program is distributed in the hope that it will be useful, but WITHOUT
11 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
12 # FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more
13 # details.
14 #
15 # You should have received a copy of the GNU Library General Public License
16 # along with this program; if not, write to the Free Software Foundation, Inc.,
17 # 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 #
19 # Derived in part from the Linux-8086 C library, the GNU C Library, and several
20 # other sundry sources.  Files within this library are copyright by their
21 # respective copyright holders.
22
23
24 TOPDIR=../../
25 include $(TOPDIR)/ldso/Rules.mak
26
27 LIBDL=libdl.a
28 LIBDL_SHARED=libdl.so
29 LIBDL_SHARED_FULLNAME=libdl-$(MAJOR_VERSION).$(MINOR_VERSION).so
30 TARGET_CC= $(TOPDIR)extra/gcc-uClibc/$(TARGET_ARCH)-uclibc-gcc
31
32 CSRC= dlib.c
33 OBJS=$(patsubst %.c,%.o, $(CSRC))
34
35 CFLAGS += -DUSE_CACHE #-fPIC -D__PIC__ #-funroll-loops
36
37 all: $(OBJS) $(LIBDL) shared
38
39 $(LIBDL): ar-target
40
41 ar-target: $(OBJS)
42         $(AR) $(ARFLAGS) $(LIBDL) $(OBJS)
43         #install -d $(TOPDIR)lib
44         #rm -f $(TOPDIR)lib/$(LIBDL)
45         #install -m 644 $(LIBDL) $(TOPDIR)lib
46
47 $(OBJS): %.o : %.c
48         $(TARGET_CC) -I../d-link -I../d-link/$(TARGET_ARCH) $(CFLAGS) -c $< -o $@
49         $(STRIPTOOL) -x -R .note -R .comment $*.o
50
51 $(OBJ): Makefile
52
53 shared: all
54         $(TARGET_CC) $(LDFLAGS) -shared -o $(LIBDL_SHARED_FULLNAME) \
55             -Wl,-soname,$(LIBDL_SHARED).$(MAJOR_VERSION) -Wl,--whole-archive \
56             $(LIBDL) $(TOPDIR)lib/$(SHARED_FULLNAME)
57         install -d $(TOPDIR)lib
58         rm -f $(TOPDIR)lib/$(LIBDL_SHARED_FULLNAME) $(TOPDIR)lib/$(LIBDL_SHARED).$(MAJOR_VERSION)
59         install -m 644 $(LIBDL_SHARED_FULLNAME) $(TOPDIR)lib;
60         (cd $(TOPDIR)lib; ln -sf $(LIBDL_SHARED_FULLNAME) $(LIBDL_SHARED)); 
61         (cd $(TOPDIR)lib; ln -sf $(LIBDL_SHARED_FULLNAME) $(LIBDL_SHARED).$(MAJOR_VERSION)); 
62
63 clean:
64         $(RM) -f .depend $(LIBDL_SHARED)* $(LIBDL_SHARED_FULLNAME) core *.o *.a *.s *.i tmp_make foo *~
65