mkfile 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195
  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/libip.a\
  62. /$objtype/lib/libc.a\
  63. /$objtype/lib/libsec.a\
  64. /$objtype/lib/libmp.a\
  65. ETHER=`{echo devether.c ether*.c | sed 's/\.c/.'$O'/g'}
  66. VGA=`{echo devvga.c screen.c vga*.c | sed 's/\.c/.'$O'/g'}
  67. SDEV=`{echo devsd.c sd*.c | sed 's/\.c/.'$O'/g'}
  68. $p$CONF: $CONF.c $OBJ $LIB
  69. $CC $CFLAGS '-DKERNDATE='`{date -n} $CONF.c
  70. $LD -o $target -T$KTZERO -l $OBJ $CONF.$O $LIB
  71. size $target
  72. # don't strip the gzipped kernels -- too frustrating when that's all you have!
  73. $p%.gz: $p%
  74. gzip -9 <$p$stem >$p$stem.gz
  75. # pcflop and pccd need all the space they can get
  76. 9pcflop.gz: 9pcflop
  77. strip -o /fd/1 9pcflop | gzip -9 >9pcflop.gz
  78. 9pccd.gz: 9pccd
  79. strip -o /fd/1 9pccd | gzip -9 >9pccd.gz
  80. install:V: $p$CONF $p$CONF.gz
  81. cp $p$CONF $p$CONF.gz /$objtype/
  82. for(i in $EXTRACOPIES)
  83. import $i / /n/$i && cp $p$CONF $p$CONF.gz /n/$i/$objtype/
  84. <../boot/bootmkfile
  85. <../port/portmkfile
  86. <|../port/mkbootrules $CONF
  87. $ETHER: etherif.h ../port/netif.h
  88. ether8003.$O ether8390.$O: ether8390.h
  89. $VGA mouse.$O: screen.h
  90. devfloppy.$O: floppy.h
  91. archmp.$O mp.$O: apbootstrap.h
  92. apic.$O archmp.$O mp.$O: mp.h
  93. $SDEV: ../port/sd.h
  94. sd53c8xx.$O: sd53c8xx.i
  95. sdiahci.$O: ahci.h
  96. devaoe.$O sdaoe.$O: ../port/aoe.h
  97. main.$O: init.h reboot.h
  98. wavelan.$O: wavelan.c ../pc/wavelan.c ../pc/wavelan.h
  99. etherwavelan.$O: etherwavelan.c ../pc/wavelan.h
  100. devusb.$O usbuhci.$O usbohci.$O: usb.h
  101. trap.$O: /sys/include/tos.h
  102. uartaxp.$O: uartaxp.i
  103. etherm10g.$O: etherm10g2k.i etherm10g4k.i
  104. init.h: ../port/initcode.c init9.c
  105. $CC ../port/initcode.c
  106. $CC init9.c
  107. $LD -l -R1 -o init.out init9.$O initcode.$O /386/lib/libc.a
  108. strip init.out
  109. {echo 'uchar initcode[]={'
  110. cat init.out | xd -1x |
  111. sed -e 's/^[0-9a-f]+ //' -e 's/ ([0-9a-f][0-9a-f])/0x\1,/g'
  112. echo '};'} > init.h
  113. reboot.h: rebootcode.s
  114. $AS rebootcode.s
  115. $LD -l -s -T0x11000 -R4 -o reboot.out rebootcode.$O
  116. {echo 'uchar rebootcode[]={'
  117. xd -1x reboot.out |
  118. sed -e '1,2d' -e 's/^[0-9a-f]+ //' -e 's/ ([0-9a-f][0-9a-f])/0x\1,/g'
  119. echo '};'} > reboot.h
  120. apbootstrap.h: apbootstrap.s mem.h
  121. $AS $prereq
  122. $LD -o apbootstrap.out -T$APBOOTSTRAP -R4 -l -s apbootstrap.$O
  123. {echo 'uchar apbootstrap[]={'
  124. xd -1x apbootstrap.out |
  125. sed -e '1,2d' -e 's/^[0-9a-f]+ //' -e 's/ ([0-9a-f][0-9a-f])/0x\1,/g'
  126. echo '};'} > $target
  127. sd53c8xx.i: sd53c8xx.n
  128. aux/na $prereq > $target
  129. uartaxp.i: a100p.cp
  130. {echo 'static uchar uartaxpcp[] = {'
  131. xd -1x $prereq |
  132. sed -e 's/^[0-9a-f]+ //' -e '/^$/d' -e 's/ ([0-9a-f][0-9a-f])/0x\1,/g'
  133. echo '};'
  134. } > $target
  135. acid:V:
  136. 8c -a -w -I. i8253.c>acid
  137. %.checkether:VQ:
  138. for (i in ether*.c){
  139. x=`{echo $i | sed 's/\.c//'}
  140. if(! ~ $x ether8390 && ! grep -s '^ '^$x^'([ ]|$)' $stem)
  141. echo $x not included in $stem
  142. }
  143. exit 0
  144. %.checkvga:VQ:
  145. for (i in vga*.c){
  146. x=`{echo $i | sed 's/\.c//'}
  147. if(! ~ $x vga vgax vgasavage && ! grep -s '^ '^$x^'([ ]|$)' $stem)
  148. echo $x not included in $stem
  149. }
  150. exit 0
  151. checkdist:VQ:
  152. for(i in pcdisk pcflop)
  153. for(j in checkvga checkether)
  154. mk $i.$j
  155. %.clean:V:
  156. rm -f $stem.c [9bz]$stem [9bz]$stem.gz boot$stem.* reboot.h apbootstrap.h init.h
  157. # testing
  158. 9load:D: /usr/rsc/boot/$O.load 9pcload
  159. cat $prereq >$target
  160. 9load.flp: 9load
  161. disk/format -b /386/pbs -df $target $prereq
  162. $p$CONF.flp: /386/9load plan9.ini $p$CONF.gz
  163. disk/format -b /386/pbs -df $target $prereq