Make.defs 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  1. ############################################################################
  2. # boards/mips/pic32mx/pic32mx7mmb/scripts/Make.defs
  3. #
  4. # Copyright (C) 2012, 2017 Gregory Nutt. All rights reserved.
  5. # Author: Gregory Nutt <gnutt@nuttx.org>
  6. #
  7. # Redistribution and use in source and binary forms, with or without
  8. # modification, are permitted provided that the following conditions
  9. # are met:
  10. #
  11. # 1. Redistributions of source code must retain the above copyright
  12. # notice, this list of conditions and the following disclaimer.
  13. # 2. Redistributions in binary form must reproduce the above copyright
  14. # notice, this list of conditions and the following disclaimer in
  15. # the documentation and/or other materials provided with the
  16. # distribution.
  17. # 3. Neither the name NuttX nor the names of its contributors may be
  18. # used to endorse or promote products derived from this software
  19. # without specific prior written permission.
  20. #
  21. # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  22. # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  23. # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
  24. # FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
  25. # COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
  26. # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
  27. # BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
  28. # OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
  29. # AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  30. # LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
  31. # ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
  32. # POSSIBILITY OF SUCH DAMAGE.
  33. #
  34. ############################################################################
  35. include ${TOPDIR}/.config
  36. include ${TOPDIR}/tools/Config.mk
  37. include ${TOPDIR}/arch/mips/src/mips32/Toolchain.defs
  38. ifeq ($(CONFIG_MIPS32_TOOLCHAIN_GNU_ELF),y)
  39. LDSCRIPT = mips-release.ld
  40. endif
  41. ifeq ($(CONFIG_MIPS32_TOOLCHAIN_PINGUINOW),y)
  42. LDSCRIPT = mips-release.ld
  43. endif
  44. ifeq ($(CONFIG_MIPS32_TOOLCHAIN_MICROCHIPW),y)
  45. LDSCRIPT = c32-release.ld
  46. endif
  47. ifeq ($(CONFIG_MIPS32_TOOLCHAIN_MICROCHIPW_LITE),y)
  48. LDSCRIPT = c32-release.ld
  49. endif
  50. ifeq ($(WINTOOL),y)
  51. # Windows-native toolchains
  52. DIRLINK = $(TOPDIR)/tools/copydir.sh
  53. DIRUNLINK = $(TOPDIR)/tools/unlink.sh
  54. MKDEP = $(TOPDIR)/tools/mkwindeps.sh
  55. ARCHINCLUDES = -I. -isystem "${shell cygpath -w $(TOPDIR)/include}"
  56. ARCHXXINCLUDES = -I. -isystem "${shell cygpath -w $(TOPDIR)/include}" -isystem "${shell cygpath -w $(TOPDIR)/include/cxx}"
  57. ARCHSCRIPT = -T "${shell cygpath -w $(TOPDIR)/boards/$(CONFIG_ARCH)/$(CONFIG_ARCH_CHIP)/$(CONFIG_ARCH_BOARD)/scripts/$(LDSCRIPT)}"
  58. else
  59. # Linux/Cygwin-native toolchain
  60. MKDEP = $(TOPDIR)/tools/mkdeps$(HOSTEXEEXT)
  61. ARCHINCLUDES = -I. -isystem $(TOPDIR)/include
  62. ARCHXXINCLUDES = -I. -isystem $(TOPDIR)/include -isystem $(TOPDIR)/include/cxx
  63. ARCHSCRIPT = -T$(TOPDIR)/boards/$(CONFIG_ARCH)/$(CONFIG_ARCH_CHIP)/$(CONFIG_ARCH_BOARD)/scripts/$(LDSCRIPT)
  64. endif
  65. CC = $(CROSSDEV)gcc
  66. CXX = $(CROSSDEV)g++
  67. CPP = $(CROSSDEV)gcc -E
  68. LD = $(CROSSDEV)ld
  69. STRIP = $(CROSSDEV)strip --strip-unneeded
  70. AR = $(CROSSDEV)ar rcs
  71. NM = $(CROSSDEV)nm
  72. OBJCOPY = $(CROSSDEV)objcopy
  73. OBJDUMP = $(CROSSDEV)objdump
  74. ifeq ($(CONFIG_DEBUG_SYMBOLS),y)
  75. ARCHOPTIMIZATION = -g
  76. endif
  77. ifneq ($(CONFIG_DEBUG_NOOPT),y)
  78. ARCHOPTIMIZATION += $(MAXOPTIMIZATION) -fno-strict-aliasing -fno-strength-reduce -fomit-frame-pointer
  79. endif
  80. ARCHCFLAGS = -fno-builtin
  81. ARCHCXXFLAGS = -fno-builtin -fno-exceptions -fcheck-new
  82. ARCHWARNINGS = -Wall -Wstrict-prototypes -Wshadow -Wundef
  83. ARCHWARNINGSXX = -Wall -Wshadow -Wundef
  84. ARCHDEFINES =
  85. CFLAGS = $(ARCHCFLAGS) $(ARCHWARNINGS) $(ARCHOPTIMIZATION) $(ARCHCPUFLAGS) $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES) -pipe
  86. CPICFLAGS = $(ARCHPICFLAGS) $(CFLAGS)
  87. CXXFLAGS = $(ARCHCXXFLAGS) $(ARCHWARNINGSXX) $(ARCHOPTIMIZATION) $(ARCHCPUFLAGS) $(ARCHXXINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES) -pipe
  88. CXXPICFLAGS = $(ARCHPICFLAGS) $(CXXFLAGS)
  89. CPPFLAGS = $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES)
  90. AFLAGS = $(CFLAGS) -D__ASSEMBLY__
  91. NXFLATLDFLAGS1 = -r -d -warn-common
  92. NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat-gotoff.ld -no-check-sections
  93. LDNXFLATFLAGS = -e main -s 2048
  94. ASMEXT = .S
  95. OBJEXT = .o
  96. LIBEXT = .a
  97. EXEEXT =
  98. HOSTCC = gcc
  99. HOSTINCLUDES = -I.
  100. HOSTCFLAGS = -Wall -Wstrict-prototypes -Wshadow -Wundef -g -pipe
  101. HOSTLDFLAGS =