tcc 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (283) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE +35 -0
  3. data/README.md +196 -0
  4. data/ext/tcc/extconf.rb +25 -0
  5. data/ext/tcc/tcc-0.9.26.patch +30 -0
  6. data/ext/tcc/tcc-0.9.26/COPYING +504 -0
  7. data/ext/tcc/tcc-0.9.26/Changelog +396 -0
  8. data/ext/tcc/tcc-0.9.26/Makefile +349 -0
  9. data/ext/tcc/tcc-0.9.26/README +101 -0
  10. data/ext/tcc/tcc-0.9.26/TODO +93 -0
  11. data/ext/tcc/tcc-0.9.26/VERSION +1 -0
  12. data/ext/tcc/tcc-0.9.26/arm-gen.c +2005 -0
  13. data/ext/tcc/tcc-0.9.26/c67-gen.c +2560 -0
  14. data/ext/tcc/tcc-0.9.26/coff.h +446 -0
  15. data/ext/tcc/tcc-0.9.26/config.h +8 -0
  16. data/ext/tcc/tcc-0.9.26/config.mak +28 -0
  17. data/ext/tcc/tcc-0.9.26/config.texi +1 -0
  18. data/ext/tcc/tcc-0.9.26/configure +540 -0
  19. data/ext/tcc/tcc-0.9.26/conftest.c +71 -0
  20. data/ext/tcc/tcc-0.9.26/elf.h +1731 -0
  21. data/ext/tcc/tcc-0.9.26/examples/ex1.c +8 -0
  22. data/ext/tcc/tcc-0.9.26/examples/ex2.c +98 -0
  23. data/ext/tcc/tcc-0.9.26/examples/ex3.c +24 -0
  24. data/ext/tcc/tcc-0.9.26/examples/ex4.c +26 -0
  25. data/ext/tcc/tcc-0.9.26/examples/ex5.c +8 -0
  26. data/ext/tcc/tcc-0.9.26/i386-asm.c +1498 -0
  27. data/ext/tcc/tcc-0.9.26/i386-asm.h +473 -0
  28. data/ext/tcc/tcc-0.9.26/i386-gen.c +1096 -0
  29. data/ext/tcc/tcc-0.9.26/i386-tok.h +243 -0
  30. data/ext/tcc/tcc-0.9.26/il-gen.c +667 -0
  31. data/ext/tcc/tcc-0.9.26/il-opcodes.h +251 -0
  32. data/ext/tcc/tcc-0.9.26/include/float.h +57 -0
  33. data/ext/tcc/tcc-0.9.26/include/stdarg.h +41 -0
  34. data/ext/tcc/tcc-0.9.26/include/stdbool.h +10 -0
  35. data/ext/tcc/tcc-0.9.26/include/stddef.h +28 -0
  36. data/ext/tcc/tcc-0.9.26/include/tcclib.h +78 -0
  37. data/ext/tcc/tcc-0.9.26/include/varargs.h +12 -0
  38. data/ext/tcc/tcc-0.9.26/lib/Makefile +102 -0
  39. data/ext/tcc/tcc-0.9.26/lib/alloca86-bt.S +47 -0
  40. data/ext/tcc/tcc-0.9.26/lib/alloca86.S +35 -0
  41. data/ext/tcc/tcc-0.9.26/lib/alloca86_64.S +42 -0
  42. data/ext/tcc/tcc-0.9.26/lib/bcheck.c +875 -0
  43. data/ext/tcc/tcc-0.9.26/lib/libtcc1.c +691 -0
  44. data/ext/tcc/tcc-0.9.26/libtcc.c +1941 -0
  45. data/ext/tcc/tcc-0.9.26/libtcc.h +103 -0
  46. data/ext/tcc/tcc-0.9.26/stab.def +234 -0
  47. data/ext/tcc/tcc-0.9.26/stab.h +17 -0
  48. data/ext/tcc/tcc-0.9.26/tcc-doc.html +2332 -0
  49. data/ext/tcc/tcc-0.9.26/tcc-doc.info +1151 -0
  50. data/ext/tcc/tcc-0.9.26/tcc-doc.texi +1268 -0
  51. data/ext/tcc/tcc-0.9.26/tcc.1 +415 -0
  52. data/ext/tcc/tcc-0.9.26/tcc.c +352 -0
  53. data/ext/tcc/tcc-0.9.26/tcc.h +1379 -0
  54. data/ext/tcc/tcc-0.9.26/tccasm.c +1118 -0
  55. data/ext/tcc/tcc-0.9.26/tcccoff.c +948 -0
  56. data/ext/tcc/tcc-0.9.26/tccelf.c +3129 -0
  57. data/ext/tcc/tcc-0.9.26/tccgen.c +5841 -0
  58. data/ext/tcc/tcc-0.9.26/tccpe.c +1887 -0
  59. data/ext/tcc/tcc-0.9.26/tccpp.c +3128 -0
  60. data/ext/tcc/tcc-0.9.26/tccrun.c +737 -0
  61. data/ext/tcc/tcc-0.9.26/tcctok.h +278 -0
  62. data/ext/tcc/tcc-0.9.26/tests/Makefile +199 -0
  63. data/ext/tcc/tcc-0.9.26/tests/asmtest.S +609 -0
  64. data/ext/tcc/tcc-0.9.26/tests/boundtest.c +233 -0
  65. data/ext/tcc/tcc-0.9.26/tests/gcctestsuite.sh +33 -0
  66. data/ext/tcc/tcc-0.9.26/tests/libtcc_test.c +76 -0
  67. data/ext/tcc/tcc-0.9.26/tests/tcctest.c +2713 -0
  68. data/ext/tcc/tcc-0.9.26/tests/tests2/00_assignment.c +18 -0
  69. data/ext/tcc/tcc-0.9.26/tests/tests2/00_assignment.expect +3 -0
  70. data/ext/tcc/tcc-0.9.26/tests/tests2/01_comment.c +14 -0
  71. data/ext/tcc/tcc-0.9.26/tests/tests2/01_comment.expect +5 -0
  72. data/ext/tcc/tcc-0.9.26/tests/tests2/02_printf.c +18 -0
  73. data/ext/tcc/tcc-0.9.26/tests/tests2/02_printf.expect +15 -0
  74. data/ext/tcc/tcc-0.9.26/tests/tests2/03_struct.c +31 -0
  75. data/ext/tcc/tcc-0.9.26/tests/tests2/03_struct.expect +6 -0
  76. data/ext/tcc/tcc-0.9.26/tests/tests2/04_for.c +15 -0
  77. data/ext/tcc/tcc-0.9.26/tests/tests2/04_for.expect +10 -0
  78. data/ext/tcc/tcc-0.9.26/tests/tests2/05_array.c +21 -0
  79. data/ext/tcc/tcc-0.9.26/tests/tests2/05_array.expect +10 -0
  80. data/ext/tcc/tcc-0.9.26/tests/tests2/06_case.c +29 -0
  81. data/ext/tcc/tcc-0.9.26/tests/tests2/06_case.expect +8 -0
  82. data/ext/tcc/tcc-0.9.26/tests/tests2/07_function.c +30 -0
  83. data/ext/tcc/tcc-0.9.26/tests/tests2/07_function.expect +4 -0
  84. data/ext/tcc/tcc-0.9.26/tests/tests2/08_while.c +24 -0
  85. data/ext/tcc/tcc-0.9.26/tests/tests2/08_while.expect +11 -0
  86. data/ext/tcc/tcc-0.9.26/tests/tests2/09_do_while.c +24 -0
  87. data/ext/tcc/tcc-0.9.26/tests/tests2/09_do_while.expect +11 -0
  88. data/ext/tcc/tcc-0.9.26/tests/tests2/10_pointer.c +40 -0
  89. data/ext/tcc/tcc-0.9.26/tests/tests2/10_pointer.expect +8 -0
  90. data/ext/tcc/tcc-0.9.26/tests/tests2/11_precedence.c +40 -0
  91. data/ext/tcc/tcc-0.9.26/tests/tests2/11_precedence.expect +15 -0
  92. data/ext/tcc/tcc-0.9.26/tests/tests2/12_hashdefine.c +14 -0
  93. data/ext/tcc/tcc-0.9.26/tests/tests2/12_hashdefine.expect +2 -0
  94. data/ext/tcc/tcc-0.9.26/tests/tests2/13_integer_literals.c +20 -0
  95. data/ext/tcc/tcc-0.9.26/tests/tests2/13_integer_literals.expect +5 -0
  96. data/ext/tcc/tcc-0.9.26/tests/tests2/14_if.c +21 -0
  97. data/ext/tcc/tcc-0.9.26/tests/tests2/14_if.expect +2 -0
  98. data/ext/tcc/tcc-0.9.26/tests/tests2/15_recursion.c +21 -0
  99. data/ext/tcc/tcc-0.9.26/tests/tests2/15_recursion.expect +10 -0
  100. data/ext/tcc/tcc-0.9.26/tests/tests2/16_nesting.c +21 -0
  101. data/ext/tcc/tcc-0.9.26/tests/tests2/16_nesting.expect +18 -0
  102. data/ext/tcc/tcc-0.9.26/tests/tests2/17_enum.c +29 -0
  103. data/ext/tcc/tcc-0.9.26/tests/tests2/17_enum.expect +3 -0
  104. data/ext/tcc/tcc-0.9.26/tests/tests2/18_include.c +12 -0
  105. data/ext/tcc/tcc-0.9.26/tests/tests2/18_include.expect +3 -0
  106. data/ext/tcc/tcc-0.9.26/tests/tests2/18_include.h +1 -0
  107. data/ext/tcc/tcc-0.9.26/tests/tests2/19_pointer_arithmetic.c +28 -0
  108. data/ext/tcc/tcc-0.9.26/tests/tests2/19_pointer_arithmetic.expect +3 -0
  109. data/ext/tcc/tcc-0.9.26/tests/tests2/20_pointer_comparison.c +24 -0
  110. data/ext/tcc/tcc-0.9.26/tests/tests2/20_pointer_comparison.expect +6 -0
  111. data/ext/tcc/tcc-0.9.26/tests/tests2/21_char_array.c +33 -0
  112. data/ext/tcc/tcc-0.9.26/tests/tests2/21_char_array.expect +7 -0
  113. data/ext/tcc/tcc-0.9.26/tests/tests2/22_floating_point.c +50 -0
  114. data/ext/tcc/tcc-0.9.26/tests/tests2/22_floating_point.expect +16 -0
  115. data/ext/tcc/tcc-0.9.26/tests/tests2/23_type_coercion.c +54 -0
  116. data/ext/tcc/tcc-0.9.26/tests/tests2/23_type_coercion.expect +12 -0
  117. data/ext/tcc/tcc-0.9.26/tests/tests2/24_math_library.c +28 -0
  118. data/ext/tcc/tcc-0.9.26/tests/tests2/24_math_library.expect +18 -0
  119. data/ext/tcc/tcc-0.9.26/tests/tests2/25_quicksort.c +83 -0
  120. data/ext/tcc/tcc-0.9.26/tests/tests2/25_quicksort.expect +2 -0
  121. data/ext/tcc/tcc-0.9.26/tests/tests2/26_character_constants.c +17 -0
  122. data/ext/tcc/tcc-0.9.26/tests/tests2/26_character_constants.expect +8 -0
  123. data/ext/tcc/tcc-0.9.26/tests/tests2/27_sizeof.c +16 -0
  124. data/ext/tcc/tcc-0.9.26/tests/tests2/27_sizeof.expect +3 -0
  125. data/ext/tcc/tcc-0.9.26/tests/tests2/28_strings.c +46 -0
  126. data/ext/tcc/tcc-0.9.26/tests/tests2/28_strings.expect +19 -0
  127. data/ext/tcc/tcc-0.9.26/tests/tests2/29_array_address.c +13 -0
  128. data/ext/tcc/tcc-0.9.26/tests/tests2/29_array_address.expect +1 -0
  129. data/ext/tcc/tcc-0.9.26/tests/tests2/30_hanoi.c +122 -0
  130. data/ext/tcc/tcc-0.9.26/tests/tests2/30_hanoi.expect +71 -0
  131. data/ext/tcc/tcc-0.9.26/tests/tests2/31_args.c +14 -0
  132. data/ext/tcc/tcc-0.9.26/tests/tests2/31_args.expect +7 -0
  133. data/ext/tcc/tcc-0.9.26/tests/tests2/32_led.c +266 -0
  134. data/ext/tcc/tcc-0.9.26/tests/tests2/32_led.expect +4 -0
  135. data/ext/tcc/tcc-0.9.26/tests/tests2/33_ternary_op.c +15 -0
  136. data/ext/tcc/tcc-0.9.26/tests/tests2/33_ternary_op.expect +10 -0
  137. data/ext/tcc/tcc-0.9.26/tests/tests2/34_array_assignment.c +23 -0
  138. data/ext/tcc/tcc-0.9.26/tests/tests2/34_array_assignment.expect +2 -0
  139. data/ext/tcc/tcc-0.9.26/tests/tests2/35_sizeof.c +14 -0
  140. data/ext/tcc/tcc-0.9.26/tests/tests2/35_sizeof.expect +2 -0
  141. data/ext/tcc/tcc-0.9.26/tests/tests2/36_array_initialisers.c +21 -0
  142. data/ext/tcc/tcc-0.9.26/tests/tests2/36_array_initialisers.expect +20 -0
  143. data/ext/tcc/tcc-0.9.26/tests/tests2/37_sprintf.c +17 -0
  144. data/ext/tcc/tcc-0.9.26/tests/tests2/37_sprintf.expect +20 -0
  145. data/ext/tcc/tcc-0.9.26/tests/tests2/38_multiple_array_index.c +32 -0
  146. data/ext/tcc/tcc-0.9.26/tests/tests2/38_multiple_array_index.expect +4 -0
  147. data/ext/tcc/tcc-0.9.26/tests/tests2/39_typedef.c +31 -0
  148. data/ext/tcc/tcc-0.9.26/tests/tests2/39_typedef.expect +3 -0
  149. data/ext/tcc/tcc-0.9.26/tests/tests2/40_stdio.c +52 -0
  150. data/ext/tcc/tcc-0.9.26/tests/tests2/40_stdio.expect +27 -0
  151. data/ext/tcc/tcc-0.9.26/tests/tests2/41_hashif.c +85 -0
  152. data/ext/tcc/tcc-0.9.26/tests/tests2/41_hashif.expect +6 -0
  153. data/ext/tcc/tcc-0.9.26/tests/tests2/42_function_pointer.c +18 -0
  154. data/ext/tcc/tcc-0.9.26/tests/tests2/42_function_pointer.expect +2 -0
  155. data/ext/tcc/tcc-0.9.26/tests/tests2/43_void_param.c +15 -0
  156. data/ext/tcc/tcc-0.9.26/tests/tests2/43_void_param.expect +1 -0
  157. data/ext/tcc/tcc-0.9.26/tests/tests2/44_scoped_declarations.c +17 -0
  158. data/ext/tcc/tcc-0.9.26/tests/tests2/44_scoped_declarations.expect +1 -0
  159. data/ext/tcc/tcc-0.9.26/tests/tests2/45_empty_for.c +18 -0
  160. data/ext/tcc/tcc-0.9.26/tests/tests2/45_empty_for.expect +10 -0
  161. data/ext/tcc/tcc-0.9.26/tests/tests2/46_grep.c +564 -0
  162. data/ext/tcc/tcc-0.9.26/tests/tests2/47_switch_return.c +24 -0
  163. data/ext/tcc/tcc-0.9.26/tests/tests2/47_switch_return.expect +4 -0
  164. data/ext/tcc/tcc-0.9.26/tests/tests2/48_nested_break.c +26 -0
  165. data/ext/tcc/tcc-0.9.26/tests/tests2/48_nested_break.expect +1 -0
  166. data/ext/tcc/tcc-0.9.26/tests/tests2/49_bracket_evaluation.c +23 -0
  167. data/ext/tcc/tcc-0.9.26/tests/tests2/49_bracket_evaluation.expect +1 -0
  168. data/ext/tcc/tcc-0.9.26/tests/tests2/50_logical_second_arg.c +29 -0
  169. data/ext/tcc/tcc-0.9.26/tests/tests2/50_logical_second_arg.expect +20 -0
  170. data/ext/tcc/tcc-0.9.26/tests/tests2/51_static.c +30 -0
  171. data/ext/tcc/tcc-0.9.26/tests/tests2/51_static.expect +8 -0
  172. data/ext/tcc/tcc-0.9.26/tests/tests2/52_unnamed_enum.c +27 -0
  173. data/ext/tcc/tcc-0.9.26/tests/tests2/52_unnamed_enum.expect +9 -0
  174. data/ext/tcc/tcc-0.9.26/tests/tests2/54_goto.c +56 -0
  175. data/ext/tcc/tcc-0.9.26/tests/tests2/54_goto.expect +8 -0
  176. data/ext/tcc/tcc-0.9.26/tests/tests2/55_lshift_type.c +52 -0
  177. data/ext/tcc/tcc-0.9.26/tests/tests2/55_lshift_type.expect +1 -0
  178. data/ext/tcc/tcc-0.9.26/tests/tests2/LICENSE +37 -0
  179. data/ext/tcc/tcc-0.9.26/tests/tests2/Makefile +98 -0
  180. data/ext/tcc/tcc-0.9.26/texi2pod.pl +427 -0
  181. data/ext/tcc/tcc-0.9.26/win32/build-tcc.bat +60 -0
  182. data/ext/tcc/tcc-0.9.26/win32/examples/dll.c +12 -0
  183. data/ext/tcc/tcc-0.9.26/win32/examples/fib.c +23 -0
  184. data/ext/tcc/tcc-0.9.26/win32/examples/hello_dll.c +19 -0
  185. data/ext/tcc/tcc-0.9.26/win32/examples/hello_win.c +163 -0
  186. data/ext/tcc/tcc-0.9.26/win32/include/_mingw.h +139 -0
  187. data/ext/tcc/tcc-0.9.26/win32/include/assert.h +54 -0
  188. data/ext/tcc/tcc-0.9.26/win32/include/conio.h +409 -0
  189. data/ext/tcc/tcc-0.9.26/win32/include/ctype.h +281 -0
  190. data/ext/tcc/tcc-0.9.26/win32/include/dir.h +31 -0
  191. data/ext/tcc/tcc-0.9.26/win32/include/direct.h +68 -0
  192. data/ext/tcc/tcc-0.9.26/win32/include/dirent.h +135 -0
  193. data/ext/tcc/tcc-0.9.26/win32/include/dos.h +55 -0
  194. data/ext/tcc/tcc-0.9.26/win32/include/errno.h +75 -0
  195. data/ext/tcc/tcc-0.9.26/win32/include/excpt.h +123 -0
  196. data/ext/tcc/tcc-0.9.26/win32/include/fcntl.h +52 -0
  197. data/ext/tcc/tcc-0.9.26/win32/include/fenv.h +108 -0
  198. data/ext/tcc/tcc-0.9.26/win32/include/inttypes.h +297 -0
  199. data/ext/tcc/tcc-0.9.26/win32/include/io.h +418 -0
  200. data/ext/tcc/tcc-0.9.26/win32/include/limits.h +111 -0
  201. data/ext/tcc/tcc-0.9.26/win32/include/locale.h +91 -0
  202. data/ext/tcc/tcc-0.9.26/win32/include/malloc.h +175 -0
  203. data/ext/tcc/tcc-0.9.26/win32/include/math.h +777 -0
  204. data/ext/tcc/tcc-0.9.26/win32/include/mem.h +13 -0
  205. data/ext/tcc/tcc-0.9.26/win32/include/memory.h +40 -0
  206. data/ext/tcc/tcc-0.9.26/win32/include/process.h +176 -0
  207. data/ext/tcc/tcc-0.9.26/win32/include/sec_api/conio_s.h +42 -0
  208. data/ext/tcc/tcc-0.9.26/win32/include/sec_api/crtdbg_s.h +19 -0
  209. data/ext/tcc/tcc-0.9.26/win32/include/sec_api/io_s.h +33 -0
  210. data/ext/tcc/tcc-0.9.26/win32/include/sec_api/mbstring_s.h +52 -0
  211. data/ext/tcc/tcc-0.9.26/win32/include/sec_api/search_s.h +25 -0
  212. data/ext/tcc/tcc-0.9.26/win32/include/sec_api/stdio_s.h +145 -0
  213. data/ext/tcc/tcc-0.9.26/win32/include/sec_api/stdlib_s.h +67 -0
  214. data/ext/tcc/tcc-0.9.26/win32/include/sec_api/stralign_s.h +30 -0
  215. data/ext/tcc/tcc-0.9.26/win32/include/sec_api/string_s.h +41 -0
  216. data/ext/tcc/tcc-0.9.26/win32/include/sec_api/sys/timeb_s.h +34 -0
  217. data/ext/tcc/tcc-0.9.26/win32/include/sec_api/tchar_s.h +266 -0
  218. data/ext/tcc/tcc-0.9.26/win32/include/sec_api/time_s.h +61 -0
  219. data/ext/tcc/tcc-0.9.26/win32/include/sec_api/wchar_s.h +128 -0
  220. data/ext/tcc/tcc-0.9.26/win32/include/setjmp.h +160 -0
  221. data/ext/tcc/tcc-0.9.26/win32/include/share.h +28 -0
  222. data/ext/tcc/tcc-0.9.26/win32/include/signal.h +63 -0
  223. data/ext/tcc/tcc-0.9.26/win32/include/stdint.h +209 -0
  224. data/ext/tcc/tcc-0.9.26/win32/include/stdio.h +429 -0
  225. data/ext/tcc/tcc-0.9.26/win32/include/stdlib.h +580 -0
  226. data/ext/tcc/tcc-0.9.26/win32/include/string.h +164 -0
  227. data/ext/tcc/tcc-0.9.26/win32/include/sys/fcntl.h +13 -0
  228. data/ext/tcc/tcc-0.9.26/win32/include/sys/file.h +14 -0
  229. data/ext/tcc/tcc-0.9.26/win32/include/sys/locking.h +30 -0
  230. data/ext/tcc/tcc-0.9.26/win32/include/sys/stat.h +290 -0
  231. data/ext/tcc/tcc-0.9.26/win32/include/sys/time.h +69 -0
  232. data/ext/tcc/tcc-0.9.26/win32/include/sys/timeb.h +133 -0
  233. data/ext/tcc/tcc-0.9.26/win32/include/sys/types.h +118 -0
  234. data/ext/tcc/tcc-0.9.26/win32/include/sys/unistd.h +14 -0
  235. data/ext/tcc/tcc-0.9.26/win32/include/sys/utime.h +146 -0
  236. data/ext/tcc/tcc-0.9.26/win32/include/tchar.h +1102 -0
  237. data/ext/tcc/tcc-0.9.26/win32/include/time.h +287 -0
  238. data/ext/tcc/tcc-0.9.26/win32/include/vadefs.h +11 -0
  239. data/ext/tcc/tcc-0.9.26/win32/include/values.h +4 -0
  240. data/ext/tcc/tcc-0.9.26/win32/include/wchar.h +871 -0
  241. data/ext/tcc/tcc-0.9.26/win32/include/wctype.h +172 -0
  242. data/ext/tcc/tcc-0.9.26/win32/include/winapi/basetsd.h +149 -0
  243. data/ext/tcc/tcc-0.9.26/win32/include/winapi/basetyps.h +85 -0
  244. data/ext/tcc/tcc-0.9.26/win32/include/winapi/guiddef.h +151 -0
  245. data/ext/tcc/tcc-0.9.26/win32/include/winapi/intrin.h +11 -0
  246. data/ext/tcc/tcc-0.9.26/win32/include/winapi/poppack.h +8 -0
  247. data/ext/tcc/tcc-0.9.26/win32/include/winapi/pshpack1.h +8 -0
  248. data/ext/tcc/tcc-0.9.26/win32/include/winapi/pshpack2.h +8 -0
  249. data/ext/tcc/tcc-0.9.26/win32/include/winapi/pshpack4.h +8 -0
  250. data/ext/tcc/tcc-0.9.26/win32/include/winapi/pshpack8.h +8 -0
  251. data/ext/tcc/tcc-0.9.26/win32/include/winapi/reason.h +80 -0
  252. data/ext/tcc/tcc-0.9.26/win32/include/winapi/specstrings.h +7 -0
  253. data/ext/tcc/tcc-0.9.26/win32/include/winapi/stralign.h +154 -0
  254. data/ext/tcc/tcc-0.9.26/win32/include/winapi/tvout.h +79 -0
  255. data/ext/tcc/tcc-0.9.26/win32/include/winapi/winbase.h +2951 -0
  256. data/ext/tcc/tcc-0.9.26/win32/include/winapi/wincon.h +301 -0
  257. data/ext/tcc/tcc-0.9.26/win32/include/winapi/windef.h +293 -0
  258. data/ext/tcc/tcc-0.9.26/win32/include/winapi/windows.h +123 -0
  259. data/ext/tcc/tcc-0.9.26/win32/include/winapi/winerror.h +3166 -0
  260. data/ext/tcc/tcc-0.9.26/win32/include/winapi/wingdi.h +4080 -0
  261. data/ext/tcc/tcc-0.9.26/win32/include/winapi/winnetwk.h +476 -0
  262. data/ext/tcc/tcc-0.9.26/win32/include/winapi/winnls.h +765 -0
  263. data/ext/tcc/tcc-0.9.26/win32/include/winapi/winnt.h +5770 -0
  264. data/ext/tcc/tcc-0.9.26/win32/include/winapi/winreg.h +272 -0
  265. data/ext/tcc/tcc-0.9.26/win32/include/winapi/winuser.h +5651 -0
  266. data/ext/tcc/tcc-0.9.26/win32/include/winapi/winver.h +160 -0
  267. data/ext/tcc/tcc-0.9.26/win32/lib/chkstk.S +191 -0
  268. data/ext/tcc/tcc-0.9.26/win32/lib/crt1.c +34 -0
  269. data/ext/tcc/tcc-0.9.26/win32/lib/dllcrt1.c +13 -0
  270. data/ext/tcc/tcc-0.9.26/win32/lib/dllmain.c +9 -0
  271. data/ext/tcc/tcc-0.9.26/win32/lib/gdi32.def +337 -0
  272. data/ext/tcc/tcc-0.9.26/win32/lib/kernel32.def +765 -0
  273. data/ext/tcc/tcc-0.9.26/win32/lib/msvcrt.def +1399 -0
  274. data/ext/tcc/tcc-0.9.26/win32/lib/user32.def +654 -0
  275. data/ext/tcc/tcc-0.9.26/win32/lib/wincrt1.c +64 -0
  276. data/ext/tcc/tcc-0.9.26/win32/tcc-win32.txt +156 -0
  277. data/ext/tcc/tcc-0.9.26/win32/tools/tiny_impdef.c +243 -0
  278. data/ext/tcc/tcc-0.9.26/win32/tools/tiny_libmaker.c +258 -0
  279. data/ext/tcc/tcc-0.9.26/x86_64-asm.h +448 -0
  280. data/ext/tcc/tcc-0.9.26/x86_64-gen.c +1701 -0
  281. data/lib/tcc.rb +291 -0
  282. data/tcc.gemspec +15 -0
  283. metadata +343 -0
@@ -0,0 +1,396 @@
1
+ version 0.9.26:
2
+
3
+ User interface:
4
+ - -MD/-MF (automatically generate dependencies for make)
5
+ - -pthread option (same as -D_REENTRANT -lpthread) (Henry Kroll III)
6
+ - -m32/-m64 to re-exec cross compiler (Henry Kroll III)
7
+ - -Wl, Mimic all GNU -option forms supported by ld (Kirill Smelkov)
8
+ - new LIBTCCAPI tcc_set_options() (grischka)
9
+
10
+ Platforms:
11
+ - Many improvements for x86-64 target (Shinichiro Hamaji, Michael Matz, grischka)
12
+ - x86-64 assembler (Frederic Feret)
13
+ - Many improvements for ARM target (Daniel Gl�ckner, Thomas Preud'homme)
14
+ - Support WinCE PE ARM (Timo VJ Lahde)
15
+ - Support ARM hardfloat calling convention (Thomas Preud'homme)
16
+ - Support SELinux (Security-Enhanced Linux) (Henry Kroll III)
17
+ - Support Debian GNU/kFreeBSD kernels (Pierre Chifflier)
18
+ - Support GNU/Hurd kernels (Thomas Preud'homme)
19
+ - Support OSX (tcc -run only) (Milutin Jovanovic)
20
+ - Support multiarch configuration (Thomas Preud'homme)
21
+ - Support out-of-tree build (Akim Demaille)
22
+
23
+ Features:
24
+ - C99 variable length arrays (Thomas Preud'homme & Joe Soroka)
25
+ - Asm labels for variables and functions (Thomas Preud'homme)
26
+ - STT_GNU_IFUNC (Indirect functions as externals) (Thomas Preud'homme)
27
+ - More tests (tests2) (Milutin Jovanovic)
28
+
29
+ version 0.9.25:
30
+
31
+ - first support for x86-64 target (Shinichiro Hamaji)
32
+ - support �Clibc
33
+ - split tcc.c into tcc.h libtcc.c tccpp.c tccgen.c tcc.c
34
+ - improved preprocess output with linenumbers and spaces preserved
35
+ - tcc_relocate now copies code into user buffer
36
+ - fix bitfields with non-int types and in unions
37
+ - improve ARM cross-compiling (Daniel Glöckner)
38
+ - link stabstr sections from multiple objects
39
+ - better (still limited) support for multiple TCCStates
40
+
41
+ version 0.9.24:
42
+
43
+ - added verbosity levels -v, -vv, -vvv
44
+ - Accept standard input as an inputstream (Hanzac Chen)
45
+ - Support c89 compilers other than gcc (Hanzac Chen)
46
+ - -soname linker option (Marc Andre Tanner)
47
+ - Just warn about unknown directives, ignore quotes in #error/#warning
48
+ - Define __STDC_VERSION__=199901L (477)
49
+ - Switch to newer tccpe.c (includes support for resources)
50
+ - Handle backslashes within #include/#error/#warning
51
+ - Import changesets (part 4) 428,457,460,467: defines for openbsd etc.
52
+ - Use _WIN32 for a windows hosted tcc and define it for the PE target,
53
+ otherwise define __unix / __linux (Detlef Riekenberg)
54
+ - Import changesets (part 3) 409,410: ARM EABI by Daniel Glöckner
55
+ - Some in-between fixes:
56
+ TCC -E no longer hangs with macro calls involving newlines.
57
+ (next_nomacro1 now advances the read-pointer with TOK_LINEFEED)
58
+ Global cast (int g_i = 1LL;) no longer crashes tcc.
59
+ (nocode_wanted is initially 1, and only 0 for gen_function)
60
+ On win32 now tcc.exe finds 'include' & 'lib' even if itself is in 'bin'.
61
+ (new function w32_tcc_lib_path removes 'bin' if detected)
62
+ Added quick build batch file for mingw (win32/build-tcc.bat)
63
+ Last added case label optimization (455) produced wrong code. Reverted.
64
+
65
+ - Import more changesets from Rob Landley's fork (part 2):
66
+ 487: Handle long long constants in gen_opic() (Rob Landley)
67
+ 484: Handle parentheses within __attribute__((...)) (Rob Landley)
68
+ 480: Remove a goto in decl_initializer_alloc (Rob Landley)
69
+ 475: Fix dereferences in inline assembly output (Joshua Phillips)
70
+ 474: Cast ptrs to ints of different sizes correctly (Joshua Phillips)
71
+ 473: Fix size of structs with empty array member (Joshua Phillips)
72
+ 470: No warning for && and || with mixed pointers/integers (Rob Landley)
73
+ 469: Fix symbol visibility problems in the linker (Vincent Pit)
74
+ 468: Allow && and || involving pointer arguments (Rob Landley)
75
+ 455: Optimize case labels with no code in between (Zdenek Pavlas)
76
+ 450: Implement alloca for x86 (grischka)
77
+ 415: Parse unicode escape sequences (Axel Liljencrantz)
78
+ 407: Add a simple va_copy() in stdarg.h (Hasso Tepper)
79
+ 400: Allow typedef names as symbols (Dave Dodge)
80
+
81
+ - Import some changesets from Rob Landley's fork (part 1):
82
+ 462: Use LGPL with bcheck.c and il-gen.c
83
+ 458: Fix global compound literals (in unary: case '&':) (Andrew Johnson)
84
+ 456: Use return code from tcc_output_file in main() (Michael Somos)
85
+ 442: Fix indirections with function pointers (***fn)() (grischka)
86
+ 441: Fix LL left shift in libtcc1.c:__shldi3 (grischka)
87
+ 440: Pass structures and function ptrs through ?: (grischka)
88
+ 439: Keep rvalue in bit assignment (bit2 = bit1 = x) (grischka)
89
+ 438: Degrade nonportable pointer assignment to warning (grischka)
90
+ 437: Call 'saveregs()' before jumping with logical and/or/not (grischka)
91
+ 435: Put local static variables into global memory (grischka)
92
+ 432/434: Cast double and ptr to bool (grischka)
93
+ 420: Zero pad x87 tenbyte long doubles (Felix Nawothnig)
94
+ 417: Make 'sizeof' unsigned (Rob Landley)
95
+ 397: Fix save_reg for longlongs (Daniel Glöckner)
96
+ 396: Fix "invalid relocation entry" problem on ubuntu - (Bernhard Fischer)
97
+
98
+ - ignore AS_NEEDED ld command
99
+ - mark executable sections as executable when running in memory
100
+ - added support for win32 wchar_t (Filip Navara)
101
+ - segment override prefix support (Filip Navara)
102
+ - normalized slashes in paths (Filip Navara)
103
+ - windows style fastcall (Filip Navara)
104
+ - support for empty input register section in asm (Filip Navara)
105
+ - anonymous union/struct support (Filip Navara)
106
+ - fixed parsing of function parameters
107
+ - workaround for function pointers in conditional expressions (Dave Dodge)
108
+ - initial '-E' option support to use the C preprocessor alone
109
+ - discard type qualifiers when comparing function parameters (Dave Dodge)
110
+ - Bug fix: A long long value used as a test expression ignores the
111
+ upper 32 bits at runtime (Dave Dodge)
112
+ - fixed multiple concatenation of PPNUM tokens (initial patch by Dave Dodge)
113
+ - fixed multiple typedef specifiers handling
114
+ - fixed sign extension in some type conversions (Dave Dodge)
115
+
116
+ version 0.9.23:
117
+
118
+ - initial PE executable format for windows version (grischka)
119
+ - '#pragma pack' support (grischka)
120
+ - '#include_next' support (Bernhard Fischer)
121
+ - ignore '-pipe' option
122
+ - added -f[no-]leading-underscore
123
+ - preprocessor function macro parsing fix (grischka)
124
+
125
+ version 0.9.22:
126
+
127
+ - simple memory optimisations: kernel compilation is 30% faster
128
+ - linker symbol definitions fixes
129
+ - gcc 3.4 fixes
130
+ - fixed value stack full error
131
+ - 'packed' attribute support for variables and structure fields
132
+ - ignore 'const' and 'volatile' in function prototypes
133
+ - allow '_Bool' in bit fields
134
+
135
+ version 0.9.21:
136
+
137
+ - ARM target support (Daniel Glöckner)
138
+ - added '-funsigned-char, '-fsigned-char' and
139
+ '-Wimplicit-function-declaration'
140
+ - fixed assignment of const struct in struct
141
+ - line comment fix (reported by Bertram Felgenhauer)
142
+ - initial TMS320C67xx target support (TK)
143
+ - win32 configure
144
+ - regparm() attribute
145
+ - many built-in assembler fixes
146
+ - added '.org', '.fill' and '.previous' assembler directives
147
+ - '-fno-common' option
148
+ - '-Ttext' linker option
149
+ - section alignment fixes
150
+ - bit fields fixes
151
+ - do not generate code for unused inline functions
152
+ - '-oformat' linker option.
153
+ - added 'binary' output format.
154
+
155
+ version 0.9.20:
156
+
157
+ - added '-w' option
158
+ - added '.gnu.linkonce' ELF sections support
159
+ - fixed libc linking when running in memory (avoid 'stat' function
160
+ errors).
161
+ - extended '-run' option to be able to give several arguments to a C
162
+ script.
163
+
164
+ version 0.9.19:
165
+
166
+ - "alacarte" linking (Dave Long)
167
+ - simpler function call
168
+ - more strict type checks
169
+ - added 'const' and 'volatile' support and associated warnings
170
+ - added -Werror, -Wunsupported, -Wwrite-strings, -Wall.
171
+ - added __builtin_types_compatible_p() and __builtin_constant_p()
172
+ - chars support in assembler (Dave Long)
173
+ - .string, .globl, .section, .text, .data and .bss asm directive
174
+ support (Dave Long)
175
+ - man page generated from tcc-doc.texi
176
+ - fixed macro argument substitution
177
+ - fixed zero argument macro parsing
178
+ - changed license to LGPL
179
+ - added -rdynamic option support
180
+
181
+ version 0.9.18:
182
+
183
+ - header fix (time.h)
184
+ - fixed inline asm without operand case
185
+ - fixed 'default:' or 'case x:' with '}' after (incorrect C construct accepted
186
+ by gcc)
187
+ - added 'A' inline asm constraint.
188
+
189
+ version 0.9.17:
190
+
191
+ - PLT generation fix
192
+ - tcc doc fixes (Peter Lund)
193
+ - struct parse fix (signaled by Pedro A. Aranda Gutierrez)
194
+ - better _Bool lvalue support (signaled by Alex Measday)
195
+ - function parameters must be converted to pointers (signaled by Neil Brown)
196
+ - sanitized string and character constant parsing
197
+ - fixed comment parse (signaled by Damian M Gryski)
198
+ - fixed macro function bug (signaled by Philippe Ribet)
199
+ - added configure (initial patch by Mitchell N Charity)
200
+ - added '-run' and '-v' options (initial patch by vlindos)
201
+ - added real date report in __DATE__ and __TIME__ macros
202
+
203
+ version 0.9.16:
204
+
205
+ - added assembler language support
206
+ - added GCC inline asm() support
207
+ - fixed multiple variable definitions : uninitialized variables are
208
+ created as COMMON symbols.
209
+ - optimized macro processing
210
+ - added GCC statement expressions support
211
+ - added GCC local labels support
212
+ - fixed array declaration in old style function parameters
213
+ - support casts in static structure initializations
214
+ - added various __xxx[__] keywords for GCC compatibility
215
+ - ignore __extension__ GCC in an expression or in a type (still not perfect)
216
+ - added '? :' GCC extension support
217
+
218
+ version 0.9.15:
219
+
220
+ - compilation fixes for glibc 2.2, gcc 2.95.3 and gcc 3.2.
221
+ - FreeBSD compile fixes. Makefile patches still missing (Carl Drougge).
222
+ - fixed file type guessing if '.' is in the path.
223
+ - fixed tcc_compile_string()
224
+ - add a dummy page in ELF files to fix RX/RW accesses (pageexec at
225
+ freemail dot hu).
226
+
227
+ version 0.9.14:
228
+
229
+ - added #warning. error message if invalid preprocessing directive.
230
+ - added CType structure to ease typing (faster parse).
231
+ - suppressed secondary hash tables (faster parse).
232
+ - rewrote parser by optimizing common cases (faster parse).
233
+ - fixed signed long long comparisons.
234
+ - fixed 'int a(), b();' declaration case.
235
+ - fixed structure init without '{}'.
236
+ - correct alignment support in structures.
237
+ - empty structures support.
238
+ - gcc testsuite now supported.
239
+ - output only warning if implicit integer/pointer conversions.
240
+ - added static bitfield init.
241
+
242
+ version 0.9.13:
243
+
244
+ - correct preprocessing token pasting (## operator) in all cases (added
245
+ preprocessing number token).
246
+ - fixed long long register spill.
247
+ - fixed signed long long '>>'.
248
+ - removed memory leaks.
249
+ - better error handling : processing can continue on link errors. A
250
+ custom callback can be added to display error messages. Most
251
+ errors do not call exit() now.
252
+ - ignore -O, -W, -m and -f options
253
+ - added old style function declarations
254
+ - added GCC __alignof__ support.
255
+ - added GCC typeof support.
256
+ - added GCC computed gotos support.
257
+ - added stack backtrace in runtime error message. Improved runtime
258
+ error position display.
259
+
260
+ version 0.9.12:
261
+
262
+ - more fixes for || and && handling.
263
+ - improved '? :' type handling.
264
+ - fixed bound checking generation with structures
265
+ - force '#endif' to be in same file as matching '#if'
266
+ - #include file optimization with '#ifndef #endif' construct detection
267
+ - macro handling optimization
268
+ - added tcc_relocate() and tcc_get_symbol() in libtcc.
269
+
270
+ version 0.9.11:
271
+
272
+ - stdarg.h fix for double type (thanks to Philippe Ribet).
273
+ - correct white space characters and added MSDOS newline support.
274
+ - fixed invalid implicit function call type declaration.
275
+ - special macros such as __LINE__ are defined if tested with defined().
276
+ - fixed '!' operator with relocated address.
277
+ - added symbol + offset relocation (fixes some static variable initializers)
278
+ - '-l' option can be specified anywhere. '-c' option yields default
279
+ output name. added '-r' option for relocatable output.
280
+ - fixed '\nnn' octal parsing.
281
+ - fixed local extern variables declarations.
282
+
283
+ version 0.9.10:
284
+
285
+ - fixed lvalue type when saved in local stack.
286
+ - fixed '#include' syntax when using macros.
287
+ - fixed '#line' bug.
288
+ - removed size limit on strings. Unified string constants handling
289
+ with variable declarations.
290
+ - added correct support for '\xX' in wchar_t strings.
291
+ - added support for bound checking in generated executables
292
+ - fixed -I include order.
293
+ - fixed incorrect function displayed in runtime error.
294
+
295
+ version 0.9.9:
296
+
297
+ - fixed preprocessor expression parsing for #if/#elif.
298
+ - relocated debug info (.stab section).
299
+ - relocated bounds info (.bounds section).
300
+ - fixed cast to char of char constants ('\377' is -1 instead of 255)
301
+ - fixed implicit cast for unary plus.
302
+ - strings and '__func__' have now 'char[]' type instead of 'char *'
303
+ (fixes sizeof() return value).
304
+ - added __start_xxx and __stop_xxx symbols in linker.
305
+ - better DLL creation support (option -shared begins to work).
306
+ - ELF sections and hash tables are resized dynamically.
307
+ - executables and DLLs are stripped by default.
308
+
309
+ version 0.9.8:
310
+
311
+ - First version of full ELF linking support (generate objects, static
312
+ executable, dynamic executable, dynamic libraries). Dynamic library
313
+ support is not finished (need PIC support in compiler and some
314
+ patches in symbol exporting).
315
+ - First version of ELF loader for object (.o) and archive (.a) files.
316
+ - Support of simple GNU ld scripts (GROUP and FILE commands)
317
+ - Separated runtime library and bound check code from TCC (smaller
318
+ compiler core).
319
+ - fixed register reload in float compare.
320
+ - fixed implicit char/short to int casting.
321
+ - allow array type for address of ('&') operator.
322
+ - fixed unused || or && result.
323
+ - added GCC style variadic macro support.
324
+ - optimized bound checking code for array access.
325
+ - tcc includes are now in $(prefix)/lib/tcc/include.
326
+ - more command line options - more consistent handling of multiple
327
+ input files.
328
+ - added tcc man page (thanks to Cyril Bouthors).
329
+ - uClibc Makefile update
330
+ - converted documentation to texinfo format.
331
+ - added developper's guide in documentation.
332
+
333
+ version 0.9.7:
334
+
335
+ - added library API for easy dynamic compilation (see libtcc.h - first
336
+ draft).
337
+ - fixed long long register spill bug.
338
+ - fixed '? :' register spill bug.
339
+
340
+ version 0.9.6:
341
+
342
+ - added floating point constant propagation (fixes negative floating
343
+ point constants bug).
344
+
345
+ version 0.9.5:
346
+
347
+ - uClibc patches (submitted by Alfonso Martone).
348
+ - error reporting fix
349
+ - added CONFIG_TCC_BCHECK to get smaller code if needed.
350
+
351
+ version 0.9.4:
352
+
353
+ - windows port (currently cannot use -g, -b and dll functions).
354
+ - faster and simpler I/O handling.
355
+ - '-D' option works in all cases.
356
+ - preprocessor fixes (#elif and empty macro args)
357
+ - floating point fixes
358
+ - first code for CIL generation (does not work yet)
359
+
360
+ version 0.9.3:
361
+
362
+ - better and smaller code generator.
363
+ - full ISOC99 64 bit 'long long' support.
364
+ - full 32 bit 'float', 64 bit 'double' and 96 bit 'long double' support.
365
+ - added '-U' option.
366
+ - added assembly sections support.
367
+ - even faster startup time by mmaping sections instead of mallocing them.
368
+ - added GNUC __attribute__ keyword support (currently supports
369
+ 'section' and 'aligned' attributes).
370
+ - added ELF file output (only usable for debugging now)
371
+ - added debug symbol generation (STAB format).
372
+ - added integrated runtime error analysis ('-g' option: print clear
373
+ run time error messages instead of "Segmentation fault").
374
+ - added first version of tiny memory and bound checker ('-b' option).
375
+
376
+ version 0.9.2:
377
+
378
+ - even faster parsing.
379
+ - various syntax parsing fixes.
380
+ - fixed external relocation handling for variables or functions pointers.
381
+ - better function pointers type handling.
382
+ - can compile multiple files (-i option).
383
+ - ANSI C bit fields are supported.
384
+ - beginning of float/double/long double support.
385
+ - beginning of long long support.
386
+
387
+ version 0.9.1:
388
+
389
+ - full ISOC99 initializers handling.
390
+ - compound literals.
391
+ - structures handle in assignments and as function param or return value.
392
+ - wide chars and strings.
393
+ - macro bug fix
394
+
395
+ version 0.9:
396
+ - initial version.
@@ -0,0 +1,349 @@
1
+ #
2
+ # Tiny C Compiler Makefile
3
+ #
4
+
5
+ TOP ?= .
6
+ include $(TOP)/config.mak
7
+ VPATH = $(top_srcdir)
8
+
9
+ CPPFLAGS = -I$(TOP) # for config.h
10
+
11
+ ifeq (-$(findstring gcc,$(CC))-,-gcc-)
12
+ ifeq (-$(findstring $(GCC_MAJOR),01)-,--)
13
+ CFLAGS+=-fno-strict-aliasing
14
+ ifeq (-$(findstring $(GCC_MAJOR),23)-,--)
15
+ CFLAGS+=-Wno-pointer-sign -Wno-sign-compare
16
+ ifeq (-$(GCC_MAJOR)-$(findstring $(GCC_MINOR),56789)-,-4--)
17
+ CFLAGS+=-D_FORTIFY_SOURCE=0
18
+ else
19
+ CFLAGS+=-Wno-unused-result
20
+ endif
21
+ endif
22
+ endif
23
+ else # not GCC
24
+ ifeq (-$(findstring clang,$(CC))-,-clang-)
25
+ # make clang accept gnuisms in libtcc1.c
26
+ CFLAGS+=-fheinous-gnu-extensions
27
+ endif
28
+ endif
29
+
30
+ CPPFLAGS_P=$(CPPFLAGS) -DCONFIG_TCC_STATIC
31
+ CFLAGS_P=$(CFLAGS) -pg -static
32
+ LIBS_P=
33
+ LDFLAGS_P=$(LDFLAGS)
34
+
35
+ ifdef CONFIG_WIN64
36
+ CONFIG_WIN32=yes
37
+ endif
38
+
39
+ ifndef CONFIG_WIN32
40
+ LIBS=-lm
41
+ ifndef CONFIG_NOLDL
42
+ LIBS+=-ldl
43
+ endif
44
+ endif
45
+
46
+ # make libtcc as static or dynamic library?
47
+ ifdef DISABLE_STATIC
48
+ LIBTCC=libtcc.so.1.0
49
+ LINK_LIBTCC=-Wl,-rpath,"$(libdir)"
50
+ ifdef DISABLE_RPATH
51
+ LINK_LIBTCC=
52
+ endif
53
+ else
54
+ LIBTCC=libtcc.a
55
+ LINK_LIBTCC=
56
+ endif
57
+
58
+ CONFIG_$(ARCH) = yes
59
+ NATIVE_DEFINES_$(CONFIG_i386) += -DTCC_TARGET_I386
60
+ NATIVE_DEFINES_$(CONFIG_x86-64) += -DTCC_TARGET_X86_64
61
+ NATIVE_DEFINES_$(CONFIG_WIN32) += -DTCC_TARGET_PE
62
+ NATIVE_DEFINES_$(CONFIG_uClibc) += -DTCC_UCLIBC
63
+ NATIVE_DEFINES_$(CONFIG_arm) += -DTCC_TARGET_ARM -DWITHOUT_LIBTCC
64
+ NATIVE_DEFINES_$(CONFIG_arm_eabihf) += -DTCC_ARM_EABI -DTCC_ARM_HARDFLOAT
65
+ NATIVE_DEFINES_$(CONFIG_arm_eabi) += -DTCC_ARM_EABI
66
+ NATIVE_DEFINES_$(CONFIG_arm_vfp) += -DTCC_ARM_VFP
67
+ NATIVE_DEFINES += $(NATIVE_DEFINES_yes)
68
+
69
+ ifeq ($(TOP),.)
70
+
71
+ PROGS=tcc$(EXESUF)
72
+ I386_CROSS = i386-tcc$(EXESUF)
73
+ WIN32_CROSS = i386-win32-tcc$(EXESUF)
74
+ WIN64_CROSS = x86_64-win32-tcc$(EXESUF)
75
+ WINCE_CROSS = arm-win32-tcc$(EXESUF)
76
+ X64_CROSS = x86_64-tcc$(EXESUF)
77
+ ARM_FPA_CROSS = arm-fpa-tcc$(EXESUF)
78
+ ARM_FPA_LD_CROSS = arm-fpa-ld-tcc$(EXESUF)
79
+ ARM_VFP_CROSS = arm-vfp-tcc$(EXESUF)
80
+ ARM_EABI_CROSS = arm-eabi-tcc$(EXESUF)
81
+ ARM_CROSS = $(ARM_FPA_CROSS) $(ARM_FPA_LD_CROSS) $(ARM_VFP_CROSS) $(ARM_EABI_CROSS)
82
+ C67_CROSS = c67-tcc$(EXESUF)
83
+
84
+ CORE_FILES = tcc.c libtcc.c tccpp.c tccgen.c tccelf.c tccasm.c tccrun.c
85
+ CORE_FILES += tcc.h config.h libtcc.h tcctok.h
86
+ I386_FILES = $(CORE_FILES) i386-gen.c i386-asm.c i386-asm.h i386-tok.h
87
+ WIN32_FILES = $(CORE_FILES) i386-gen.c i386-asm.c i386-asm.h i386-tok.h tccpe.c
88
+ WIN64_FILES = $(CORE_FILES) x86_64-gen.c i386-asm.c x86_64-asm.h tccpe.c
89
+ WINCE_FILES = $(CORE_FILES) arm-gen.c tccpe.c
90
+ X86_64_FILES = $(CORE_FILES) x86_64-gen.c i386-asm.c x86_64-asm.h
91
+ ARM_FILES = $(CORE_FILES) arm-gen.c
92
+ C67_FILES = $(CORE_FILES) c67-gen.c tcccoff.c
93
+
94
+ ifdef CONFIG_WIN64
95
+ PROGS+=tiny_impdef$(EXESUF) tiny_libmaker$(EXESUF)
96
+ NATIVE_FILES=$(WIN64_FILES)
97
+ PROGS_CROSS=$(WIN32_CROSS) $(I386_CROSS) $(X64_CROSS) $(ARM_CROSS) $(C67_CROSS)
98
+ LIBTCC1_CROSS=lib/i386-win32/libtcc1.a
99
+ LIBTCC1=libtcc1.a
100
+ else ifdef CONFIG_WIN32
101
+ PROGS+=tiny_impdef$(EXESUF) tiny_libmaker$(EXESUF)
102
+ NATIVE_FILES=$(WIN32_FILES)
103
+ PROGS_CROSS=$(WIN64_CROSS) $(I386_CROSS) $(X64_CROSS) $(ARM_CROSS) $(C67_CROSS)
104
+ LIBTCC1_CROSS=lib/x86_64-win32/libtcc1.a
105
+ LIBTCC1=libtcc1.a
106
+ else ifeq ($(ARCH),i386)
107
+ NATIVE_FILES=$(I386_FILES)
108
+ PROGS_CROSS=$(X64_CROSS) $(WIN32_CROSS) $(WIN64_CROSS) $(ARM_CROSS) $(C67_CROSS)
109
+ LIBTCC1_CROSS=lib/i386-win32/libtcc1.a lib/x86_64-win32/libtcc1.a
110
+ LIBTCC1=libtcc1.a
111
+ else ifeq ($(ARCH),x86-64)
112
+ NATIVE_FILES=$(X86_64_FILES)
113
+ PROGS_CROSS=$(I386_CROSS) $(WIN32_CROSS) $(WIN64_CROSS) $(ARM_CROSS) $(C67_CROSS)
114
+ LIBTCC1_CROSS=lib/i386-win32/libtcc1.a lib/x86_64-win32/libtcc1.a lib/i386/libtcc1.a
115
+ LIBTCC1=libtcc1.a
116
+ else ifeq ($(ARCH),arm)
117
+ NATIVE_FILES=$(ARM_FILES)
118
+ PROGS_CROSS=$(I386_CROSS) $(X64_CROSS) $(WIN32_CROSS) $(WIN64_CROSS) $(C67_CROSS)
119
+ endif
120
+
121
+ ifeq ($(TARGETOS),Darwin)
122
+ PROGS+=tiny_libmaker$(EXESUF)
123
+ endif
124
+
125
+ ifdef CONFIG_USE_LIBGCC
126
+ LIBTCC1=
127
+ endif
128
+
129
+ TCCLIBS = $(LIBTCC1) $(LIBTCC)
130
+ TCCDOCS = tcc.1 tcc-doc.html tcc-doc.info
131
+
132
+ ifdef CONFIG_CROSS
133
+ PROGS+=$(PROGS_CROSS)
134
+ TCCLIBS+=$(LIBTCC1_CROSS)
135
+ endif
136
+
137
+ all: $(PROGS) $(TCCLIBS) $(TCCDOCS)
138
+
139
+ # Host Tiny C Compiler
140
+ tcc$(EXESUF): tcc.o $(LIBTCC)
141
+ $(CC) -o $@ $^ $(LIBS) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) $(LINK_LIBTCC)
142
+
143
+ # Cross Tiny C Compilers
144
+ %-tcc$(EXESUF): tcc.c
145
+ $(CC) -o $@ $< -DONE_SOURCE $(DEFINES) $(CPPFLAGS) $(CFLAGS) $(LIBS) $(LDFLAGS)
146
+
147
+ # profiling version
148
+ tcc_p$(EXESUF): $(NATIVE_FILES)
149
+ $(CC) -o $@ $< -DONE_SOURCE $(NATIVE_DEFINES) $(CPPFLAGS_P) $(CFLAGS_P) $(LIBS_P) $(LDFLAGS_P)
150
+
151
+ $(I386_CROSS): DEFINES = -DTCC_TARGET_I386 \
152
+ -DCONFIG_TCCDIR="\"$(tccdir)/i386\""
153
+ $(X64_CROSS): DEFINES = -DTCC_TARGET_X86_64
154
+ $(WIN32_CROSS): DEFINES = -DTCC_TARGET_I386 -DTCC_TARGET_PE \
155
+ -DCONFIG_TCCDIR="\"$(tccdir)/win32\"" \
156
+ -DCONFIG_TCC_LIBPATHS="\"{B}/lib/32;{B}/lib\""
157
+ $(WIN64_CROSS): DEFINES = -DTCC_TARGET_X86_64 -DTCC_TARGET_PE \
158
+ -DCONFIG_TCCDIR="\"$(tccdir)/win32\"" \
159
+ -DCONFIG_TCC_LIBPATHS="\"{B}/lib/64;{B}/lib\""
160
+ $(WINCE_CROSS): DEFINES = -DTCC_TARGET_PE
161
+ $(C67_CROSS): DEFINES = -DTCC_TARGET_C67
162
+ $(ARM_FPA_CROSS): DEFINES = -DTCC_TARGET_ARM
163
+ $(ARM_FPA_LD_CROSS)$(EXESUF): DEFINES = -DTCC_TARGET_ARM -DLDOUBLE_SIZE=12
164
+ $(ARM_VFP_CROSS): DEFINES = -DTCC_TARGET_ARM -DTCC_ARM_VFP
165
+ $(ARM_EABI_CROSS): DEFINES = -DTCC_TARGET_ARM -DTCC_ARM_EABI
166
+
167
+ $(I386_CROSS): $(I386_FILES)
168
+ $(X64_CROSS): $(X86_64_FILES)
169
+ $(WIN32_CROSS): $(WIN32_FILES)
170
+ $(WIN64_CROSS): $(WIN64_FILES)
171
+ $(WINCE_CROSS): $(WINCE_FILES)
172
+ $(C67_CROSS): $(C67_FILES)
173
+ $(ARM_FPA_CROSS) $(ARM_FPA_LD_CROSS) $(ARM_VFP_CROSS) $(ARM_EABI_CROSS): $(ARM_FILES)
174
+
175
+ # libtcc generation and test
176
+ ifndef ONE_SOURCE
177
+ LIBTCC_OBJ = $(filter-out tcc.o,$(patsubst %.c,%.o,$(filter %.c,$(NATIVE_FILES))))
178
+ LIBTCC_INC = $(filter %.h,$(CORE_FILES)) $(filter-out $(CORE_FILES),$(NATIVE_FILES))
179
+ else
180
+ LIBTCC_OBJ = libtcc.o
181
+ LIBTCC_INC = $(NATIVE_FILES)
182
+ libtcc.o : NATIVE_DEFINES += -DONE_SOURCE
183
+ endif
184
+
185
+ $(LIBTCC_OBJ) tcc.o : %.o : %.c $(LIBTCC_INC)
186
+ $(CC) -o $@ -c $< $(NATIVE_DEFINES) $(CPPFLAGS) $(CFLAGS)
187
+
188
+ libtcc.a: $(LIBTCC_OBJ)
189
+ $(AR) rcs $@ $^
190
+
191
+ libtcc.so.1.0: $(LIBTCC_OBJ)
192
+ $(CC) -shared -Wl,-soname,$@ -o $@ $^ $(LDFLAGS)
193
+
194
+ libtcc.so.1.0: CFLAGS+=-fPIC
195
+
196
+ # windows utilities
197
+ tiny_impdef$(EXESUF): win32/tools/tiny_impdef.c
198
+ $(CC) -o $@ $< $(CPPFLAGS) $(CFLAGS) $(LDFLAGS)
199
+ tiny_libmaker$(EXESUF): win32/tools/tiny_libmaker.c
200
+ $(CC) -o $@ $< $(CPPFLAGS) $(CFLAGS) $(LDFLAGS)
201
+
202
+ # TinyCC runtime libraries
203
+ libtcc1.a : FORCE
204
+ $(MAKE) -C lib native
205
+ lib/%/libtcc1.a : FORCE $(PROGS_CROSS)
206
+ $(MAKE) -C lib cross TARGET=$*
207
+
208
+ FORCE:
209
+
210
+ # install
211
+ TCC_INCLUDES = stdarg.h stddef.h stdbool.h float.h varargs.h tcclib.h
212
+ INSTALL=install
213
+ ifdef STRIP_BINARIES
214
+ INSTALLBIN=$(INSTALL) -s
215
+ else
216
+ INSTALLBIN=$(INSTALL)
217
+ endif
218
+
219
+ ifndef CONFIG_WIN32
220
+ install: $(PROGS) $(TCCLIBS) $(TCCDOCS)
221
+ mkdir -p "$(bindir)"
222
+ ifeq ($(CC),tcc)
223
+ $(INSTALL) -m755 $(PROGS) "$(bindir)"
224
+ else
225
+ $(INSTALLBIN) -m755 $(PROGS) "$(bindir)"
226
+ endif
227
+ mkdir -p "$(mandir)/man1"
228
+ -$(INSTALL) tcc.1 "$(mandir)/man1"
229
+ mkdir -p "$(infodir)"
230
+ -$(INSTALL) tcc-doc.info "$(infodir)"
231
+ mkdir -p "$(tccdir)"
232
+ mkdir -p "$(tccdir)/include"
233
+ ifneq ($(LIBTCC1),)
234
+ $(INSTALL) -m644 $(LIBTCC1) "$(tccdir)"
235
+ endif
236
+ $(INSTALL) -m644 $(addprefix $(top_srcdir)/include/,$(TCC_INCLUDES)) "$(tccdir)/include"
237
+ mkdir -p "$(libdir)"
238
+ $(INSTALL) -m755 $(LIBTCC) "$(libdir)"
239
+ ifdef DISABLE_STATIC
240
+ ln -sf "$(ln_libdir)/libtcc.so.1.0" "$(libdir)/libtcc.so.1"
241
+ ln -sf "$(ln_libdir)/libtcc.so.1.0" "$(libdir)/libtcc.so"
242
+ endif
243
+ mkdir -p "$(includedir)"
244
+ $(INSTALL) -m644 $(top_srcdir)/libtcc.h "$(includedir)"
245
+ mkdir -p "$(docdir)"
246
+ -$(INSTALL) -m644 tcc-doc.html "$(docdir)"
247
+ ifdef CONFIG_CROSS
248
+ mkdir -p "$(tccdir)/win32/lib/32"
249
+ mkdir -p "$(tccdir)/win32/lib/64"
250
+ ifeq ($(ARCH),x86-64)
251
+ mkdir -p "$(tccdir)/i386"
252
+ $(INSTALL) -m644 lib/i386/libtcc1.a "$(tccdir)/i386"
253
+ cp -r "$(tccdir)/include" "$(tccdir)/i386"
254
+ endif
255
+ $(INSTALL) -m644 win32/lib/*.def "$(tccdir)/win32/lib"
256
+ $(INSTALL) -m644 lib/i386-win32/libtcc1.a "$(tccdir)/win32/lib/32"
257
+ $(INSTALL) -m644 lib/x86_64-win32/libtcc1.a "$(tccdir)/win32/lib/64"
258
+ cp -r win32/include/. "$(tccdir)/win32/include"
259
+ cp -r include/. "$(tccdir)/win32/include"
260
+ endif
261
+
262
+ uninstall:
263
+ rm -fv $(foreach P,$(PROGS),"$(bindir)/$P")
264
+ rm -fv $(foreach P,$(LIBTCC1),"$(tccdir)/$P")
265
+ rm -fv $(foreach P,$(TCC_INCLUDES),"$(tccdir)/include/$P")
266
+ rm -fv "$(docdir)/tcc-doc.html" "$(mandir)/man1/tcc.1" "$(infodir)/tcc-doc.info"
267
+ rm -fv "$(libdir)/$(LIBTCC)" "$(includedir)/libtcc.h"
268
+ rm -fv "$(libdir)/libtcc.so*"
269
+ rm -rf "$(tccdir)/win32"
270
+ -rmdir $(tccdir)/include
271
+ ifeq ($(ARCH),x86-64)
272
+ rm -rf "$(tccdir)/i386"
273
+ endif
274
+ else
275
+ # on windows
276
+ install: $(PROGS) $(TCCLIBS) $(TCCDOCS)
277
+ mkdir -p "$(tccdir)"
278
+ mkdir -p "$(tccdir)/lib"
279
+ mkdir -p "$(tccdir)/include"
280
+ mkdir -p "$(tccdir)/examples"
281
+ mkdir -p "$(tccdir)/doc"
282
+ mkdir -p "$(tccdir)/libtcc"
283
+ $(INSTALLBIN) -m755 $(PROGS) "$(tccdir)"
284
+ $(INSTALL) -m644 $(LIBTCC1) win32/lib/*.def "$(tccdir)/lib"
285
+ cp -r win32/include/. "$(tccdir)/include"
286
+ cp -r win32/examples/. "$(tccdir)/examples"
287
+ $(INSTALL) -m644 $(addprefix include/,$(TCC_INCLUDES)) "$(tccdir)/include"
288
+ $(INSTALL) -m644 tcc-doc.html win32/tcc-win32.txt "$(tccdir)/doc"
289
+ $(INSTALL) -m644 $(LIBTCC) libtcc.h "$(tccdir)/libtcc"
290
+ ifdef CONFIG_CROSS
291
+ mkdir -p "$(tccdir)/lib/32"
292
+ mkdir -p "$(tccdir)/lib/64"
293
+ -$(INSTALL) -m644 lib/i386-win32/libtcc1.a "$(tccdir)/lib/32"
294
+ -$(INSTALL) -m644 lib/x86_64-win32/libtcc1.a "$(tccdir)/lib/64"
295
+ endif
296
+
297
+ uninstall:
298
+ rm -rfv "$(tccdir)/*"
299
+ endif
300
+
301
+ # documentation and man page
302
+ tcc-doc.html: tcc-doc.texi
303
+ -texi2html -monolithic -number $<
304
+
305
+ tcc.1: tcc-doc.texi
306
+ -$(top_srcdir)/texi2pod.pl $< tcc.pod
307
+ -pod2man --section=1 --center=" " --release=" " tcc.pod > $@
308
+
309
+ tcc-doc.info: tcc-doc.texi
310
+ -makeinfo $<
311
+
312
+ # in tests subdir
313
+ export LIBTCC1
314
+
315
+ %est:
316
+ $(MAKE) -C tests $@
317
+
318
+ clean:
319
+ rm -vf $(PROGS) tcc_p$(EXESUF) tcc.pod *~ *.o *.a *.so* *.out *.exe libtcc_test$(EXESUF)
320
+ $(MAKE) -C tests $@
321
+ ifneq ($(LIBTCC1),)
322
+ $(MAKE) -C lib $@
323
+ endif
324
+
325
+ distclean: clean
326
+ rm -vf config.h config.mak config.texi tcc.1 tcc-doc.info tcc-doc.html
327
+
328
+ config.mak:
329
+ @echo "Please run ./configure."
330
+ @exit 1
331
+
332
+ # create release tarball from *current* git branch (including tcc-doc.html
333
+ # and converting two files to CRLF)
334
+ TCC-VERSION := tcc-$(shell cat $(top_srcdir)/VERSION)
335
+ tar: tcc-doc.html
336
+ mkdir $(TCC-VERSION)
337
+ ( cd $(TCC-VERSION) && git --git-dir ../.git checkout -f )
338
+ cp tcc-doc.html $(TCC-VERSION)
339
+ for f in tcc-win32.txt build-tcc.bat ; do \
340
+ cat win32/$$f | sed 's,\(.*\),\1\r,g' > $(TCC-VERSION)/win32/$$f ; \
341
+ done
342
+ tar cjf $(TCC-VERSION).tar.bz2 $(TCC-VERSION)
343
+ rm -rf $(TCC-VERSION)
344
+ git reset
345
+
346
+
347
+ .PHONY: all clean tar distclean install uninstall FORCE
348
+
349
+ endif # ifeq ($(TOP),.)