Makefile.host 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268
  1. ############################################################################
  2. # tools/Makefile.host
  3. #
  4. # Licensed to the Apache Software Foundation (ASF) under one or more
  5. # contributor license agreements. See the NOTICE file distributed with
  6. # this work for additional information regarding copyright ownership. The
  7. # ASF licenses this file to you under the Apache License, Version 2.0 (the
  8. # "License"); you may not use this file except in compliance with the
  9. # License. You may obtain a copy of the License at
  10. #
  11. # http://www.apache.org/licenses/LICENSE-2.0
  12. #
  13. # Unless required by applicable law or agreed to in writing, software
  14. # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
  15. # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
  16. # License for the specific language governing permissions and limitations
  17. # under the License.
  18. #
  19. ############################################################################
  20. export TOPDIR ?= $(CURDIR)/..
  21. -include $(TOPDIR)/Make.defs
  22. include ${TOPDIR}/tools/Config.mk
  23. # Check the endian-ness of the target
  24. ifeq ($(CONFIG_ENDIAN_BIG),y)
  25. CFLAGS += -DTGT_BIGENDIAN=1
  26. endif
  27. # Targets
  28. all: b16$(HOSTEXEEXT) bdf-converter$(HOSTEXEEXT) cmpconfig$(HOSTEXEEXT) \
  29. configure$(HOSTEXEEXT) mkconfig$(HOSTEXEEXT) mkdeps$(HOSTEXEEXT) \
  30. mksymtab$(HOSTEXEEXT) mksyscall$(HOSTEXEEXT) mkversion$(HOSTEXEEXT) \
  31. cnvwindeps$(HOSTEXEEXT) nxstyle$(HOSTEXEEXT) initialconfig$(HOSTEXEEXT) \
  32. gencromfs$(HOSTEXEEXT) convert-comments$(HOSTEXEEXT) lowhex$(HOSTEXEEXT) \
  33. detab$(HOSTEXEEXT) rmcr$(HOSTEXEEXT) incdir$(HOSTEXEEXT)
  34. default: mkconfig$(HOSTEXEEXT) mksyscall$(HOSTEXEEXT) mkdeps$(HOSTEXEEXT) \
  35. cnvwindeps$(HOSTEXEEXT) incdir$(HOSTEXEEXT)
  36. ifdef HOSTEXEEXT
  37. .PHONY: b16 bdf-converter cmpconfig clean configure kconfig2html mkconfig \
  38. mkdeps mksymtab mksyscall mkversion cnvwindeps nxstyle initialconfig \
  39. gencromfs convert-comments lowhex detab rmcr incdir
  40. else
  41. .PHONY: clean
  42. endif
  43. # b16 - Fixed precision math conversion tool
  44. b16$(HOSTEXEEXT): b16.c
  45. $(Q) $(HOSTCC) $(HOSTCFLAGS) -o b16$(HOSTEXEEXT) b16.c
  46. ifdef HOSTEXEEXT
  47. b16: b16$(HOSTEXEEXT)
  48. endif
  49. # configure - Instantiate a canned NuttX configuration
  50. configure$(HOSTEXEEXT): configure.c cfgparser.c
  51. $(Q) $(HOSTCC) $(HOSTCFLAGS) -o configure$(HOSTEXEEXT) configure.c cfgparser.c
  52. ifdef HOSTEXEEXT
  53. configure: configure$(HOSTEXEEXT)
  54. endif
  55. # mkconfig - Convert a .config file into a C config.h file
  56. mkconfig$(HOSTEXEEXT): mkconfig.c cfgdefine.c
  57. $(Q) $(HOSTCC) $(HOSTCFLAGS) -o mkconfig$(HOSTEXEEXT) mkconfig.c cfgdefine.c
  58. ifdef HOSTEXEEXT
  59. mkconfig: mkconfig$(HOSTEXEEXT)
  60. endif
  61. # cmpconfig - Compare the contents of two configuration files
  62. cmpconfig$(HOSTEXEEXT): cmpconfig.c cfgparser.c
  63. $(Q) $(HOSTCC) $(HOSTCFLAGS) -o cmpconfig$(HOSTEXEEXT) cmpconfig.c cfgparser.c
  64. ifdef HOSTEXEEXT
  65. cmpconfig: cmpconfig$(HOSTEXEEXT)
  66. endif
  67. # kconfig2html - Create an HTML document describing the configuration options
  68. kconfig2html$(HOSTEXEEXT): kconfig2html.c
  69. $(Q) $(HOSTCC) $(HOSTCFLAGS) -o kconfig2html$(HOSTEXEEXT) kconfig2html.c
  70. ifdef HOSTEXEEXT
  71. kconfig2html: kconfig2html$(HOSTEXEEXT)
  72. endif
  73. # mkversion - Convert a .version file into a C version.h file
  74. mkversion$(HOSTEXEEXT): mkconfig.c cfgdefine.c
  75. $(Q) $(HOSTCC) $(HOSTCFLAGS) -o mkversion$(HOSTEXEEXT) mkversion.c cfgdefine.c
  76. ifdef HOSTEXEEXT
  77. mkversion: mkversion$(HOSTEXEEXT)
  78. endif
  79. # mksyscall - Convert a CSV file into syscall stubs and proxies
  80. mksyscall$(HOSTEXEEXT): mksyscall.c csvparser.c
  81. $(Q) $(HOSTCC) $(HOSTCFLAGS) -o mksyscall$(HOSTEXEEXT) mksyscall.c csvparser.c
  82. ifdef HOSTEXEEXT
  83. mksyscall: mksyscall$(HOSTEXEEXT)
  84. endif
  85. # mksymtab - Convert a CSV file into a symbol table
  86. mksymtab$(HOSTEXEEXT): mksymtab.c csvparser.c
  87. $(Q) $(HOSTCC) $(HOSTCFLAGS) -o mksymtab$(HOSTEXEEXT) mksymtab.c csvparser.c
  88. ifdef HOSTEXEEXT
  89. mksymtab: mksymtab$(HOSTEXEEXT)
  90. endif
  91. # bdf-converter - Converts a BDF font to the NuttX font format
  92. bdf-converter$(HOSTEXEEXT): bdf-converter.c
  93. $(Q) $(HOSTCC) $(HOSTCFLAGS) -o bdf-converter$(HOSTEXEEXT) bdf-converter.c
  94. ifdef HOSTEXEEXT
  95. bdf-converter: bdf-converter$(HOSTEXEEXT)
  96. endif
  97. # nxstyle - Check a file for compliance to NuttX coding style
  98. nxstyle$(HOSTEXEEXT): nxstyle.c
  99. $(Q) $(HOSTCC) $(HOSTCFLAGS) -DTOPDIR=\"$(realpath $(TOPDIR))\" \
  100. -o nxstyle$(HOSTEXEEXT) nxstyle.c
  101. ifdef HOSTEXEEXT
  102. nxstyle: nxstyle$(HOSTEXEEXT)
  103. endif
  104. # initialconfig - Create a barebones .config file sufficient only for
  105. # instantiating the symbolic links necessary to do a real configuration
  106. # from scratch.
  107. initialconfig$(HOSTEXEEXT): initialconfig.c
  108. $(Q) $(HOSTCC) $(HOSTCFLAGS) -o initialconfig$(HOSTEXEEXT) initialconfig.c
  109. ifdef HOSTEXEEXT
  110. initialconfig: initialconfig$(HOSTEXEEXT)
  111. endif
  112. # gencromfs - Generate a CROMFS file system
  113. gencromfs$(HOSTEXEEXT): gencromfs.c
  114. $(Q) $(HOSTCC) $(HOSTCFLAGS) -o gencromfs$(HOSTEXEEXT) gencromfs.c
  115. ifdef HOSTEXEEXT
  116. gencromfs: gencromfs$(HOSTEXEEXT)
  117. endif
  118. # convert-comments - Convert C++-style comments to C-style comments
  119. convert-comments$(HOSTEXEEXT): convert-comments.c
  120. $(Q) $(HOSTCC) $(HOSTCFLAGS) -o convert-comments$(HOSTEXEEXT) convert-comments.c
  121. ifdef HOSTEXEEXT
  122. convert-comments: convert-comments$(HOSTEXEEXT)
  123. endif
  124. # lowhex - Convert hexadecimal constants to lower cast format
  125. lowhex$(HOSTEXEEXT): lowhex.c
  126. $(Q) $(HOSTCC) $(HOSTCFLAGS) -o lowhex$(HOSTEXEEXT) lowhex.c
  127. ifdef HOSTEXEEXT
  128. lowhex: lowhex$(HOSTEXEEXT)
  129. endif
  130. # detab - Convert tabs to spaces
  131. detab$(HOSTEXEEXT): detab.c
  132. $(Q) $(HOSTCC) $(HOSTCFLAGS) -o detab$(HOSTEXEEXT) detab.c
  133. ifdef HOSTEXEEXT
  134. detab: detab$(HOSTEXEEXT)
  135. endif
  136. # rmcr - Convert tabs to spaces
  137. rmcr$(HOSTEXEEXT): rmcr.c
  138. $(Q) $(HOSTCC) $(HOSTCFLAGS) -o rmcr$(HOSTEXEEXT) rmcr.c
  139. ifdef HOSTEXEEXT
  140. rmcr: rmcr$(HOSTEXEEXT)
  141. endif
  142. # incdir - Generate compiler-specific include paths
  143. incdir$(HOSTEXEEXT): incdir.c
  144. $(Q) $(HOSTCC) $(HOSTCFLAGS) -o incdir$(HOSTEXEEXT) incdir.c
  145. ifdef HOSTEXEEXT
  146. incdir: incdir$(HOSTEXEEXT)
  147. endif
  148. # cnvwindeps - Convert dependences generated by a Windows native toolchain
  149. # for use in a Cygwin/POSIX build environment
  150. cnvwindeps$(HOSTEXEEXT): cnvwindeps.c
  151. $(Q) $(HOSTCC) $(HOSTCFLAGS) -o cnvwindeps$(HOSTEXEEXT) cnvwindeps.c
  152. ifdef HOSTEXEEXT
  153. cnvwindeps: cnvwindeps$(HOSTEXEEXT)
  154. endif
  155. # Create dependencies for a list of files
  156. mkdeps$(HOSTEXEEXT): mkdeps.c csvparser.c
  157. $(Q) $(HOSTCC) $(HOSTCFLAGS) -o mkdeps$(HOSTEXEEXT) mkdeps.c
  158. ifdef HOSTEXEEXT
  159. mkdeps: mkdeps$(HOSTEXEEXT)
  160. endif
  161. clean:
  162. $(call DELFILE, b16)
  163. $(call DELFILE, b16.exe)
  164. $(call DELFILE, bdf-converter)
  165. $(call DELFILE, bdf-converter.exe)
  166. $(call DELFILE, cmpconfig)
  167. $(call DELFILE, cmpconfig.exe)
  168. $(call DELFILE, cnvwindeps)
  169. $(call DELFILE, cnvwindeps.exe)
  170. $(call DELFILE, convert-comments)
  171. $(call DELFILE, convert-comments.exe)
  172. $(call DELFILE, configure)
  173. $(call DELFILE, configure.exe)
  174. $(call DELFILE, detab)
  175. $(call DELFILE, detab.exe)
  176. $(call DELFILE, gencromfs)
  177. $(call DELFILE, gencromfs.exe)
  178. $(call DELFILE, initialconfig)
  179. $(call DELFILE, initialconfig.exe)
  180. $(call DELFILE, lowhex)
  181. $(call DELFILE, lowhex.exe)
  182. $(call DELFILE, Make.dep)
  183. $(call DELFILE, mkconfig)
  184. $(call DELFILE, mkconfig.exe)
  185. $(call DELFILE, mkdeps)
  186. $(call DELFILE, mkdeps.exe)
  187. $(call DELFILE, mksymtab)
  188. $(call DELFILE, mksymtab.exe)
  189. $(call DELFILE, mksyscall)
  190. $(call DELFILE, mksyscall.exe)
  191. $(call DELFILE, mkversion)
  192. $(call DELFILE, mkversion.exe)
  193. $(call DELFILE, nxstyle)
  194. $(call DELFILE, nxstyle.exe)
  195. $(call DELFILE, rmcr)
  196. $(call DELFILE, rmcr.exe)
  197. ifneq ($(CONFIG_WINDOWS_NATIVE),y)
  198. $(Q) rm -rf *.dSYM
  199. endif
  200. $(Q) $(MAKE) -C pic32 -f Makefile.host clean
  201. $(Q) $(MAKE) -C cxd56 -f Makefile.host clean
  202. $(call DELFILE, incdir)
  203. $(call DELFILE, incdir.exe)
  204. $(call CLEAN)