📄 makefile
字号:
# GNU Makefile for building user programs to run on top of Nachos## Things to be aware of:## The value of the ARCHDIR environment variable must be set before using# this makefile. If you are using an instructional machine, this should# be automatic. However, if you are not using an instructional machine,# you need to point ARCHDIR at the cross-compiler directory, e.g.# setenv ARCHDIR ../mips-x86.win32-xgcc# you need to point to the right executablesGCCDIR = $(ARCHDIR)/mips-ASFLAGS = -mips1CPPFLAGS =CFLAGS = -O2 -B$(GCCDIR) -G 0 -Wa,-mips1 -nostdlib -ffreestandingLDFLAGS = -s -T script -N -warn-common -warn-constructors -warn-multiple-gpCC = $(GCCDIR)gccAS = $(GCCDIR)asLD = $(GCCDIR)ldCPP = $(GCCDIR)cppAR = $(GCCDIR)arRANLIB = $(GCCDIR)ranlibSTDLIB_H = stdio.h stdlib.h ag.hSTDLIB_C = stdio.c stdlib.cSTDLIB_O = start.o stdio.o stdlib.oLIB = assert atoi printf readline stdio strncmp strcat strcmp strcpy strlen memcpy memsetNLIB = libnachos.aTARGETS = halt sh matmult sort echo cat cp mv rm #chat chatserver.SECONDARY: $(patsubst %.c,%.o,$(wildcard *.c))all: $(patsubst %,%.coff,$(TARGETS))ag: grade-file.coff grade-exec.coff grade-mini.coff grade-dumb.coffclean: rm -f strt.s *.o *.coff $(NLIB)agclean: clean rm -f f1-* f2-*$(NLIB): $(patsubst %,$(NLIB)(%.o),$(LIB)) start.o $(RANLIB) $(NLIB)start.o: start.s syscall.h $(CPP) $(CPPFLAGS) start.s > strt.s $(AS) $(ASFLAGS) -o start.o strt.s rm strt.s%.o: %.c *.h $(CC) $(CFLAGS) -c $<%.coff: %.o $(NLIB) $(LD) $(LDFLAGS) -o $@ $< start.o -lnachos
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -