Makefile.in 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  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 := $(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. HOSTCFLAGS-utils := -include $(top_srcdir)include/elf.h
  20. HOSTCFLAGS-utils-common := $(CFLAGS-utils-common)
  21. ifeq ($(LDSO_CACHE_SUPPORT),y)
  22. HOSTCFLAGS-utils-common += -D__LDSO_CACHE_SUPPORT__=1
  23. endif
  24. HOSTCFLAGS-ldconfig.host := $(HOSTCFLAGS-utils-common)
  25. HOSTCFLAGS-ldd.host := $(HOSTCFLAGS-utils-common) -D_GNU_SOURCE
  26. NATIVE_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.c: $(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. # to be removed after included by main Makefile.in
  51. install: install_utils
  52. clean: utils_clean
  53. install-y += install_utils
  54. install_utils: utils
  55. $(INSTALL) -d $(PREFIX)$(RUNTIME_PREFIX)usr/bin
  56. #$(INSTALL) -m 755 $(utils_OUT)/readelf $(PREFIX)$(RUNTIME_PREFIX)usr/bin/readelf
  57. ifeq ($(HAVE_SHARED),y)
  58. $(INSTALL) -d $(PREFIX)$(RUNTIME_PREFIX)sbin
  59. $(INSTALL) -m 755 $(utils_OUT)/ldd $(PREFIX)$(RUNTIME_PREFIX)usr/bin/ldd
  60. $(INSTALL) -m 755 $(utils_OUT)/ldconfig $(PREFIX)$(RUNTIME_PREFIX)sbin/ldconfig
  61. endif
  62. ifeq ($(UCLIBC_HAS_LOCALE),y)
  63. $(INSTALL) -m 755 $(utils_OUT)/iconv $(PREFIX)$(RUNTIME_PREFIX)usr/bin/iconv
  64. endif
  65. objclean-y += utils_clean
  66. utils_clean:
  67. $(RM) $(utils_OUT)/{ldconfig,ldd,readelf,iconv,*.host}