📄 makefile
字号:
# **********************************************# Programs to build# **********************************************# PROGS = testgcdocp testadd testfib testfunc testmisc testovf testocp encoderPROGS = encoder# **********************************************# Endianness EB | EL# **********************************************#ENDIAN = EBENDIAN = EL# **********************************************# Bootstrap object file# **********************************************BOOTSTRAP = crt0.o# **********************************************# Compiler toolchain# **********************************************ifeq ($(ENDIAN),EL)CC = mipsel-linux-gccLD = mipsel-linux-ldOBJCOPY = mipsel-linux-objcopyOBJDUMP = mipsel-linux-objdumpendififeq ($(ENDIAN),EB)CC = mips-linux-gccLD = mips-linux-ldOBJCOPY = mips-linux-objcopyOBJDUMP = mips-linux-objdumpendif# **********************************************# Compiler and linker options# **********************************************W_OPTS = -Wimplicit -Wformat -Wall -Wstrict-prototypesW_OPTS_A = -Wformat -Wall -Wstrict-prototypesCC_OPTS = -Wa,-32 -mabi=32 -march=r2000 -mtune=r2000 -mno-abicalls -fno-pic -G 0 -pipe \ -D$(ENDIAN) -fno-strict-aliasing -c -nostdincCC_OPTS_A = -Wa,-32 -mabi=32 -march=r2000 -mtune=r2000 -mno-abicalls -fno-pic -G 0 -pipe \ -D$(ENDIAN) -fno-strict-aliasing -c -nostdincLD_SCRIPT = link.xnLD_OPTS = -G 0 -static -T $(LD_SCRIPT)ifeq ($(ENDIAN),EB)LD_FORMAT = elf32-tradbigmipsendififeq ($(ENDIAN),EL)LD_FORMAT = elf32-tradlittlemipsendif# **********************************************# Rules# **********************************************%.o : %.c $(CC) $(W_OPTS) $(CC_OPTS) -o $@ $<%.o : %.S $(CC) $(W_OPTS_A) $(CC_OPTS_A) -o $@ $<%.o : %.s $(CC) $(W_OPTS_A) $(CC_OPTS_A) -o $@ $<all: $(PROGS)testgcdocp : $(BOOTSTRAP) testgcdocp.o $(LD) $(LD_OPTS) -o $@ $? $(OBJCOPY) -O binary $@ $@.bintestadd : $(BOOTSTRAP) testadd.o $(LD) $(LD_OPTS) -o $@ $? $(OBJCOPY) -O binary $@ $@.bintestfib : $(BOOTSTRAP) testfib.o $(LD) $(LD_OPTS) -o $@ $? $(OBJCOPY) -O binary $@ $@.bintestfunc : $(BOOTSTRAP) testfunc.o $(LD) $(LD_OPTS) -o $@ $? $(OBJCOPY) -O binary $@ $@.binencoder : $(BOOTSTRAP) encoder.o io.o $(LD) $(LD_OPTS) -o $@ $? $(OBJCOPY) -O binary $@ $@.bintestovf : $(BOOTSTRAP) testovf.o $(LD) $(LD_OPTS) -o $@ $? $(OBJCOPY) -O binary $@ $@.bintestocp : $(BOOTSTRAP) testocp.o $(LD) $(LD_OPTS) -o $@ $? $(OBJCOPY) -O binary $@ $@.binclean : rm -f $(PROGS) *.bin *.o rm -f *~
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -