📄 makefile
字号:
OBJS = \ console.o\ file.o\ ide.o\ kalloc.o\ lapic.o\ ioapic.o\ main.o\ mp.o\ picirq.o\ pipe.o\ proc.o\ setjmp.o\ spinlock.o\ string.o\ syscall.o\ sysfile.o\ sysproc.o\ trapasm.o\ trap.o\ vectors.o\ bio.o\ fs.o\ 8253pit.o\# Cross-compiling (e.g., on Mac OS X)#TOOLPREFIX = i386-jos-elf-# Using native tools (e.g., on X86 Linux)TOOLPREFIX = CC = $(TOOLPREFIX)gccLD = $(TOOLPREFIX)ldOBJCOPY = $(TOOLPREFIX)objcopyOBJDUMP = $(TOOLPREFIX)objdumpCFLAGS = -fno-builtin -O2 -Wall -MDAS = $(TOOLPREFIX)gasxv6.img : bootblock kernel fs.img 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=notruncbootblock : 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 bootblockkernel : $(OBJS) bootother.S _init $(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 $(LD) -Ttext 0x100000 -e main0 -o kernel $(OBJS) -b binary bootother _init $(OBJDUMP) -S kernel > kernel.asmtags: $(OBJS) bootother.S _init etags *.S *.cvectors.S : vectors.pl perl vectors.pl > vectors.SULIB = ulib.o usys.o printf.o umalloc.ousertests : usertests.o $(ULIB) $(LD) -N -e main -Ttext 0 -o usertests usertests.o $(ULIB) $(OBJDUMP) -S usertests > usertests.asm_echo : echo.o $(ULIB) $(LD) -N -e main -Ttext 0 -o _echo echo.o $(ULIB) $(OBJDUMP) -S _echo > echo.asm_cat : cat.o $(ULIB) $(LD) -N -e main -Ttext 0 -o _cat cat.o $(ULIB) $(OBJDUMP) -S _cat > cat.asm_init : init.o $(ULIB) $(LD) -N -e main -Ttext 0 -o _init init.o $(ULIB) $(OBJDUMP) -S _init > init.asm_sh : sh.o $(ULIB) $(LD) -N -e main -Ttext 0 -o _sh sh.o $(ULIB) $(OBJDUMP) -S _sh > sh.asm_ls : ls.o $(ULIB) $(LD) -N -e main -Ttext 0 -o _ls ls.o $(ULIB) $(OBJDUMP) -S _ls > ls.asm_mkdir : mkdir.o $(ULIB) $(LD) -N -e main -Ttext 0 -o _mkdir mkdir.o $(ULIB) $(OBJDUMP) -S _mkdir > mkdir.asm_rm : rm.o $(ULIB) $(LD) -N -e main -Ttext 0 -o _rm rm.o $(ULIB) $(OBJDUMP) -S _rm > rm.asmmkfs : mkfs.c fs.h cc -o mkfs mkfs.cfs.img : mkfs usertests _echo _cat README _init _sh _ls _mkdir _rm ./mkfs fs.img usertests _echo _cat README _init _sh _ls _mkdir _rm-include *.dclean : rm -f *.ps *.tex *.dvi *.idx *.aux *.log *.ind *.ilg \ *.o *.d *.asm vectors.S parport.out \ bootblock kernel xv6.img usertests \ fs.img _cat _echo _init _sh _ls _rm _mkdir mkfs# make a printoutPRINT = \ runoff.list \ README\ types.h param.h defs.h x86.h asm.h elf.h mmu.h spinlock.h\ bootasm.S bootother.S main.c init.c spinlock.c\ proc.h proc.c setjmp.S kalloc.c\ syscall.h trapasm.S traps.h trap.c vectors.pl syscall.c sysproc.c\ buf.h dev.h fcntl.h stat.h file.h fs.h fsvar.h file.c fs.c bio.c ide.c sysfile.c\ pipe.c\ mp.h ioapic.h mp.c lapic.c ioapic.c picirq.c\ console.c\ string.c\xv6.pdf : $(PRINT) ./runoffprint : xv6.pdf# run in emulatorsbochs : fs.img xv6.img if [ ! -e .bochsrc ]; then ln -s dot-bochsrc .bochsrc; fi bochs -qqemu : fs.img xv6.img qemu -parallel stdio -hdb fs.img xv6.img
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -