kaem.run 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146
  1. #! /bin/sh
  2. # Copyright © 2019,2020 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
  3. #
  4. # This file is part of GNU Mes.
  5. #
  6. # GNU Mes is free software; you can redistribute it and/or modify it
  7. # under the terms of the GNU General Public License as published by
  8. # the Free Software Foundation; either version 3 of the License, or (at
  9. # your option) any later version.
  10. #
  11. # GNU Mes is distributed in the hope that it will be useful, but
  12. # WITHOUT ANY WARRANTY; without even the implied warranty of
  13. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. # GNU General Public License for more details.
  15. #
  16. # You should have received a copy of the GNU General Public License
  17. # along with GNU Mes. If not, see <http://www.gnu.org/licenses/>.
  18. # Do not invoke this file directly
  19. # Usage:
  20. # kaem --verbose --strict --file kaem.${ARCH}
  21. mkdir -p m2
  22. M2-Planet \
  23. --debug \
  24. --architecture ${ARCH} \
  25. -f include/m2/lib.h \
  26. -f lib/linux/${ARCH}-mes-m2/crt1.c \
  27. -f lib/linux/${ARCH}-mes-m2/mini.c \
  28. -f lib/mes/globals.c \
  29. -f lib/m2/cast.c \
  30. -f lib/m2/exit.c \
  31. -f lib/mes/mini-write.c \
  32. -f lib/linux/${ARCH}-mes-m2/syscall.c \
  33. -f include/linux/${ARCH}/syscall.h \
  34. -f lib/linux/brk.c \
  35. -f lib/stdlib/malloc.c \
  36. -f lib/string/memset.c \
  37. -f lib/m2/read.c \
  38. -f lib/mes/fdgetc.c \
  39. -f lib/stdio/getchar.c \
  40. -f lib/stdio/putchar.c \
  41. -f lib/m2/open.c \
  42. -f lib/m2/mes_open.c \
  43. -f lib/string/strlen.c \
  44. -f lib/mes/eputs.c \
  45. -f lib/mes/fdputc.c \
  46. -f lib/mes/eputc.c \
  47. \
  48. -f include/mes/mes.h \
  49. -f include/mes/builtins.h \
  50. -f include/mes/constants.h \
  51. -f include/mes/symbols.h \
  52. \
  53. -f lib/mes/__assert_fail.c \
  54. -f lib/mes/assert_msg.c \
  55. \
  56. -f lib/mes/fdputc.c \
  57. -f lib/string/strncmp.c \
  58. -f lib/posix/getenv.c \
  59. -f lib/mes/fdputs.c \
  60. -f lib/mes/ntoab.c \
  61. -f lib/ctype/isdigit.c \
  62. -f lib/ctype/isxdigit.c \
  63. -f lib/ctype/isspace.c \
  64. -f lib/ctype/isnumber.c \
  65. -f lib/mes/abtol.c \
  66. -f lib/stdlib/atoi.c \
  67. -f lib/string/memcpy.c \
  68. -f lib/stdlib/free.c \
  69. -f lib/stdlib/realloc.c \
  70. -f lib/string/strcpy.c \
  71. -f lib/mes/itoa.c \
  72. -f lib/mes/ltoa.c \
  73. -f lib/mes/fdungetc.c \
  74. -f lib/posix/setenv.c \
  75. -f lib/linux/access.c \
  76. -f lib/m2/chmod.c \
  77. -f lib/linux/ioctl3.c \
  78. -f lib/m2/isatty.c \
  79. -f lib/linux/fork.c \
  80. -f lib/m2/execve.c \
  81. -f lib/m2/execv.c \
  82. -f lib/linux/waitpid.c \
  83. -f lib/linux/gettimeofday.c \
  84. -f lib/m2/clock_gettime.c \
  85. -f lib/m2/time.c \
  86. -f lib/linux/_getcwd.c \
  87. -f lib/m2/getcwd.c \
  88. -f lib/linux/dup.c \
  89. -f lib/linux/dup2.c \
  90. -f lib/string/strcmp.c \
  91. -f lib/string/memcmp.c \
  92. -f lib/linux/unlink.c \
  93. -f src/builtins.c \
  94. -f src/core.c \
  95. -f src/display.c \
  96. -f src/eval-apply.c \
  97. -f src/gc.c \
  98. -f src/hash.c \
  99. -f src/lib.c \
  100. -f src/apply-m2.c \
  101. -f src/math.c \
  102. -f src/mes.c \
  103. -f src/module.c \
  104. -f src/posix.c \
  105. -f src/reader.c \
  106. -f src/stack.c \
  107. -f src/string.c \
  108. -f src/struct.c \
  109. -f src/symbol.c \
  110. -f src/vector.c \
  111. \
  112. -D MES_VERSION=\"0.22\" \
  113. -o m2/mes.M1
  114. blood-elf -f m2/mes.M1 --little-endian -o m2/mes.blood-elf-M1
  115. M1 \
  116. --little-endian \
  117. --architecture ${ARCH} \
  118. -f ${M1_definitions} \
  119. -f lib/${ARCH}-mes/${ARCH}.M1 \
  120. -f lib/linux/${ARCH}-mes-m2/crt1.M1 \
  121. -f m2/mes.M1 \
  122. -f m2/mes.blood-elf-M1 \
  123. -o m2/mes.hex2
  124. mkdir -p bin
  125. hex2 \
  126. --little-endian \
  127. --architecture ${ARCH} \
  128. --base-address 0x1000000 \
  129. -f lib/m2/${ARCH}/ELF-${ELF_HEADER}-debug.hex2 \
  130. -f m2/mes.hex2 \
  131. -o bin/mes-m2
  132. MES_ARENA=20000000
  133. MES_MAX_ARENA=20000000
  134. MES_STACK=6000000
  135. echo Running mes-m2
  136. ./bin/mes-m2 -c "(display 'Hello,M2-mes!) (newline)"
  137. cp bin/mes-m2 bin/mes