Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # use normal make for this Makefile
- #
- # Makefile for building user programs to run on top of Nachos
- #
- # Several things to be aware of:
- #
- # Nachos assumes that the location of the program startup routine (the
- # location the kernel jumps to when the program initially starts up)
- # is at location 0. This means: start.o must be the first .o passed
- # to ld, in order for the routine "Start" to be loaded at location 0
- #
- # if you are cross-compiling, you need to point to the right executables
- # and change the flags to ld and the build procedure for as
- GCCDIR = ../../../gnu-decstation-ultrix/decstation-ultrix/2.95.3/
- LDFLAGS = -T script -N
- ASFLAGS = -mips2
- CPPFLAGS = $(INCDIR)
- # if you aren't cross-compiling:
- # GCCDIR =
- # LDFLAGS = -N -T 0
- # ASFLAGS =
- # CPPFLAGS = -P $(INCDIR)
- PATH = $(GCCDIR):/lib:/usr/bin:/bin
- CC = $(GCCDIR)gcc -B../../../gnu-decstation-ultrix/
- AS = $(GCCDIR)as
- LD = $(GCCDIR)ld
- CPP = gcc -E
- INCDIR =-I../userprog -I../threads
- CFLAGS = -G 0 -c $(INCDIR)
- # Them ten file muon bien dich sau 'all'
- all: halt shell matmult sort PrintInt ReadInt ReadChar PrintChar PrintString ReadString Ascii Help cmain cat echo Create copy reverse
- start.o: start.s ../userprog/syscall.h
- $(CPP) $(CPPFLAGS) start.c > strt.s
- $(AS) $(ASFLAGS) -o start.o strt.s
- rm strt.s
- halt.o: halt.c
- $(CC) $(CFLAGS) -c halt.c
- halt: halt.o start.o
- $(LD) $(LDFLAGS) start.o halt.o -o halt.coff
- ../bin/coff2noff halt.coff halt
- shell.o: shell.c
- $(CC) $(CFLAGS) -c shell.c
- shell: shell.o start.o
- $(LD) $(LDFLAGS) start.o shell.o -o shell.coff
- ../bin/coff2noff shell.coff shell
- sort.o: sort.c
- $(CC) $(CFLAGS) -c sort.c
- sort: sort.o start.o
- $(LD) $(LDFLAGS) start.o sort.o -o sort.coff
- ../bin/coff2noff sort.coff sort
- matmult.o: matmult.c
- $(CC) $(CFLAGS) -c matmult.c
- matmult: matmult.o start.o
- $(LD) $(LDFLAGS) start.o matmult.o -o matmult.coff
- ../bin/coff2noff matmult.coff matmult
- # Them lenh tao file thuc thi ma may .coff tu file .c sau khi he thong bien dich thanh cong
- ReadInt.o: ReadInt.c
- $(CC) $(CFLAGS) -c ReadInt.c
- ReadInt: ReadInt.o start.o
- $(LD) $(LDFLAGS) start.o ReadInt.o -o ReadInt.coff
- ../bin/coff2noff ReadInt.coff ReadInt
- PrintInt.o: PrintInt.c
- $(CC) $(CFLAGS) -c PrintInt.c
- PrintInt: PrintInt.o start.o
- $(LD) $(LDFLAGS) start.o PrintInt.o -o PrintInt.coff
- ../bin/coff2noff PrintInt.coff PrintInt
- ReadChar.o: ReadChar.c
- $(CC) $(CFLAGS) -c ReadChar.c
- ReadChar: ReadChar.o start.o
- $(LD) $(LDFLAGS) start.o ReadChar.o -o ReadChar.coff
- ../bin/coff2noff ReadChar.coff ReadChar
- PrintChar.o: PrintChar.c
- $(CC) $(CFLAGS) -c PrintChar.c
- PrintChar: PrintChar.o start.o
- $(LD) $(LDFLAGS) start.o PrintChar.o -o PrintChar.coff
- ../bin/coff2noff PrintChar.coff PrintChar
- ReadString.o: ReadString.c
- $(CC) $(CFLAGS) -c ReadString.c
- ReadString: ReadString.o start.o
- $(LD) $(LDFLAGS) start.o ReadString.o -o ReadString.coff
- ../bin/coff2noff ReadString.coff ReadString
- PrintString.o: PrintString.c
- $(CC) $(CFLAGS) -c PrintString.c
- PrintString: PrintString.o start.o
- $(LD) $(LDFLAGS) start.o PrintString.o -o PrintString.coff
- ../bin/coff2noff PrintString.coff PrintString
- Ascii.o: Ascii.c
- $(CC) $(CFLAGS) -c Ascii.c
- Ascii: Ascii.o start.o
- $(LD) $(LDFLAGS) start.o Ascii.o -o Ascii.coff
- ../bin/coff2noff Ascii.coff Ascii
- Help.o: Help.c
- $(CC) $(CFLAGS) -c Help.c
- Help: Help.o start.o
- $(LD) $(LDFLAGS) start.o Help.o -o Help.coff
- ../bin/coff2noff Help.coff Help
- cmain.o: cmain.c
- $(CC) $(CFLAGS) -c cmain.c
- cmain: cmain.o start.o
- $(LD) $(LDFLAGS) start.o cmain.o -o cmain.coff
- ../bin/coff2noff cmain.coff cmain
- cat.o: cat.c
- $(CC) $(CFLAGS) -c cat.c
- cat: cat.o start.o
- $(LD) $(LDFLAGS) start.o cat.o -o cat.coff
- ../bin/coff2noff cat.coff cat
- echo.o: echo.c
- $(CC) $(CFLAGS) -c echo.c
- echo: echo.o start.o
- $(LD) $(LDFLAGS) start.o echo.o -o echo.coff
- ../bin/coff2noff echo.coff echo
- Create.o: Create.c
- $(CC) $(CFLAGS) -c Create.c
- Create: Create.o start.o
- $(LD) $(LDFLAGS) start.o Create.o -o Create.coff
- ../bin/coff2noff Create.coff Create
- reverse.o: reverse.c
- $(CC) $(CFLAGS) -c reverse.c
- reverse: reverse.o start.o
- $(LD) $(LDFLAGS) start.o reverse.o -o reverse.coff
- ../bin/coff2noff reverse.coff reverse
- copy.o: copy.c
- $(CC) $(CFLAGS) -c copy.c
- copy: copy.o start.o
- $(LD) $(LDFLAGS) start.o copy.o -o copy.coff
- ../bin/coff2noff copy.coff copy
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement