3 # Copyright (C) 2000-2003 Erik Andersen <andersen@uclibc.org>
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 # Pull in the user's uClibc configuration, but do not
20 # pull in Rules.mak.....
22 include $(TOPDIR)Rules.mak
24 TARGETS = ldd ldconfig readelf
26 ifeq ($(strip $(UCLIBC_HAS_LOCALE)),y)
32 # do we really need to reset XXFLAGS?
35 ifeq ($(strip $(HAVE_SHARED)),y)
36 all: $(TARGETS) $(TARGET_ICONV)
42 @$(LN) -fs $(TOPDIR)include/elf.h
45 $(CC) $(CFLAGS) -Wl,-s $^ -o $@ $(LDADD_LIBFLOAT) -L../lib
46 $(STRIPTOOL) -x -R .note -R .comment $@
48 ldconfig: ldconfig.c readsoname.c
49 $(CC) $(CFLAGS) $(XXFLAGS) -Wl,-s -static \
50 -DUCLIBC_RUNTIME_PREFIX=\"$(RUNTIME_PREFIX)\" \
51 -DUCLIBC_LDSO=$(UCLIBC_LDSO) -I. -I../ldso/include \
52 -nostdlib -o $@ $(STATIC_BIN_START_FILES) $^ $(LDADD_LIBFLOAT) \
53 -L../lib -lc $(LIBGCC) $(STATIC_BIN_END_FILES)
54 $(STRIPTOOL) -x -R .note -R .comment $@
57 $(CC) $(CFLAGS) $(XXFLAGS) $(PIEFLAG) $(LDPIEFLAG) -Wl,-s \
58 -DUCLIBC_RUNTIME_PREFIX=\"$(RUNTIME_PREFIX)\" \
59 -DUCLIBC_LDSO=$(UCLIBC_LDSO) -I. -I../ldso/include \
60 -nostdlib -o $@ $(BIN_START_FILES) $^ $(LDADD_LIBFLOAT) \
61 -L../lib -lc $(LIBGCC) $(END_FILES)
62 $(STRIPTOOL) -x -R .note -R .comment $@
64 iconv: ../libc/misc/wchar/wchar.c
65 $(CC) $(CFLAGS) $(XXFLAGS) $(PIEFLAG) $(LDPIEFLAG) -Wl,-s -DL_iconv_main \
66 -nostdlib -o $@ $(BIN_START_FILES) $^ $(LDADD_LIBFLOAT) \
67 -L../lib -lc $(LIBGCC) $(END_FILES)
68 $(STRIPTOOL) -x -R .note -R .comment $@
70 hostutils: ldd.host ldconfig.host readelf.host
73 $(HOSTCC) $(HOSTCFLAGS) -Wl,-s \
74 -DUCLIBC_RUNTIME_PREFIX=\"$(RUNTIME_PREFIX)\" \
75 -DUCLIBC_LDSO=$(UCLIBC_LDSO) -I. -I../ldso/include \
78 ldconfig.host: ldconfig.c readsoname.c
79 $(HOSTCC) $(HOSTCFLAGS) -Wl,-s \
80 -DUCLIBC_RUNTIME_PREFIX=\"$(RUNTIME_PREFIX)\" \
81 -DUCLIBC_LDSO=$(UCLIBC_LDSO) -I. -I../ldso/include \
84 readelf.host: readelf.c
85 $(HOSTCC) $(HOSTCFLAGS) -Wl,-s $^ -o $@
88 $(RM) $(TARGETS) *.o *~ core *.target elf.h iconv *.host
91 readelf.c readsoname.c ldconfig.c ldd.c: headers
94 ifeq ($(strip $(HAVE_SHARED)),y)
95 $(INSTALL) -d $(PREFIX)$(RUNTIME_PREFIX)sbin
96 $(INSTALL) -d $(PREFIX)$(RUNTIME_PREFIX)usr/bin
97 $(INSTALL) -m 755 ldd $(PREFIX)$(RUNTIME_PREFIX)usr/bin/ldd
98 $(INSTALL) -m 755 ldconfig $(PREFIX)$(RUNTIME_PREFIX)sbin/ldconfig;
99 # For now, don't bother with readelf since surely the host
100 # system has binutils, or we couldn't have gotten this far...
101 #$(INSTALL) -m 755 readelf $(PREFIX)$(RUNTIME_PREFIX)usr/bin/readelf
103 ifeq ($(strip $(UCLIBC_HAS_LOCALE)),y)
104 $(INSTALL) -m 755 iconv $(PREFIX)$(RUNTIME_PREFIX)usr/bin/iconv