Make.defs 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170
  1. ############################################################################
  2. # boards/z80/z180/p112/scripts/Make.defs
  3. #
  4. # Copyright (C) 2012, 2014, 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. # These are the directories where the SDCC toolchain is installed. NOTE
  38. # that short 8.3 path names are used in order to avoid spaces. On my machine
  39. # I have:
  40. #
  41. # C:\PROGRA~1\ = C:\Profram Files\
  42. # C:\PROGRA~2\ = C:\Program Files (x86)\
  43. #
  44. # Your PC may be configured differently.
  45. ifeq ($(CONFIG_WINDOWS_NATIVE),y)
  46. SDCC_INSTALLDIR = C:\PROGRA~2\SDCC
  47. SDCC_BINDIR = $(SDCC_INSTALLDIR)\bin
  48. SDCC_LIBDIR = $(SDCC_INSTALLDIR)\lib\z180
  49. else
  50. SDCC_INSTALLDIR = /usr/local
  51. SDCC_BINDIR = $(SDCC_INSTALLDIR)/bin
  52. SDCC_LIBDIR = $(SDCC_INSTALLDIR)/share/sdcc/lib/z180
  53. endif
  54. CROSSDEV =
  55. CC = sdcc
  56. CPP = sdcpp
  57. LD = sdldz80
  58. AS = sdasz80
  59. AR = sdar -r
  60. ARCHCPUFLAGS = -mz180
  61. ifeq ($(CONFIG_DEBUG_SYMBOLS),y)
  62. ARCHOPTIMIZATION = --debug
  63. else
  64. ARCHOPTIMIZATION =
  65. endif
  66. ARCHPICFLAGS =
  67. ARCHWARNINGS =
  68. ARCHDEFINES =
  69. ARCHINCLUDES = -I. -I$(TOPDIR)$(DELIM)include
  70. CFLAGS = $(ARCHWARNINGS) $(ARCHOPTIMIZATION) $(ARCHCPUFLAGS) $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES)
  71. CPPFLAGS = $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES)
  72. AFLAGS = -x -a -l -o -s -g
  73. SDCCLIB = z180.lib
  74. ASMEXT = .asm
  75. # OBJEXT = .o
  76. OBJEXT = .rel
  77. LIBEXT = .lib
  78. EXEEXT = .hex
  79. # Custom ASSEMBLE definition. The most common toolchain, GCC, uses the
  80. # compiler to assemble files because this has the advantage of running the C
  81. # Pre-Processor against. This is not possible with other SDCC; we need to
  82. # define AS and over-ride the common definition in order to use the assembler
  83. # directly.
  84. define ASSEMBLE
  85. @echo "AS: $1"
  86. $(Q) $(AS) $(AFLAGS) $($(strip $1)_AFLAGS) $2 $1
  87. endef
  88. # Custom CLEAN definition
  89. ifeq ($(CONFIG_WINDOWS_NATIVE),y)
  90. define CLEAN
  91. $(Q) if exist *.o (del /f /q *.o)
  92. $(Q) if exist *.asm (del /f /q *.asm)
  93. $(Q) if exist *.rel (del /f /q *.rel)
  94. $(Q) if exist *.lst (del /f /q *.lst)
  95. $(Q) if exist *.rst (del /f /q *.rst)
  96. $(Q) if exist *.sym (del /f /q *.sym)
  97. $(Q) if exist *.adb (del /f /q *.adb)
  98. $(Q) if exist *.lnk (del /f /q *.lnk)
  99. $(Q) if exist *.map (del /f /q *.map)
  100. $(Q) if exist *.mem (del /f /q *.mem)
  101. $(Q) if exist *.hex (del /f /q *.hex)
  102. $(Q) if exist *.cmd (del /f /q *.cmd)
  103. endef
  104. else
  105. define CLEAN
  106. $(Q) rm -f *.o *.asm *.rel *.lst *.rst *.sym *.adb *.lnk *.map *.mem *.hex *.cmd
  107. endef
  108. endif
  109. # Windows native host tool definitions
  110. ifeq ($(CONFIG_WINDOWS_NATIVE),y)
  111. # You may need to customize the binary name:
  112. # HOSTCC = mingw32-gcc.exe
  113. HOSTCC = x86_64-w64-mingw32-gcc.exe
  114. HOSTINCLUDES = -I.
  115. HOSTCFLAGS = -Wall -Wstrict-prototypes -Wshadow -Wundef -g -pipe
  116. HOSTLDFLAGS =
  117. HOSTEXEEXT = .exe
  118. # Windows-native host tools
  119. MKDEP = $(TOPDIR)\tools\mkdeps.exe --winnative # --dep-debug
  120. # Use NTFS links or directory copies
  121. ifeq ($(CONFIG_WINDOWS_MKLINK),y)
  122. DIRLINK = $(TOPDIR)$(DELIM)tools$(DELIM)link.bat
  123. else
  124. DIRLINK = $(TOPDIR)$(DELIM)tools$(DELIM)copydir.bat
  125. endif
  126. DIRUNLINK = $(TOPDIR)$(DELIM)tools$(DELIM)unlink.bat
  127. else
  128. # Linux/Cygwin host tool definitions
  129. HOSTCC = gcc
  130. HOSTINCLUDES = -I.
  131. HOSTCFLAGS = -Wall -Wstrict-prototypes -Wshadow -Wundef -g -pipe
  132. HOSTLDFLAGS =
  133. # This is the tool to use for dependencies (i.e., none)
  134. MKDEP = $(TOPDIR)$(DELIM)tools$(DELIM)mkwindeps.sh
  135. # SDCC for Linux, macOS, or Cygwin understands symbolic links. Windows SDCC
  136. # running under Cygwin does not
  137. ifeq ($(WINTOOL),y)
  138. DIRLINK = $(TOPDIR)$(DELIM)tools$(DELIM)copydir.sh
  139. else
  140. DIRLINK = $(TOPDIR)$(DELIM)tools$(DELIM)link.sh
  141. endif
  142. DIRUNLINK = $(TOPDIR)$(DELIM)tools$(DELIM)unlink.sh
  143. endif