45 lines
1.0 KiB
Makefile
45 lines
1.0 KiB
Makefile
# environment vaiables read:
|
|
# BOARD = {ml402, denano}
|
|
# TLB = {no, yes}
|
|
# ENDIANESS = {eb, el}
|
|
# DEBUGGER = {gdb, mips, rom}
|
|
|
|
ifeq ($(TLB),yes)
|
|
SPECNAME=specs_tlb
|
|
else
|
|
SPECNAME=specs
|
|
endif
|
|
|
|
ifeq ($(ENDIANESS),eb)
|
|
ENDIAN_FLAGS=-EB
|
|
else
|
|
ENDIAN_FLAGS=-EL
|
|
endif
|
|
|
|
BUILD_DIR=build/$(BOARD)/$(ENDIANESS)
|
|
LSYS_BUILD_DIR=libsys/build/$(BOARD)/$(ENDIANESS)
|
|
|
|
CFLAGS :=$(ENDIAN_FLAGS) -ffunction-sections -fdata-sections -Wl,--gc-sections -G 0 -T $(MIPS_HOME)/link/ram.ld -g -msoft-float -O2 -march=r3000 -I. -Ilibsys -Ilibsys/boards/$(BOARD) -L$(LSYS_BUILD_DIR) -Wl,-M
|
|
ifeq ($(TLB),yes)
|
|
CFLAGS+=-DSYS_IO_BASE=0xAC000000 -DSDRAM_BASE=0x80000000 -DFLASH_BASE_IO=0xA4000000 -DFLASH_BASE_MEM=0x88000000
|
|
else
|
|
CFLAGS+=-DSYS_IO_BASE=0xA0000000 -DSDRAM_BASE=0x40000000 -DFLASH_BASE_IO=0xA4000000 -DFLASH_BASE_MEM=0x00000000
|
|
endif
|
|
|
|
ifeq ($(TLB),yes)
|
|
FLASHGEN=flashgen_tlb
|
|
else
|
|
FLASHGEN=flashgen
|
|
endif
|
|
PACKHEX=packhex
|
|
|
|
LIBS=-lm -lc -lsys -lc
|
|
|
|
AS=mips-elf-as
|
|
AR=mips-elf-ar
|
|
CC=mips-elf-gcc
|
|
LD=mips-elf-ld
|
|
OBJDUMP=mips-elf-objdump
|
|
OBJCOPY=mips-elf-objcopy
|
|
|