# 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 # Eric: changed to use the cross compile install in UCS GCCDIR = /usr/local/gcc-2.8.1/decstation-ultrix/bin/ LDFLAGS = -T script -N ASFLAGS = CPPFLAGS = $(INCDIR) # if you aren't cross-compiling: # GCCDIR = # LDFLAGS = -N -T 0 # ASFLAGS = # CPPFLAGS = -P $(INCDIR) CC = $(GCCDIR)gcc AS = $(GCCDIR)as LD = $(GCCDIR)ld CPP = /usr/ccs/lib/cpp INCDIR =-I../userprog -I../threads -I../machine CFLAGS = -G 0 -c $(INCDIR) all: halt shell matmult sort new_shell list mkdir pwd cd cat rmdir copy start.o: start.s ../userprog/syscall.h $(CPP) $(CPPFLAGS) start.s > 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 new_shell.o: new_shell.c $(CC) $(CFLAGS) -c new_shell.c new_shell: new_shell.o new_shell.o $(LD) $(LDFLAGS) start.o new_shell.o -o new_shell.coff ../bin/coff2noff new_shell.coff new_shell 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 list.o: list.c $(CC) $(CFLAGS) -c list.c list: list.o start.o $(LD) $(LDFLAGS) start.o list.o -o list.coff ../bin/coff2noff list.coff list mkdir.o: mkdir.c $(CC) $(CFLAGS) -c mkdir.c mkdir: mkdir.o start.o $(LD) $(LDFLAGS) start.o mkdir.o -o mkdir.coff ../bin/coff2noff mkdir.coff mkdir pwd.o: pwd.c $(CC) $(CFLAGS) -c pwd.c pwd: pwd.o start.o $(LD) $(LDFLAGS) start.o pwd.o -o pwd.coff ../bin/coff2noff pwd.coff pwd cd.o: cd.c $(CC) $(CFLAGS) -c cd.c cd: cd.o start.o $(LD) $(LDFLAGS) start.o cd.o -o cd.coff ../bin/coff2noff cd.coff cd 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 rmdir.o: rmdir.c $(CC) $(CFLAGS) -c rmdir.c rmdir: rmdir.o start.o $(LD) $(LDFLAGS) start.o rmdir.o -o rmdir.coff ../bin/coff2noff rmdir.coff rmdir 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