mkfile 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190
  1. CONF=pc
  2. CONFLIST=pc pccpu pcf pccpuf pcdisk pcauth
  3. CRAPLIST=pccd pcflop
  4. EXTRACOPIES=
  5. #EXTRACOPIES=lookout boundary # copy to these servers on install
  6. objtype=386
  7. </$objtype/mkfile
  8. p=9
  9. # must match mem.h
  10. APBOOTSTRAP=0xF0003000
  11. KTZERO=0xF0100020
  12. DEVS=`{rc ../port/mkdevlist $CONF}
  13. PORT=\
  14. alarm.$O\
  15. alloc.$O\
  16. allocb.$O\
  17. auth.$O\
  18. cache.$O\
  19. chan.$O\
  20. dev.$O\
  21. edf.$O\
  22. fault.$O\
  23. latin1.$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. rdb.$O\
  33. rebootcmd.$O\
  34. segment.$O\
  35. swap.$O\
  36. sysfile.$O\
  37. sysproc.$O\
  38. taslock.$O\
  39. tod.$O\
  40. xalloc.$O\
  41. OBJ=\
  42. l.$O\
  43. plan9l.$O\
  44. cga.$O\
  45. i8253.$O\
  46. i8259.$O\
  47. kbd.$O\
  48. main.$O\
  49. memory.$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/libc.a\
  62. /$objtype/lib/libsec.a\
  63. ETHER=`{echo devether.c ether*.c | sed 's/\.c/.'$O'/g'}
  64. VGA=`{echo devvga.c screen.c vga*.c | sed 's/\.c/.'$O'/g'}
  65. SDEV=`{echo devsd.c sd*.c | sed 's/\.c/.'$O'/g'}
  66. $p$CONF: $CONF.c $OBJ $LIB
  67. $CC $CFLAGS '-DKERNDATE='`{date -n} $CONF.c
  68. $LD -o $target -T$KTZERO -l $OBJ $CONF.$O $LIB
  69. size $target
  70. # don't strip the gzipped kernels -- too frustrating when that's all you have!
  71. $p%.gz: $p%
  72. gzip -9 <$p$stem >$p$stem.gz
  73. # pcflop and pccd need all the space they can get
  74. 9pcflop.gz: 9pcflop
  75. strip -o /fd/1 9pcflop | gzip -9 >9pcflop.gz
  76. 9pccd.gz: 9pccd
  77. strip -o /fd/1 9pccd | gzip -9 >9pccd.gz
  78. install:V: $p$CONF $p$CONF.gz
  79. cp $p$CONF $p$CONF.gz /$objtype/
  80. for(i in $EXTRACOPIES)
  81. import $i / /n/$i && cp $p$CONF $p$CONF.gz /n/$i/$objtype/
  82. <../boot/bootmkfile
  83. <../port/portmkfile
  84. <|../port/mkbootrules $CONF
  85. $ETHER: etherif.h ../port/netif.h
  86. ether8003.$O ether8390.$O: ether8390.h
  87. $VGA mouse.$O: screen.h
  88. devfloppy.$O: floppy.h
  89. archmp.$O mp.$O: apbootstrap.h
  90. apic.$O archmp.$O mp.$O: mp.h
  91. $SDEV: ../port/sd.h
  92. sd53c8xx.$O: sd53c8xx.i
  93. main.$O: init.h reboot.h
  94. wavelan.$O: wavelan.c ../pc/wavelan.c ../pc/wavelan.h
  95. etherwavelan.$O: etherwavelan.c ../pc/wavelan.h
  96. devusb.$O usbuhci.$O usbohci.$O: usb.h
  97. trap.$O: /sys/include/tos.h
  98. uartaxp.$O: uartaxp.i
  99. init.h: ../port/initcode.c init9.c
  100. $CC ../port/initcode.c
  101. $CC init9.c
  102. $LD -l -R1 -o init.out init9.$O initcode.$O /386/lib/libc.a
  103. strip init.out
  104. {echo 'uchar initcode[]={'
  105. cat init.out | xd -1x |
  106. sed -e 's/^[0-9a-f]+ //' -e 's/ ([0-9a-f][0-9a-f])/0x\1,/g'
  107. echo '};'} > init.h
  108. reboot.h: rebootcode.s
  109. $AS rebootcode.s
  110. $LD -l -s -T0x11000 -R4 -o reboot.out rebootcode.$O
  111. {echo 'uchar rebootcode[]={'
  112. xd -1x reboot.out |
  113. sed -e '1,2d' -e 's/^[0-9a-f]+ //' -e 's/ ([0-9a-f][0-9a-f])/0x\1,/g'
  114. echo '};'} > reboot.h
  115. apbootstrap.h: apbootstrap.s mem.h
  116. $AS $prereq
  117. $LD -o apbootstrap.out -T$APBOOTSTRAP -R4 -l -s apbootstrap.$O
  118. {echo 'uchar apbootstrap[]={'
  119. xd -1x apbootstrap.out |
  120. sed -e '1,2d' -e 's/^[0-9a-f]+ //' -e 's/ ([0-9a-f][0-9a-f])/0x\1,/g'
  121. echo '};'} > $target
  122. sd53c8xx.i: sd53c8xx.n
  123. aux/na $prereq > $target
  124. uartaxp.i: a100p.cp
  125. {echo 'static uchar uartaxpcp[] = {'
  126. xd -1x $prereq |
  127. sed -e 's/^[0-9a-f]+ //' -e '/^$/d' -e 's/ ([0-9a-f][0-9a-f])/0x\1,/g'
  128. echo '};'
  129. } > $target
  130. acid:V:
  131. 8c -a -w -I. i8253.c>acid
  132. %.checkether:VQ:
  133. for (i in ether*.c){
  134. x=`{echo $i | sed 's/\.c//'}
  135. if(! ~ $x ether8390 && ! grep -s '^ '^$x^'([ ]|$)' $stem)
  136. echo $x not included in $stem
  137. }
  138. exit 0
  139. %.checkvga:VQ:
  140. for (i in vga*.c){
  141. x=`{echo $i | sed 's/\.c//'}
  142. if(! ~ $x vga vgax vgasavage && ! grep -s '^ '^$x^'([ ]|$)' $stem)
  143. echo $x not included in $stem
  144. }
  145. exit 0
  146. checkdist:VQ:
  147. for(i in pcdisk pcflop)
  148. for(j in checkvga checkether)
  149. mk $i.$j
  150. %.clean:V:
  151. rm -f $stem.c [9bz]$stem [9bz]$stem.gz boot$stem.* reboot.h apbootstrap.h init.h
  152. # testing
  153. 9load:D: /usr/rsc/boot/$O.load 9pcload
  154. cat $prereq >$target
  155. 9load.flp: 9load
  156. disk/format -b /386/pbs -df $target $prereq
  157. $p$CONF.flp: /386/9load plan9.ini $p$CONF.gz
  158. disk/format -b /386/pbs -df $target $prereq