config.mk 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. #-------------------------------------------------------------------------------
  2. # Copyright (c) 2012 Freescale Semiconductor, Inc.
  3. # All rights reserved.
  4. #
  5. # Redistribution and use in source and binary forms, with or without modification,
  6. # are permitted provided that the following conditions are met:
  7. #
  8. # o Redistributions of source code must retain the above copyright notice, this list
  9. # of conditions and the following disclaimer.
  10. #
  11. # o Redistributions in binary form must reproduce the above copyright notice, this
  12. # list of conditions and the following disclaimer in the documentation and/or
  13. # other materials provided with the distribution.
  14. #
  15. # o Neither the name of Freescale Semiconductor, Inc. nor the names of its
  16. # contributors may be used to endorse or promote products derived from this
  17. # software without specific prior written permission.
  18. #
  19. # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
  20. # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
  21. # WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
  22. # DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
  23. # ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
  24. # (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
  25. # LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
  26. # ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  27. # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
  28. # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  29. #-------------------------------------------------------------------------------
  30. #-------------------------------------------------------------------------------
  31. # Target and board configuration
  32. #-------------------------------------------------------------------------------
  33. # Handle lower-case versions of the config variables. These are really meant to ease
  34. # manual invocation of make via the command line.
  35. ifdef target
  36. TARGET = $(target)
  37. endif
  38. ifdef board
  39. BOARD = $(board)
  40. endif
  41. ifdef boardrev
  42. BOARD_REVISION = $(boardrev)
  43. endif
  44. # Target
  45. ifeq "$(TARGET)" "mx6dq"
  46. DEFINES += -DCHIP_MX6DQ
  47. CPU = cortex-a9
  48. else ifeq "$(TARGET)" "mx6sdl"
  49. DEFINES += -DCHIP_MX6SDL
  50. CPU = cortex-a9
  51. else ifeq "$(TARGET)" "mx6sl"
  52. DEFINES += -DCHIP_MX6SL
  53. CPU = cortex-a9
  54. else ifdef TARGET
  55. $(error Unknown target $(TARGET))
  56. endif
  57. # Board
  58. ifeq "$(BOARD)" "evb"
  59. DEFINES += -DBOARD_EVB
  60. else ifeq "$(BOARD)" "evk"
  61. DEFINES += -DBOARD_EVK
  62. else ifeq "$(BOARD)" "sabre_ai"
  63. DEFINES += -DBOARD_SABRE_AI
  64. else ifeq "$(BOARD)" "smart_device"
  65. DEFINES += -DBOARD_SMART_DEVICE
  66. else ifdef BOARD
  67. $(error Unknown board $(BOARD))
  68. endif
  69. # Board revision, defaults to a if not specified.
  70. ifndef BOARD_REVISION
  71. BOARD_REVISION = a
  72. BOARD_REVISION_IS_DEFAULT = yes
  73. endif
  74. ifeq "$(BOARD_REVISION)" "c"
  75. DEFINES +=-DBOARD_REV_C
  76. else ifeq "$(BOARD_REVISION)" "b"
  77. DEFINES +=-DBOARD_REV_B
  78. else ifeq "$(BOARD_REVISION)" "a"
  79. DEFINES +=-DBOARD_REV_A
  80. else ifdef BOARD_REVISION
  81. $(error Unknown board revision $(BOARD_REVISION))
  82. endif
  83. # Only define this variable if a board is specified.
  84. ifdef BOARD
  85. BOARD_WITH_REV := $(BOARD)_rev_$(BOARD_REVISION)
  86. endif
  87. # Set this define to 1 if we want to build thumb binaries, or 0 for ARM.
  88. USE_THUMB ?= 0
  89. # Enable debug build by default.
  90. DEBUG ?= 1