home *** CD-ROM | disk | FTP | other *** search
/ Piper's Pit BBS/FTP: ibm 0010 - 0019 / ibm0010-0019 / ibm0010.tar / ibm0010 / MINIX7.ZIP / MINIX7.TD0 / tools / at_makefile next >
Encoding:
Makefile  |  1989-10-03  |  2.2 KB  |  62 lines

  1. l=/usr/lib
  2. CFLAGS = -F -T.
  3.  
  4. all:
  5.     make init
  6.     make bootblok
  7.     make build
  8.  
  9. init:    $l/libc.a init.s $l/head.s
  10.     asld -o init  $l/head.s init.s $l/libc.a  $l/end.s
  11.     @echo init done.
  12.  
  13. # bootblok.s is the source of the MINIX boot block.  The bootblock is the
  14. # first 512 bytes on the image file and on the boot diskette.  When bootblok.s
  15. # is assembled, it generates a short binary file (less than 400 bytes) that
  16. # must be stripped of its header and copied to the file bootblok.  The dd
  17. # command below does this.  If everything has been done right, the bootblok
  18. # file should begin with the following 8 words, in hex:
  19. # c0b8 8e07 33d8 b8f6 2fe0 c08e ff33 00b9
  20. # The exact procedure for going from bootblok.s to the binary file stripped of
  21. # its header is somewhat operating system dependent.  Some assemblers make
  22. # an object (.s) file; others make an a.out file directly. If your boot 
  23. # diskette does not start out by printing 'Booting MINIX 1.0' the problem is
  24. # probably that you have not made a good boot block.
  25. bootblok:    bootblok.s
  26.     @asld  bootblok.s 
  27.     @dd if=a.out of=bootblok bs=16w skip=1 count=16 2>/dev/null
  28.     @rm a.out
  29.     @echo bootblok done.
  30.  
  31. build:    build.s
  32.     cc -o build build.s
  33.     @echo build done.
  34.  
  35. fsck:    fsck.s fsck1.s
  36.     @echo "Start linking fsck. "
  37.     asld -o fsck fsck1.s fsck.s $l/libc.a $l/end.s
  38.     @echo fsck done.
  39. fsck.s: fsck.c
  40.     cc -c -Di8088 -DSTANDALONE -F fsck.c
  41.  
  42. # 'make image'  combines the bootblock, kernel, memory manager, file 
  43. # system, init and fsck into a single file, called image.  Each of these pieces
  44. # appears in the image file just as the original does on the disk, except that
  45. # the header at the front is removed, and each piece is padded out to an
  46. # integral multiple of 16 bytes.  Build also prints a message telling how big
  47. # the various pieces (except fsck) are.
  48. #
  49. # 'make net' does the same thing, only with the networking code from the
  50. # 'amoeba directory included
  51. #
  52. image:    build bootblok 
  53.     @getlf "Insert blank diskette in drive 0 and hit return"
  54.     @build bootblok ../kernel/kernel ../mm/mm ../fs/fs init fsck image
  55.     @cp image /dev/fd0
  56.  
  57. net:    build bootblok 
  58.     @getlf "Insert blank diskette in drive 0 and hit return"
  59.     @build bootblok ../amoeba/kernel/kernel ../amoeba/mm/mm \
  60.         ../amoeba/fs/fs init fsck /dev/fd0
  61.  
  62.