Makefile 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. # Makefile for uClibc
  2. #
  3. # Copyright (C) 2000-2003 Erik Andersen <andersen@uclibc.org>
  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. # Pull in the user's uClibc configuration, but do not
  19. # pull in Rules.mak.....
  20. TOPDIR=../
  21. include $(TOPDIR)Rules.mak
  22. TARGETS = ldd ldconfig readelf
  23. ifeq ($(strip $(UCLIBC_HAS_LOCALE)),y)
  24. TARGET_ICONV = iconv
  25. else
  26. TARGET_ICONV =
  27. endif
  28. # do we really need to reset XXFLAGS?
  29. XXFLAGS=
  30. ifeq ($(strip $(HAVE_SHARED)),y)
  31. all: $(TARGETS) $(TARGET_ICONV)
  32. else
  33. all: $(TARGET_ICONV)
  34. endif
  35. headers:
  36. @$(LN) -fs $(TOPDIR)include/elf.h
  37. readelf: readelf.c
  38. $(CC) $(CFLAGS) -Wl,-s $^ -o $@ $(LDADD_LIBFLOAT) -L../lib
  39. $(STRIPTOOL) -x -R .note -R .comment $@
  40. ldconfig: ldconfig.c readsoname.c
  41. $(CC) $(CFLAGS) $(XXFLAGS) -Wl,-s -static \
  42. -DUCLIBC_RUNTIME_PREFIX=\"$(RUNTIME_PREFIX)\" \
  43. -DUCLIBC_LDSO=$(UCLIBC_LDSO) -I. -I../ldso/include \
  44. $^ -o $@ $(LDADD_LIBFLOAT) -L../lib
  45. $(STRIPTOOL) -x -R .note -R .comment $@
  46. ldd: ldd.c
  47. $(CC) $(CFLAGS) $(XXFLAGS) -Wl,-s \
  48. -DUCLIBC_RUNTIME_PREFIX=\"$(RUNTIME_PREFIX)\" \
  49. -DUCLIBC_LDSO=$(UCLIBC_LDSO) -I. -I../ldso/include \
  50. $^ -o $@ $(LDADD_LIBFLOAT) -L../lib
  51. $(STRIPTOOL) -x -R .note -R .comment $@
  52. iconv: ../libc/misc/wchar/wchar.c
  53. $(CC) $(CFLAGS) -DL_iconv_main ../libc/misc/wchar/wchar.c -o $@ \
  54. $(LDADD_LIBFLOAT) -L../lib
  55. $(STRIPTOOL) -x -R .note -R .comment $@
  56. hostutils: ldd.host ldconfig.host readelf.host
  57. ldd.host: ldd.c
  58. $(HOSTCC) $(HOSTCFLAGS) -Wl,-s \
  59. -DUCLIBC_RUNTIME_PREFIX=\"$(RUNTIME_PREFIX)\" \
  60. -DUCLIBC_LDSO=$(UCLIBC_LDSO) \
  61. $^ -o $@
  62. ldconfig.host: ldconfig.c readsoname.c
  63. $(HOSTCC) $(HOSTCFLAGS) -Wl,-s \
  64. -DUCLIBC_RUNTIME_PREFIX=\"$(RUNTIME_PREFIX)\" \
  65. -DUCLIBC_LDSO=$(UCLIBC_LDSO) -I. -I../ldso/include \
  66. $^ -o $@
  67. readelf.host: readelf.c
  68. $(HOSTCC) $(HOSTCFLAGS) -Wl,-s $^ -o $@
  69. clean:
  70. $(RM) $(TARGETS) *.o *~ core *.target elf.h iconv *.host
  71. readelf.c readsoname.c ldconfig.c ldd.c: headers
  72. install: all
  73. ifeq ($(strip $(HAVE_SHARED)),y)
  74. $(INSTALL) -d $(PREFIX)$(RUNTIME_PREFIX)sbin
  75. $(INSTALL) -d $(PREFIX)$(RUNTIME_PREFIX)usr/bin
  76. $(INSTALL) -m 755 ldd $(PREFIX)$(RUNTIME_PREFIX)usr/bin/ldd
  77. $(INSTALL) -m 755 ldconfig $(PREFIX)$(RUNTIME_PREFIX)sbin/ldconfig;
  78. # For now, don't bother with readelf since surely the host
  79. # system has binutils, or we couldn't have gotten this far...
  80. #$(INSTALL) -m 755 readelf $(PREFIX)$(RUNTIME_PREFIX)usr/bin/readelf
  81. endif
  82. ifeq ($(strip $(UCLIBC_HAS_LOCALE)),y)
  83. $(INSTALL) -m 755 iconv $(PREFIX)$(RUNTIME_PREFIX)usr/bin/iconv
  84. endif