BUILD.conf 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179
  1. #!/bin/bash
  2. #### INSTAL PARAMS ####
  3. ARCH=amd64
  4. ### DIRS ###
  5. BASEDIR=${_BUILD_DIR}
  6. INC_DIR=${BASEDIR}/sys/include
  7. INC_ARCH=${BASEDIR}/${ARCH}/include
  8. LIB_DIR=${BASEDIR}/${ARCH}/lib
  9. SRC_DIR=${BASEDIR}/sys/src
  10. UTIL_DIR=${_BUILD_DIR}/util
  11. CMD_DIR=${SRC_DIR}/cmd
  12. KRL_DIR=${SRC_DIR}/9/k10
  13. TEST_DIR=${SRC_DIR}/test
  14. ### TOOLCHAIN ###
  15. AR=ar
  16. RANLIB=ranlib
  17. LD=ld
  18. LEX=lex
  19. PARSER_GEN=yacc
  20. COLLECT=/usr/lib/gcc/x86_64-linux-gnu/4.9/collect2
  21. COLLECTFLAGS="-plugin /usr/lib/gcc/x86_64-linux-gnu/4.9/liblto_plugin.so -plugin-opt=/usr/lib/gcc/x86_64-linux-gnu/4.9/lto-wrapper --sysroot=/ --build-id -m elf_x86_64 --hash-style=gnu"
  22. AWK=awk
  23. XD=xxd
  24. NM=nm
  25. ### KERNEL ###
  26. DATE=$(date +%s)
  27. EXTKERNDATE="-DKERNDATE=${DATE}"
  28. KERNEL_CONF="k8cpu"
  29. ### CMD Provisional!!! ###
  30. #BUILD_CMD="rc bind mount cat cp echo ls ipconfig ps mkdir pwd chmod rio date dd vga ping telnet dhcpclient srv testalarm"
  31. # Now essentials are included in build.go
  32. BUILD_CMD=""
  33. ### functions ###
  34. test_hello()
  35. {
  36. BUILD_IN="hello.c"
  37. BUILD_OUT="hello"
  38. CLEAN_COM="rm -f *.elf.* *.o"
  39. LIBS_TO_LINK="stdio c"
  40. LDFLAGS_EXTRA="-static -e_main"
  41. }
  42. test_to_fork()
  43. {
  44. BUILD_IN="to_fork.c"
  45. BUILD_OUT="to_fork"
  46. CLEAN_COM="rm -f *.elf.* *.o"
  47. LIBS_TO_LINK="stdio c"
  48. LDFLAGS_EXTRA="-static -e_main"
  49. }
  50. test_saymyname()
  51. {
  52. BUILD_IN="say.c"
  53. BUILD_OUT="say"
  54. CLEAN_COM="rm -f *.elf.* *.o"
  55. LIBS_TO_LINK="stdio c"
  56. LDFLAGS_EXTRA="-static -e_main"
  57. }
  58. cmd_dd()
  59. {
  60. BUILD_IN="dd.c"
  61. BUILD_OUT="dd.elf.out"
  62. CLEAN_COM="rm -f *.elf.* *.o"
  63. LIBS_TO_LINK="libc"
  64. LDFLAGS_EXTRA="-static -e_main"
  65. }
  66. cmd_chmod()
  67. {
  68. BUILD_IN="chmod.c"
  69. BUILD_OUT="chmod.elf.out"
  70. CLEAN_COM="rm -f *.elf.* *.o"
  71. LIBS_TO_LINK="libc"
  72. LDFLAGS_EXTRA="-static -e_main"
  73. }
  74. cmd_pwd()
  75. {
  76. BUILD_IN="pwd.c"
  77. BUILD_OUT="pwd.elf.out"
  78. CLEAN_COM="rm -f *.elf.* *.o"
  79. LIBS_TO_LINK="libc"
  80. LDFLAGS_EXTRA="-static -e_main"
  81. }
  82. cmd_mkdir()
  83. {
  84. BUILD_IN="mkdir.c"
  85. BUILD_OUT="mkdir.elf.out"
  86. CLEAN_COM="rm -f *.elf.* *.o"
  87. LIBS_TO_LINK="libc"
  88. LDFLAGS_EXTRA="-static -e_main"
  89. }
  90. cmd_rio()
  91. {
  92. BUILD_IN="data.c fsys.c rio.c scrl.c time.c util.c wctl.c wind.c xfid.c"
  93. BUILD_OUT="rio.elf.out"
  94. CLEAN_COM="rm -f *.elf.* *.o"
  95. LIBS_TO_LINK="libcomplete libframe libdraw libthread libplumb libc"
  96. LDFLAGS_EXTRA="-static -e_main"
  97. }
  98. cmd_vga()
  99. {
  100. BUILD_DIR=${CMD_DIR}/aux/vga
  101. BUILD_IN="3dfx.c bt485.c ct65540.c error.c i81x.c ics534x.c mach64xx.c neomagic.c radeon.c s3928.c sc15025.c trio64.c tvp3026.c vga.c vision968.c \
  102. ark2000pv.c ch9294.c cyber938x.c et4000.c ibm8514.c io.c main.c nvidia.c rgb524.c s3clock.c stg1702.c tvp3020.c tvp3026clock.c virge.c vmware.c \
  103. att20c49x.c clgd542x.c data.c et4000hwgc.c icd2061a.c mach32.c mga2164w.c palette.c rgb524mn.c s3generic.c t2r4.c tvp3025.c vesa.c vision864.c w30c516.c \
  104. att21c498.c clgd546x.c db.c hiqvideo.c ics2494.c mach64.c mga4xx.c pci.c s3801.c s3hwgc.c template.c tvp3025clock.c vesadb.c vision964.c"
  105. BUILD_OUT="vga.elf.out"
  106. CLEAN_COM="rm -f *.elf.* *.o"
  107. LIBS_TO_LINK="ndb bio libc"
  108. LDFLAGS_EXTRA="-static -e_main"
  109. }
  110. cmd_telnet()
  111. {
  112. BUILD_DIR=${CMD_DIR}/ip
  113. BUILD_IN="telnet.c"
  114. BUILD_OUT="telnet.elf.out"
  115. CLEAN_COM="rm -f *.elf.* *.o"
  116. LIBS_TO_LINK="bio ip libc"
  117. LDFLAGS_EXTRA="-static -e_main"
  118. }
  119. cmd_ping()
  120. {
  121. BUILD_DIR=${CMD_DIR}/ip
  122. BUILD_IN="ping.c"
  123. BUILD_OUT="ping.elf.out"
  124. CLEAN_COM="rm -f *.elf.* *.o"
  125. LIBS_TO_LINK="ndb bio ip libc"
  126. LDFLAGS_EXTRA="-static -e_main"
  127. }
  128. cmd_ps()
  129. {
  130. BUILD_IN="ps.c"
  131. BUILD_OUT="ps.elf.out"
  132. CLEAN_COM="rm -f *.elf.* *.o"
  133. LIBS_TO_LINK="bio libc"
  134. LDFLAGS_EXTRA="-static -e_main"
  135. }
  136. cmd_cp()
  137. {
  138. BUILD_IN="cp.c"
  139. BUILD_OUT="cp.elf.out"
  140. CLEAN_COM="rm -f *.elf.* *.o"
  141. LIBS_TO_LINK="libc"
  142. LDFLAGS_EXTRA="-static -e_main"
  143. }
  144. cmd_testalarm()
  145. {
  146. BUILD_IN="testalarm.c"
  147. BUILD_OUT="testalarm.elf.out"
  148. CLEAN_COM="rm -f *.elf.* *.o"
  149. LIBS_TO_LINK="libc"
  150. LDFLAGS_EXTRA="-static -e_main"
  151. }
  152. cmd_cat()
  153. {
  154. BUILD_IN="cat.c"
  155. BUILD_OUT="cat.elf.out"
  156. CLEAN_COM="rm -f *.elf.* *.o"
  157. LIBS_TO_LINK="libc"
  158. LDFLAGS_EXTRA="-static -e_main"
  159. }