1
0

Makefile 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. # This file is part of the OpenADK project. OpenADK is copyrighted
  2. # material, please see the LICENCE file in the top-level directory.
  3. _IN_CVTC= 1
  4. include $(TOPDIR)/rules.mk
  5. include ../rules.mk
  6. include Makefile.inc
  7. include ${TOPDIR}/mk/buildhlp.mk
  8. #workaround for mips and gcc 4.4, where -Os does not inline code in ld.so
  9. ifeq ($(ARCH),mips)
  10. TARGET_CFLAGS:=$(subst Os,O2,$(TARGET_CFLAGS))
  11. endif
  12. #workaround for cris and gcc 4.4, where -Os generates ICE
  13. ifeq ($(ARCH),cris)
  14. TARGET_CFLAGS:=$(subst Os,O2,$(TARGET_CFLAGS))
  15. endif
  16. $(WRKBUILD)/.headers:
  17. $(SED) 's,^CROSS=.*,CROSS=$(TARGET_CROSS),g' $(WRKBUILD)/Rules.mak
  18. sed -e 's^KERNEL_HEADERS.*$$KERNEL_HEADERS=\"${TOOLCHAIN_SYSROOT}/usr/include\"' \
  19. $(TOPDIR)/target/$(ADK_TARGET)/uclibc.config >${WRKBUILD}/.config
  20. ifneq ($(ADK_DEBUG),)
  21. $(SED) 's,DOSTRIP,DODEBUG,' ${WRKBUILD}/.config
  22. endif
  23. $(MAKE) -C $(WRKBUILD) \
  24. PREFIX=$(TOOLCHAIN_SYSROOT) \
  25. DEVEL_PREFIX=/usr/ \
  26. RUNTIME_PREFIX=$(TOOLCHAIN_SYSROOT) \
  27. HOSTCC="$(HOSTCC)" \
  28. CPU_CFLAGS="$(TARGET_CFLAGS)" \
  29. install_headers
  30. touch $(WRKBUILD)/.configured
  31. touch $@
  32. $(WRKBUILD)/.compiled:
  33. $(MAKE) -C $(WRKBUILD) \
  34. PREFIX= \
  35. DEVEL_PREFIX=/ \
  36. RUNTIME_PREFIX=/ \
  37. HOSTCC="$(HOSTCC)" \
  38. CPU_CFLAGS="$(TARGET_CFLAGS)" \
  39. all
  40. touch $@
  41. $(WRKBUILD)/.install_headers: $(WRKBUILD)/.compiled
  42. $(MAKE) -C $(WRKBUILD) \
  43. PREFIX=$(STAGING_DIR) \
  44. DEVEL_PREFIX=/usr/ \
  45. DEVEL_PREFIX_LIB=/ \
  46. RUNTIME_PREFIX=/ \
  47. CPU_CFLAGS="$(TARGET_CFLAGS)" \
  48. install_dev
  49. touch $@
  50. $(WRKBUILD)/.installed: $(WRKBUILD)/.install_headers
  51. $(MAKE) -C $(WRKBUILD) \
  52. PREFIX=$(STAGING_DIR) \
  53. DEVEL_PREFIX=/usr/ \
  54. DEVEL_PREFIX_LIB=/ \
  55. RUNTIME_PREFIX=/ \
  56. CPU_CFLAGS="$(TARGET_CFLAGS)" \
  57. install_runtime
  58. rm -rf $(STAGING_DIR)/lib/libc.so
  59. ln -s libc.so.0 $(STAGING_DIR)/lib/libc.so
  60. touch $@
  61. include ${TOPDIR}/mk/toolchain.mk