Makefile.in 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. # Makefile for uClibc
  2. #
  3. # Copyright (C) 2000-2005 Erik Andersen <andersen@uclibc.org>
  4. #
  5. # Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
  6. #
  7. CFLAGS-utils := -DNOT_IN_libc $(SSP_ALL_CFLAGS) -B$(top_builddir)lib
  8. CFLAGS-utils-common := -I$(top_srcdir)ldso/include -DUCLIBC_RUNTIME_PREFIX=\"$(RUNTIME_PREFIX)\" -DUCLIBC_LDSO=$(UCLIBC_LDSO)
  9. CFLAGS-utils-shared := $(PIEFLAG) $(LDPIEFLAG)
  10. CFLAGS-ldconfig := $(CFLAGS-utils-common)
  11. ifeq ($(UCLIBC_STATIC_LDCONFIG),y)
  12. CFLAGS-ldconfig += -static
  13. else
  14. CFLAGS-ldconfig += $(CFLAGS-utils-shared)
  15. endif
  16. CFLAGS-ldd := $(CFLAGS-utils-common) $(CFLAGS-utils-shared) -D_GNU_SOURCE
  17. CFLAGS-iconv := $(CFLAGS-utils-shared) -DL_iconv_main
  18. CFLAGS-readelf := $(CFLAGS-utils-shared)
  19. BUILD_CFLAGS-utils := -include $(top_srcdir)include/elf.h
  20. BUILD_CFLAGS-utils-common := $(CFLAGS-utils-common)
  21. ifeq ($(LDSO_CACHE_SUPPORT),y)
  22. BUILD_CFLAGS-utils-common += -D__LDSO_CACHE_SUPPORT__=1
  23. endif
  24. BUILD_CFLAGS-ldconfig.host := $(BUILD_CFLAGS-utils-common)
  25. BUILD_CFLAGS-ldd.host := $(BUILD_CFLAGS-utils-common) -D_GNU_SOURCE
  26. BUILD_LDFLAGS-utils := -Wl,-s
  27. utils_DIR := $(top_srcdir)utils
  28. utils_OUT := $(top_builddir)utils
  29. DEPS-ldconfig := $(utils_DIR)/chroot_realpath.c
  30. DEPS-ldconfig.host := $(DEPS-ldconfig)
  31. utils_OBJ := readelf
  32. ifeq ($(HAVE_SHARED),y)
  33. utils_OBJ += ldconfig ldd
  34. endif
  35. utils_ICONV_OBJ =
  36. ifeq ($(UCLIBC_HAS_LOCALE),y)
  37. utils_ICONV_OBJ := $(utils_OUT)/iconv
  38. endif
  39. utils_OBJ := $(patsubst %,$(utils_OUT)/%,$(utils_OBJ))
  40. hostutils_OBJ := $(patsubst %,%.host,$(utils_OBJ))
  41. utils: $(utils_OBJ) $(utils_ICONV_OBJ)
  42. # NOTE: We build the utils AFTER we have a uClibc-targeted toolchain.
  43. $(utils_OBJ): $(utils_OUT)/% : $(utils_DIR)/%.c | $(libc)
  44. $(compile.u)
  45. $(utils_OUT)/iconv: $(top_srcdir)libc/misc/wchar/wchar.c | $(libc)
  46. $(compile.u)
  47. hostutils: $(hostutils_OBJ)
  48. $(hostutils_OBJ): $(utils_OUT)/%.host : $(utils_DIR)/%.c
  49. $(hcompile.u)
  50. install-y += utils_install
  51. utils_install: utils
  52. $(INSTALL) -d $(PREFIX)$(RUNTIME_PREFIX)usr/bin
  53. #$(INSTALL) -m 755 $(utils_OUT)/readelf $(PREFIX)$(RUNTIME_PREFIX)usr/bin/readelf
  54. ifeq ($(HAVE_SHARED),y)
  55. $(INSTALL) -d $(PREFIX)$(RUNTIME_PREFIX)sbin
  56. $(INSTALL) -m 755 $(utils_OUT)/ldd $(PREFIX)$(RUNTIME_PREFIX)usr/bin/ldd
  57. $(INSTALL) -m 755 $(utils_OUT)/ldconfig $(PREFIX)$(RUNTIME_PREFIX)sbin/ldconfig
  58. endif
  59. ifeq ($(UCLIBC_HAS_LOCALE),y)
  60. $(INSTALL) -m 755 $(utils_OUT)/iconv $(PREFIX)$(RUNTIME_PREFIX)usr/bin/iconv
  61. endif
  62. objclean-y += utils_clean
  63. utils_clean:
  64. $(RM) $(utils_OUT)/{ldconfig,ldd,readelf,iconv,*.host}