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
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
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
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.
24 include $(TOPDIR)Rules.mak
25 TARGET_CC = $(TOPDIR)extra/gcc-uClibc/$(TARGET_ARCH)-uclibc-gcc
27 TARGETS = ldd ldconfig
28 ifeq ($(OSTYPE),linux)
31 #ifneq ($(strip $(LIBRARY_CACHE)),)
35 ifeq ($(strip $(LDSO_LDD_SUPPORT)),y)
36 XXFLAGS = -D__LDSO_LDD_SUPPORT
42 $(LN) -fs $(TOPDIR)include/elf.h
45 $(HOSTCC) $(HOSTCFLAGS) -I. -I../include $^ -o $@
46 strip -x -R .note -R .comment $@
48 readelf.target: readelf.c
49 $(TARGET_CC) $(CFLAGS) -Wl,-s $^ -o $@ $(LDADD_LIBFLOAT)
50 $(STRIPTOOL) -x -R .note -R .comment $@
52 readsoname.o: readsoname.c readsoname2.c
53 $(HOSTCC) $(HOSTCFLAGS) -I. -I../include -c $< -o $@
54 strip -x -R .note -R .comment $*.o
56 #ldconfig.o: ldconfig.c
57 # $(HOSTCC) $(HOSTCFLAGS) -I. -I../include \
58 # -DUCLIBC_TARGET_PREFIX=\"$(TARGET_PREFIX)\" -c $< -o $@
59 # strip -x -R .note -R .comment $*.o
61 #ldconfig: ldconfig.o readsoname.o
62 # $(HOSTCC) $(HOSTCFLAGS) $^ -o $@
63 # strip -x -R .note -R .comment $@
65 ldconfig: ldconfig.c readsoname.c
66 $(HOSTCC) $(HOSTCFLAGS) $(XXFLAGS) -DUCLIBC_TARGET_PREFIX=\"$(TARGET_PREFIX)\" \
67 -DUCLIBC_DEVEL_PREFIX=\"$(DEVEL_PREFIX)\" \
68 -DUCLIBC_BUILD_DIR=\"$(shell cd $(TOPDIR) && pwd)\" \
69 -DUCLIBC_LDSO=\"$(UCLIBC_LDSO)\" -I. -I../include \
71 strip -x -R .note -R .comment $@
73 ldconfig.target: ldconfig.c readsoname.c
74 $(TARGET_CC) $(CFLAGS) $(XXFLAGS) -Wl,-s -DUCLIBC_TARGET_PREFIX=\"$(TARGET_PREFIX)\" \
75 -DUCLIBC_DEVEL_PREFIX=\"$(DEVEL_PREFIX)\" \
76 -DUCLIBC_BUILD_DIR=\"$(shell cd $(TOPDIR) && pwd)\" \
77 -DUCLIBC_LDSO=\"$(UCLIBC_LDSO)\" -I. -I../include \
78 $^ -o $@ $(LDADD_LIBFLOAT)
79 $(STRIPTOOL) -x -R .note -R .comment $@
82 $(HOSTCC) $(HOSTCFLAGS) $(XXFLAGS) -DUCLIBC_TARGET_PREFIX=\"$(TARGET_PREFIX)\" \
83 -DUCLIBC_DEVEL_PREFIX=\"$(DEVEL_PREFIX)\" \
84 -DUCLIBC_BUILD_DIR=\"$(shell cd $(TOPDIR) && pwd)\" \
85 -DUCLIBC_LDSO=\"$(UCLIBC_LDSO)\" -I. -I../include \
87 strip -x -R .note -R .comment $@
90 $(TARGET_CC) $(CFLAGS) $(XXFLAGS) -Wl,-s -DUCLIBC_TARGET_PREFIX=\"$(TARGET_PREFIX)\" \
91 -DUCLIBC_DEVEL_PREFIX=\"$(DEVEL_PREFIX)\" \
92 -DUCLIBC_BUILD_DIR=\"$(shell cd $(TOPDIR) && pwd)\" \
93 -DUCLIBC_LDSO=\"$(UCLIBC_LDSO)\" \
94 $^ -o $@ $(LDADD_LIBFLOAT)
95 $(STRIPTOOL) -x -R .note -R .comment $@
98 $(RM) $(TARGETS) *.o *~ core *.target elf.h
100 readelf.c readsoname.c ldconfig.c ldd.c: headers