mkfile 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154
  1. CONF=ts
  2. CONFLIST=ts
  3. EXTRACOPIES=
  4. # allegedly u-boot uses the bottom 4MB (up to 0x400000) so avoid that,
  5. # and leave 64K for plan9.ini. loadaddr must match KTZERO in mem.h
  6. # and CONFADDR must be 0x10000 lower.
  7. loadaddr=0xc0410000
  8. objtype=arm
  9. </$objtype/mkfile
  10. p=9
  11. DEVS=`{rc ../port/mkdevlist $CONF}
  12. PORT=\
  13. alarm.$O\
  14. alloc.$O\
  15. allocb.$O\
  16. auth.$O\
  17. cache.$O\
  18. chan.$O\
  19. dev.$O\
  20. edf.$O\
  21. fault.$O\
  22. latin1.$O\
  23. mul64fract.$O\
  24. rebootcmd.$O\
  25. page.$O\
  26. parse.$O\
  27. pgrp.$O\
  28. portclock.$O\
  29. print.$O\
  30. proc.$O\
  31. qio.$O\
  32. qlock.$O\
  33. segment.$O\
  34. swap.$O\
  35. sysfile.$O\
  36. sysproc.$O\
  37. taslock.$O\
  38. tod.$O\
  39. xalloc.$O\
  40. OBJ=\
  41. l.$O\
  42. lexception.$O\
  43. lproc.$O\
  44. arch.$O\
  45. clock.$O\
  46. clock-tegra.$O\
  47. kbd.$O\
  48. main.$O\
  49. mmu.$O\
  50. random.$O\
  51. trap.$O\
  52. $CONF.root.$O\
  53. $CONF.rootc.$O\
  54. $DEVS\
  55. $PORT\
  56. HFILES=\
  57. arm.h\
  58. dat.h\
  59. ../port/error.h\
  60. errstr.h\
  61. fns.h\
  62. io.h\
  63. ../port/lib.h\
  64. mem.h\
  65. ../port/portdat.h\
  66. ../port/portfns.h\
  67. /$objtype/include/u.h\
  68. LIB=\
  69. /$objtype/lib/libmemlayer.a\
  70. /$objtype/lib/libmemdraw.a\
  71. /$objtype/lib/libdraw.a\
  72. /$objtype/lib/libip.a\
  73. /$objtype/lib/libsec.a\
  74. /$objtype/lib/libmp.a\
  75. /$objtype/lib/libc.a\
  76. 9:V: $p$CONF s$p$CONF
  77. $p$CONF:DQ: $CONF.c $OBJ $LIB mkfile
  78. $CC $CFLAGS '-DKERNDATE='`{date -n} $CONF.c
  79. echo '# linking raw kernel' # H6: no headers, data segment aligned
  80. $LD -o $target -H6 -R4096 -T$loadaddr -l $OBJ $CONF.$O $LIB
  81. s$p$CONF:DQ: $CONF.$O $OBJ $LIB
  82. echo '# linking 9 kernel with symbols'
  83. # $LD -o $target -R4096 -T$loadaddr -l -a $OBJ $CONF.$O $LIB >$target.list
  84. $LD -o $target -R4096 -T$loadaddr -l $OBJ $CONF.$O $LIB
  85. size $target
  86. $p$CONF.gz:D: $p$CONF
  87. gzip -9 <$p$CONF >$target
  88. $OBJ: $HFILES
  89. install:V: /$objtype/$p$CONF
  90. /$objtype/$p$CONF:D: $p$CONF s$p$CONF
  91. cp -x $p$CONF s$p$CONF /$objtype/ &
  92. for(i in $EXTRACOPIES)
  93. { 9fs $i && cp $p$CONF s$p$CONF /n/$i/$objtype && echo -n $i... & }
  94. wait
  95. echo
  96. touch $target
  97. <../boot/bootmkfile
  98. <../port/portmkfile
  99. <|../port/mkbootrules $CONF
  100. CFLAGS= -I. -I../port $CFLAGS # hack to compile private sysproc.c (e.g.)
  101. arch.$O clock.$O fpiarm.$O main.$O mmu.$O screen.$O sdscsi.$O syscall.$O \
  102. trap.$O: /$objtype/include/ureg.h
  103. archtegra.$O devether.$0 ether9221.$O: etherif.h ../port/netif.h
  104. archtegra.$O devflash.$O flashtegra.$O flashigep.$O: ../port/flashif.h
  105. ecc.$O flashtegra.$O flashigep.$O: ../port/nandecc.h io.h
  106. fpi.$O fpiarm.$O fpimem.$O: fpi.h
  107. l.$O lexception.$O lproc.$O mmu.$O: arm.s mem.h
  108. l.$O rebootcode.$O: cache.v7.s
  109. main.$O: errstr.h init.h reboot.h
  110. devdss.$O devmouse.$O mouse.$O screen.$O: screen.h
  111. devusb.$O: ../port/usb.h
  112. usbehci.$O usbohci.$O usbuhci.$O: ../port/usb.h usbehci.h uncached.h
  113. init.h:D: ../port/initcode.c init9.s
  114. $CC ../port/initcode.c
  115. $AS init9.s
  116. $LD -l -R1 -s -o init.out init9.$O initcode.$O /$objtype/lib/libc.a
  117. {echo 'uchar initcode[]={'
  118. xd -1x <init.out |
  119. sed -e 's/^[0-9a-f]+ //' -e 's/ ([0-9a-f][0-9a-f])/0x\1,/g'
  120. echo '};'} > init.h
  121. reboot.h:D: rebootcode.s cache.v7.s arm.s arm.h mem.h
  122. $AS rebootcode.s
  123. # -lc is only for memmove. -T arg is PADDR(REBOOTADDR)
  124. # $LD -l -a -s -T0x100 -R4 -o reboot.out rebootcode.$O -lc >reboot.list
  125. $LD -l -s -T0x100 -R4 -o reboot.out rebootcode.$O -lc
  126. {echo 'uchar rebootcode[]={'
  127. xd -1x reboot.out |
  128. sed -e '1,2d' -e 's/^[0-9a-f]+ //' -e 's/ ([0-9a-f][0-9a-f])/0x\1,/g'
  129. echo '};'} > reboot.h
  130. errstr.h:D: ../port/mkerrstr ../port/error.h
  131. rc ../port/mkerrstr > errstr.h
  132. $CONF.clean:
  133. rm -rf $p$CONF s$p$CONF errstr.h reboot.h $CONF.c boot$CONF.c