portmkfile 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. PFILES=`{builtin cd ../port;echo *.c | sed 's/ /|/g; s/\.c//g'}
  2. ^($PFILES)\.$O:R: '../port/\1.c'
  3. $CC $CFLAGS -I. ../port/$stem1.c
  4. IPFILES=`{builtin cd ../ip;echo *.c | sed 's/ /|/g; s/\.c//g'}
  5. ^($IPFILES)\.$O:R: '../ip/\1.c' ../ip/ip.h
  6. $CC $CFLAGS -I. ../ip/$stem1.c
  7. %.$O: %.s
  8. $AS $AFLAGS $stem.s
  9. %.$O: %.c
  10. $CC $CFLAGS $stem.c
  11. %.acid: %.c
  12. $CC $CFLAGS -a $stem.c >$stem.acid
  13. %.acid: ../ip/%.c
  14. $CC $CFLAGS -a -I. ../ip/$stem.c >$stem.acid
  15. %.acid: ../port/%.c
  16. $CC $CFLAGS -a -I. ../port/$stem.c >$stem.acid
  17. installall:V:
  18. for(i in $CONFLIST)
  19. mk 'CONF='$i install
  20. all:V:
  21. for(i in $CONFLIST)
  22. mk 'CONF='$i
  23. clean:V:
  24. rm -f *.[$OS] *.root.s cfs.h fs.h init.h conf.h *.out factotum.hack ipconfig.hack
  25. for(i in $CONFLIST)
  26. mk $i.clean
  27. %.clean:V:
  28. rm -f $stem.c [9bz]$stem [9bz]$stem.gz boot$stem.*
  29. %.$O: /$objtype/include/u.h ../port/lib.h mem.h dat.h fns.h io.h ../port/error.h ../port/portdat.h ../port/portfns.h
  30. ../port/systab.h: /sys/src/libc/9syscall/sys.h ../port/mksystab
  31. rc ../port/mksystab > ../port/systab.h
  32. $CONF.$O: $CONF.c
  33. $CC $CFLAGS '-DKERNDATE='`{date -n} $CONF.c
  34. $CONF.c: ../port/mkdevc $CONF
  35. rc ../port/mkdevc $CONF > $CONF.c
  36. errstr.h: ../port/mkerrstr ../port/error.h
  37. rc ../port/mkerrstr > errstr.h
  38. ../port/latin1.h: /lib/keyboard
  39. aux/mklatinkbd /lib/keyboard > ../port/latin1.h
  40. %.db: main.$O
  41. $CC -s$stem main.c | dbfmt > $stem.db
  42. alloc.$O: /sys/include/pool.h
  43. devmnt.$O: /sys/include/fcall.h
  44. proc.$O: errstr.h
  45. devroot.$O: errstr.h
  46. trap.$O: /$objtype/include/ureg.h
  47. devproc.$O: /$objtype/include/ureg.h
  48. main.$O: init.h
  49. trap.$O: ../port/systab.h
  50. devpipe.$O: ../port/netif.h
  51. netif.$O: ../port/netif.h
  52. devuart.$O: ../port/netif.h
  53. devmouse.$O: screen.h
  54. devdraw.$O: screen.h
  55. screen.$O: screen.h
  56. latin1.$O: ../port/latin1.h
  57. thwack.$O: ../port/thwack.h
  58. unthwack.$O: ../port/thwack.h
  59. devsdp.$O: ../port/thwack.h
  60. devrealtime.$O edf.$O realtime.$O: ../port/edf.h
  61. boot$CONF.out: $CONF print.$O $BOOTDIR/boot.c $BOOTLIB
  62. $BOOTDIR/mkboot $CONF > boot$CONF.c
  63. $CC $CFLAGS boot$CONF.c
  64. $LD -o boot$CONF.out boot$CONF.$O $BOOTLIB print.$O
  65. # this lets us say "factotum.hack factotum" instead of "/386/bin/auth/factotum factotum"
  66. # in the kernel config files. the latter won't work until we have long file names.
  67. factotum.hack: /$objtype/bin/auth/factotum
  68. cp $prereq $target
  69. ipconfig.hack: /$objtype/bin/ip/ipconfig
  70. cp $prereq $target