This commit is contained in:
rsc 2006-07-16 15:35:18 +00:00
parent 72fef4f855
commit b903b693ec

View file

@ -1,5 +1,21 @@
OBJS = main.o console.o string.o kalloc.o proc.o trapasm.o trap.o vectors.o \ OBJS = \
syscall.o ide.o picirq.o mp.o lapic.o spinlock.o fd.o pipe.o swtch.o console.o\
fd.o\
ide.o\
kalloc.o\
lapic.o\
main.o\
mp.o\
picirq.o\
pipe.o\
proc.o\
setjmp.o\
spinlock.o\
string.o\
syscall.o\
trapasm.o\
trap.o\
vectors.o\
# Cross-compiling (e.g., on Mac OS X) # Cross-compiling (e.g., on Mac OS X)
TOOLPREFIX = i386-jos-elf- TOOLPREFIX = i386-jos-elf-
@ -11,7 +27,7 @@ CC = $(TOOLPREFIX)gcc
LD = $(TOOLPREFIX)ld LD = $(TOOLPREFIX)ld
OBJCOPY = $(TOOLPREFIX)objcopy OBJCOPY = $(TOOLPREFIX)objcopy
OBJDUMP = $(TOOLPREFIX)objdump OBJDUMP = $(TOOLPREFIX)objdump
CFLAGS = -nostdinc -I. -O2 -Wall -MD CFLAGS = -nostdinc -fno-builtin -I. -O2 -Wall -MD
AS = $(TOOLPREFIX)gas AS = $(TOOLPREFIX)gas
xv6.img : bootblock kernel xv6.img : bootblock kernel
@ -40,25 +56,20 @@ vectors.S : vectors.pl
ULIB = ulib.o usys.o ULIB = ulib.o usys.o
user1 : user1.c $(ULIB) user1 : user1.o $(ULIB)
$(CC) -nostdinc -I. -c user1.c
$(LD) -N -e main -Ttext 0 -o user1 user1.o $(ULIB) $(LD) -N -e main -Ttext 0 -o user1 user1.o $(ULIB)
$(OBJDUMP) -S user1 > user1.asm $(OBJDUMP) -S user1 > user1.asm
usertests : usertests.c $(ULIB) usertests : usertests.o $(ULIB)
$(CC) -nostdinc -I. -c usertests.c
$(LD) -N -e main -Ttext 0 -o usertests usertests.o $(ULIB) $(LD) -N -e main -Ttext 0 -o usertests usertests.o $(ULIB)
$(OBJDUMP) -S usertests > usertests.asm $(OBJDUMP) -S usertests > usertests.asm
userfs : userfs.c $(ULIB) userfs : userfs.o $(ULIB)
$(CC) -nostdinc -I. -c userfs.c
$(LD) -N -e main -Ttext 0 -o userfs userfs.o $(ULIB) $(LD) -N -e main -Ttext 0 -o userfs userfs.o $(ULIB)
$(OBJDUMP) -S userfs > userfs.asm $(OBJDUMP) -S userfs > userfs.asm
ulib.o : ulib.c
$(CC) -nostdinc -I. -c ulib.c
-include *.d -include *.d
clean : clean :
rm -f *.o bootblock kernel kernel.asm xv6.img *.d user1 rm -f *.o bootblock kernel kernel.asm xv6.img *.d user1 userfs usertests