mkfile 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. CONF=k8cpu
  2. CONFLIST=k8cpu
  3. objtype=amd64
  4. # override with the list of paths where to put extra
  5. # copies of the kernel. for each word $w in OTHERCOPIES,
  6. # the kernel is copied to $w/$objtype/...
  7. OTHERCOPIES=''
  8. </$objtype/mkfile
  9. p=9
  10. 9k:V: $p$CONF
  11. <| awk -f ../mk/parse $CONF
  12. <../mk/bootmkfile
  13. <../mk/portmkfile
  14. OBJ=$MACH $CONF.root.$O $DEVS $PORT
  15. $p$CONF: $CONF.c $OBJ $LIB
  16. $CC $CFLAGS '-DKERNDATE='`{date -n} -c $CONF.c
  17. $LD -o $target -T0xfffffffff0110000 -R4096 -l $OBJ $CONF.$O $LIB
  18. $LD -o $target.elf -H5 -8 -T0xfffffffff0110000 -l $OBJ $CONF.$O $LIB
  19. size $target
  20. $p$CONF.gz: $p$CONF
  21. strip -o /fd/1 $p$CONF | gzip -9 > $p$CONF.gz
  22. install:QV: $p$CONF $p$CONF.gz
  23. for(d in '' $OTHERCOPIES){
  24. if(test -d $d/$objtype){
  25. cp $p$CONF $d/$objtype/$p$CONF
  26. cp $p$CONF.gz $d/$objtype/$p$CONF.gz
  27. ls -l $d/$objtype/$p$CONF $d/$objtype/$p$CONF.gz
  28. }
  29. }
  30. echo done
  31. init.out: init9.$O initcode.$O /$objtype/lib/libc.a
  32. $CC $CFLAGS -o init.out init9.$O initcode.$O -L/$objtype/lib/libc.a
  33. #$LD -l -R1 -s -o init.out init9.$O initcode.$O -lc
  34. l32p.$O: ${objtype}l.h
  35. l64idt.$O: ${objtype}l.h
  36. l64syscall.$O: ${objtype}l.h
  37. l64sipi.$O: ${objtype}l.h
  38. l64v.$O: ${objtype}l.h
  39. l64acidt.$O: ${objtype}l.h
  40. l64acsyscall.$O: ${objtype}l.h
  41. ${objtype}l.h: $objtype.h
  42. rc ../mk/mkenum $objtype.h > $target
  43. apic.$O: apic.h io.h
  44. devarch.$O: ../port/error.h /$objtype/include/ureg.h
  45. fpu.$O: amd64.h
  46. fpu.$O: /$objtype/include/ureg.h
  47. ioapic.$O: apic.h io.h
  48. main.$O: /sys/include/pool.h init.h
  49. memory.$O: amd64.h
  50. mmu.$O: amd64.h
  51. mp.$O: apic.h
  52. sipi.$O: apic.h sipi.h
  53. svm.$O: amd64.h
  54. svm.$O: /$objtype/include/ureg.h
  55. syscall.$O: ../port/error.h /sys/src/libc/9syscall/sys.h
  56. syscall.$O: /sys/include/tos.h /$objtype/include/ureg.h
  57. syscall.$O: amd64.h
  58. trap.$O: ../port/error.h io.h
  59. trap.$O: /sys/include/tos.h /$objtype/include/ureg.h
  60. devaoe.$O: ../port/error.h ../port/netif.h ../ip/ip.h
  61. devaoe.$O: ../port/aoe.h etherif.h
  62. devether.$O: ../port/error.h ../port/netif.h etherif.h
  63. devrtc.$O: ../port/error.h
  64. ether8169.$O: ../port/error.h ../port/ethermii.h ../port/netif.h
  65. ether8169.$O: etherif.h
  66. ether82557.$O: ../port/netif.h
  67. ether82557.$O: etherif.h io.h
  68. etherigbe.$O: ../port/error.h ../port/ethermii.h ../port/netif.h
  69. etherigbe.$O: etherif.h io.h
  70. etherm10g.$O: ../port/error.h ../port/netif.h
  71. etherm10g.$O: etherif.h io.h
  72. etherm10g.$O: ../386/etherm10g2k.i ../386/etherm10g4k.i
  73. i8259.$O: io.h
  74. kbd.$O: ../port/error.h io.h
  75. pci.$O: io.h
  76. sdaoe.$O: ../port/error.h ../port/netif.h ../port/sd.h
  77. sdaoe.$O: ../port/aoe.h etherif.h io.h
  78. sdscsi.$O: ../port/error.h
  79. random.$O: ../port/error.h
  80. devacpi.$O: acpi.h
  81. physalloc.$O: acpi.h
  82. sipi.h: l64sipi.$O
  83. $LD -o l64sipi.out -T0xfffffffff0003000 -R4 -l -s $prereq
  84. {echo 'uchar sipihandler[]={'
  85. xd -1x l64sipi.out |
  86. sed -e 's/^[0-9a-f]+ //' \
  87. -e '1,2d' -e '3s/^ .. .. .. .. .. .. .. ..//' \
  88. -e 's/ ([0-9a-f][0-9a-f])/0x\1,/g'
  89. echo '};'} > $target
  90. ../root/nvram:
  91. dd -if /dev/zero -of ../root/nvram -bs 512 -count 1
  92. nvram=../root/nvram auth/wrkey