mkfile 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151
  1. CONF=pc
  2. CONFLIST=pc pccpu pcf pccpuf pcdisk pcauth
  3. CRAPLIST=pccd pccpud pccpusape pcext pcf pcflop pcglenda pcgr pclml pcmartha pcsape pcblast
  4. objtype=386
  5. </$objtype/mkfile
  6. p=9
  7. DEVS=`{rc ../port/mkdevlist $CONF}
  8. PORT=\
  9. alarm.$O\
  10. alloc.$O\
  11. allocb.$O\
  12. auth.$O\
  13. cache.$O\
  14. chan.$O\
  15. dev.$O\
  16. fault.$O\
  17. latin1.$O\
  18. edf.$O\
  19. page.$O\
  20. parse.$O\
  21. pgrp.$O\
  22. portclock.$O\
  23. print.$O\
  24. proc.$O\
  25. qio.$O\
  26. qlock.$O\
  27. rebootcmd.$O\
  28. segment.$O\
  29. swap.$O\
  30. sysfile.$O\
  31. sysproc.$O\
  32. taslock.$O\
  33. tod.$O\
  34. xalloc.$O\
  35. OBJ=\
  36. l.$O\
  37. plan9l.$O\
  38. cga.$O\
  39. i8253.$O\
  40. i8259.$O\
  41. kbd.$O\
  42. main.$O\
  43. memory.$O\
  44. mmu.$O\
  45. random.$O\
  46. rdb.$O\
  47. trap.$O\
  48. $CONF.root.$O\
  49. $CONF.rootc.$O\
  50. $DEVS\
  51. $PORT\
  52. LIB=\
  53. /$objtype/lib/libmemlayer.a\
  54. /$objtype/lib/libmemdraw.a\
  55. /$objtype/lib/libdraw.a\
  56. /$objtype/lib/libc.a\
  57. /$objtype/lib/libsec.a\
  58. ETHER=`{echo devether.c ether*.c | sed 's/\.c/.'$O'/g'}
  59. VGA=`{echo devvga.c screen.c vga*.c | sed 's/\.c/.'$O'/g'}
  60. SDEV=`{echo devsd.c sd*.c | sed 's/\.c/.'$O'/g'}
  61. $p$CONF: $CONF.c $OBJ $LIB
  62. $CC $CFLAGS '-DKERNDATE='`{date -n} $CONF.c
  63. $LD -o $target -T0x80100020 -l $OBJ $CONF.$O $LIB
  64. size $target
  65. $p$CONF.gz: $p$CONF
  66. strip < $p$CONF | gzip -9 > $p$CONF.gz
  67. install:V: $p$CONF $p$CONF.gz
  68. cp $p$CONF $p$CONF.gz /$objtype/
  69. import lookout / /n/lookout && cp $p$CONF $p$CONF.gz /n/lookout/$objtype/
  70. <../boot/bootmkfile
  71. <../port/portmkfile
  72. <|../port/mkbootrules $CONF
  73. $ETHER: etherif.h ../port/netif.h
  74. ether8003.$O ether8390.$O: ether8390.h
  75. $VGA mouse.$O: screen.h
  76. devfloppy.$O: floppy.h
  77. archmp.$O mp.$O: apbootstrap.h
  78. apic.$O archmp.$O mp.$O: mp.h
  79. $SDEV: ../port/sd.h
  80. sd53c8xx.$O: sd53c8xx.i
  81. main.$O: init.h reboot.h
  82. wavelan.$O: wavelan.c ../pc/wavelan.c ../pc/wavelan.h
  83. etherwavelan.$O: etherwavelan.c ../pc/wavelan.h
  84. devusb.$O usbuhci.$O usbohci.$O: usb.h
  85. trap.$O: /sys/include/tos.h
  86. sd53c8xx.i: sd53c8xx.n
  87. aux/na $prereq > $target
  88. init.h: ../port/initcode.c init9.c
  89. $CC ../port/initcode.c
  90. $CC init9.c
  91. $LD -l -R1 -o init.out init9.$O initcode.$O /386/lib/libc.a
  92. {echo 'uchar initcode[]={'
  93. strip < init.out | xd -1x |
  94. sed -e 's/^[0-9a-f]+ //' -e 's/ ([0-9a-f][0-9a-f])/0x\1,/g'
  95. echo '};'} > init.h
  96. reboot.h: rebootcode.s
  97. $AS rebootcode.s
  98. $LD -l -s -T0x1000 -R4 -o reboot.out rebootcode.$O
  99. {echo 'uchar rebootcode[]={'
  100. xd -1x reboot.out |
  101. sed -e '1,2d' -e 's/^[0-9a-f]+ //' -e 's/ ([0-9a-f][0-9a-f])/0x\1,/g'
  102. echo '};'} > reboot.h
  103. apbootstrap.h: apbootstrap.s mem.h
  104. $AS $prereq
  105. $LD -o apbootstrap.out -T0x80001000 -R4 -l -s apbootstrap.$O
  106. {echo 'uchar apbootstrap[]={'
  107. xd -1x apbootstrap.out |
  108. sed -e '1,2d' -e 's/^[0-9a-f]+ //' -e 's/ ([0-9a-f][0-9a-f])/0x\1,/g'
  109. echo '};'} > $target
  110. acid:V:
  111. 8c -a -w -I. ../port/qio.c>acid
  112. %.checkether:VQ:
  113. for (i in ether*.c){
  114. x=`{echo $i | sed 's/\.c//'}
  115. if(! ~ $x ether8390 && ! grep -s '^ '^$x^'([ ]|$)' $stem)
  116. echo $x not included in $stem
  117. }
  118. exit 0
  119. %.checkvga:VQ:
  120. for (i in vga*.c){
  121. x=`{echo $i | sed 's/\.c//'}
  122. if(! ~ $x vga vgax vgasavage && ! grep -s '^ '^$x^'([ ]|$)' $stem)
  123. echo $x not included in $stem
  124. }
  125. exit 0
  126. checkdist:VQ:
  127. for(i in pcdisk pcflop)
  128. for(j in checkvga checkether)
  129. mk $i.$j
  130. %.clean:V:
  131. rm -f $stem.c [9bz]$stem [9bz]$stem.gz boot$stem.*