xv6-65oo2/Makefile

76 lines
1.8 KiB
Makefile
Raw Normal View History

2006-07-16 15:35:18 +00:00
OBJS = \
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\
2006-06-12 15:22:12 +00:00
2006-07-11 01:07:40 +00:00
# Cross-compiling (e.g., on Mac OS X)
TOOLPREFIX = i386-jos-elf-
# Using native tools (e.g., on X86 Linux)
# TOOLPREFIX =
CC = $(TOOLPREFIX)gcc
LD = $(TOOLPREFIX)ld
OBJCOPY = $(TOOLPREFIX)objcopy
OBJDUMP = $(TOOLPREFIX)objdump
2006-07-17 01:51:47 +00:00
CFLAGS = -fno-builtin -O2 -Wall -MD
2006-07-11 01:07:40 +00:00
AS = $(TOOLPREFIX)gas
2006-06-12 15:22:12 +00:00
xv6.img : bootblock kernel
dd if=/dev/zero of=xv6.img count=10000
dd if=bootblock of=xv6.img conv=notrunc
dd if=kernel of=xv6.img seek=1 conv=notrunc
bootblock : bootasm.S bootmain.c
$(CC) -O -nostdinc -I. -c bootmain.c
$(CC) -nostdinc -I. -c bootasm.S
$(LD) -N -e start -Ttext 0x7C00 -o bootblock.o bootasm.o bootmain.o
$(OBJDUMP) -S bootblock.o > bootblock.asm
$(OBJCOPY) -S -O binary bootblock.o bootblock
./sign.pl bootblock
kernel : $(OBJS) bootother.S user1 usertests userfs
$(CC) -nostdinc -I. -c bootother.S
$(LD) -N -e start -Ttext 0x7000 -o bootother.out bootother.o
$(OBJCOPY) -S -O binary bootother.out bootother
$(OBJDUMP) -S bootother.o > bootother.asm
2006-07-16 16:03:51 +00:00
$(LD) -Ttext 0x100000 -e main0 -o kernel $(OBJS) -b binary bootother user1 usertests userfs
2006-06-12 15:22:12 +00:00
$(OBJDUMP) -S kernel > kernel.asm
2006-06-13 15:50:06 +00:00
vectors.S : vectors.pl
perl vectors.pl > vectors.S
2006-07-11 01:07:40 +00:00
ULIB = ulib.o usys.o
2006-07-16 15:35:18 +00:00
user1 : user1.o $(ULIB)
2006-07-11 01:07:40 +00:00
$(LD) -N -e main -Ttext 0 -o user1 user1.o $(ULIB)
2006-06-26 15:11:19 +00:00
$(OBJDUMP) -S user1 > user1.asm
2006-06-22 20:47:23 +00:00
2006-07-16 15:35:18 +00:00
usertests : usertests.o $(ULIB)
2006-07-11 01:07:40 +00:00
$(LD) -N -e main -Ttext 0 -o usertests usertests.o $(ULIB)
2006-06-27 14:35:53 +00:00
$(OBJDUMP) -S usertests > usertests.asm
2006-07-16 15:35:18 +00:00
userfs : userfs.o $(ULIB)
2006-07-11 01:07:40 +00:00
$(LD) -N -e main -Ttext 0 -o userfs userfs.o $(ULIB)
$(OBJDUMP) -S userfs > userfs.asm
2006-06-15 19:58:01 +00:00
-include *.d
2006-06-12 15:22:12 +00:00
clean :
2006-07-17 01:51:47 +00:00
rm -f *.o *.d *.asm vectors.S parport.out \
2006-07-17 01:36:32 +00:00
bootblock kernel xv6.img user1 userfs usertests