mkfile 3.1 KB

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