mkfile 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135
  1. CONF=plug
  2. CONFLIST=plug
  3. # allegedly u-boot uses the bottom 8MB (up to 0x800000)
  4. # so avoid that
  5. loadaddr=0x60800000
  6. objtype=arm
  7. </$objtype/mkfile
  8. p=9
  9. DEVS=`{rc ../port/mkdevlist $CONF}
  10. PORT=\
  11. alarm.$O\
  12. alloc.$O\
  13. allocb.$O\
  14. auth.$O\
  15. cache.$O\
  16. chan.$O\
  17. dev.$O\
  18. devtab.$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. cga.$O\
  45. clock.$O\
  46. fpi.$O\
  47. fpiarm.$O\
  48. fpimem.$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. # HFILES=
  58. LIB=\
  59. /$objtype/lib/libmemlayer.a\
  60. /$objtype/lib/libmemdraw.a\
  61. /$objtype/lib/libdraw.a\
  62. /$objtype/lib/libip.a\
  63. /$objtype/lib/libsec.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 $OBJ $CONF.$O $LIB
  73. size $target
  74. $p$CONF.gz:D: $p$CONF
  75. gzip -9 <$p$CONF >$target
  76. $OBJ: $HFILES
  77. install:V: /$objtype/$p$CONF
  78. /$objtype/$p$CONF:D: $p$CONF s$p$CONF
  79. { cp -x $p$CONF s$p$CONF /$objtype } &
  80. { 9fs lookout && cp -x $p$CONF s$p$CONF /n/lookout/$objtype } &
  81. # { 9fs piestand && cp -x $p$CONF s$p$CONF /n/piestand/$objtype } &
  82. wait
  83. touch $target
  84. <../boot/bootmkfile
  85. <../port/portmkfile
  86. <|../port/mkbootrules $CONF
  87. # CFLAGS= -I. -I../port $CFLAGS # hack to compile private sysproc.c (e.g.)
  88. arch.$O clock.$O fpiarm.$O main.$O mmu.$O screen.$O sdscsi.$O syscall.$O \
  89. trap.$O: /$objtype/include/ureg.h
  90. archkw.$O devether.$0 etherkw.$O ethermii.$O: \
  91. etherif.h ethermii.h ../port/netif.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. main.$O: errstr.h init.h reboot.h
  95. mouse.$O: screen.h
  96. devusb.$O: usb.h
  97. usbehci.$O usbohci.$O usbuhci.$O: usb.h usbehci.h uncached.h
  98. init.h:D: ../port/initcode.c init9.s
  99. $CC ../port/initcode.c
  100. $AS init9.s
  101. $LD -l -R1 -s -o init.out init9.$O initcode.$O /$objtype/lib/libc.a
  102. {echo 'uchar initcode[]={'
  103. xd -1x <init.out |
  104. sed -e 's/^[0-9a-f]+ //' -e 's/ ([0-9a-f][0-9a-f])/0x\1,/g'
  105. echo '};'} > init.h
  106. reboot.h:D: rebootcode.s arm.s arm.h mem.h
  107. $AS rebootcode.s
  108. # -lc is only for memmove. -T arg is PADDR(REBOOTADDR)
  109. $LD -l -a -s -T0x100 -R4 -o reboot.out rebootcode.$O -lc >reboot.list
  110. {echo 'uchar rebootcode[]={'
  111. xd -1x reboot.out |
  112. sed -e '1,2d' -e 's/^[0-9a-f]+ //' -e 's/ ([0-9a-f][0-9a-f])/0x\1,/g'
  113. echo '};'} > reboot.h
  114. errstr.h:D: ../port/mkerrstr ../port/error.h
  115. rc ../port/mkerrstr > errstr.h