Makefile 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  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. XXFLAGS=
  29. ifeq ($(strip $(LDSO_LDD_SUPPORT)),y)
  30. XXFLAGS= -D__LDSO_LDD_SUPPORT
  31. else
  32. XXFLAGS=
  33. endif
  34. ifeq ($(strip $(HAVE_SHARED)),y)
  35. all: $(TARGETS) $(TARGET_ICONV)
  36. else
  37. all: $(TARGET_ICONV)
  38. endif
  39. headers:
  40. $(LN) -fs $(TOPDIR)include/elf.h
  41. readelf: readelf.c
  42. $(CC) $(CFLAGS) -Wl,-s $^ -o $@ $(LDADD_LIBFLOAT) -L../lib
  43. $(STRIPTOOL) -x -R .note -R .comment $@
  44. ldconfig: ldconfig.c readsoname.c
  45. $(CC) $(CFLAGS) $(XXFLAGS) -Wl,-s -static \
  46. -DUCLIBC_RUNTIME_PREFIX=$(R_PREFIX) \
  47. -DUCLIBC_LDSO=$(UCLIBC_LDSO) -I. -I../ldso/include \
  48. $^ -o $@ $(LDADD_LIBFLOAT) -L../lib
  49. $(STRIPTOOL) -x -R .note -R .comment $@
  50. ldd: ldd.c
  51. $(CC) $(CFLAGS) $(XXFLAGS) -Wl,-s \
  52. -DUCLIBC_RUNTIME_PREFIX=$(R_PREFIX) \
  53. -DUCLIBC_LDSO=$(UCLIBC_LDSO) \
  54. $^ -o $@ $(LDADD_LIBFLOAT) -L../lib
  55. $(STRIPTOOL) -x -R .note -R .comment $@
  56. iconv: ../libc/misc/wchar/wchar.c
  57. $(CC) $(CFLAGS) -DL_iconv_main ../libc/misc/wchar/wchar.c -o $@ \
  58. $(LDADD_LIBFLOAT) -L../lib
  59. $(STRIPTOOL) -x -R .note -R .comment $@
  60. clean:
  61. $(RM) $(TARGETS) *.o *~ core *.target elf.h iconv
  62. readelf.c readsoname.c ldconfig.c ldd.c: headers
  63. install: all
  64. ifeq ($(strip $(HAVE_SHARED)),y)
  65. $(INSTALL) -d $(PREFIX)$(RUNTIME_PREFIX)sbin
  66. $(INSTALL) -d $(PREFIX)$(RUNTIME_PREFIX)usr/bin
  67. $(INSTALL) -m 755 ldd $(PREFIX)$(RUNTIME_PREFIX)usr/bin/ldd
  68. $(INSTALL) -m 755 ldconfig $(PREFIX)$(RUNTIME_PREFIX)sbin/ldconfig;
  69. # For now, don't bother with readelf since surely the host
  70. # system has binutils, or we couldn't have gotten this far...
  71. #$(INSTALL) -m 755 readelf $(PREFIX)$(RUNTIME_PREFIX)usr/bin/readelf
  72. endif
  73. ifeq ($(strip $(UCLIBC_HAS_LOCALE)),y)
  74. $(INSTALL) -m 755 iconv $(PREFIX)$(RUNTIME_PREFIX)usr/bin/iconv
  75. endif