Skip to content

Commit a13e366

Browse files
author
Neil Jones
committed
cpu/mips_pic32mx: Refactor Makefile.
use common mips makefile.
1 parent 166986f commit a13e366

1 file changed

Lines changed: 4 additions & 36 deletions

File tree

cpu/mips_pic32mx/Makefile.include

Lines changed: 4 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,49 +1,17 @@
1-
ifndef MIPS_ELF_ROOT
2-
$(error "Please set $$(MIPS_ELF_ROOT) and ensure $$(MIPS_ELF_ROOT)/bin is on your PATH")
3-
endif
4-
5-
# Target triple for the build.
6-
export TARGET_ARCH ?= mips-mti-elf
7-
8-
export ABI=32
91
export MEMORY_BASE=0x80000000
102
export MEMORY_SIZE=128K
113
export APP_START=0x80000000
124
export ROMABLE = 1
135

14-
include $(MIPS_ELF_ROOT)/share/mips/rules/mipshal.mk
6+
include $(RIOTCPU)/Makefile.include.mips_common
157

168
# define build specific options
17-
export CFLAGS_CPU = -EL -march=m4k
18-
export CFLAGS_LINK = -ffunction-sections -fno-builtin -fshort-enums
19-
export CFLAGS_DBG = -O0 -g2
20-
export CFLAGS_OPT = -Os -g2
21-
22-
export CFLAGS += $(CFLAGS_CPU) $(CFLAGS_LINK) $(CFLAGS_OPT) -DSKIP_COPY_TO_RAM
23-
#$(CFLAGS_DBG)
24-
25-
ifeq ($(USE_HARD_FLOAT),1)
26-
export CFLAGS += -mhard-float
27-
else
28-
export CFLAGS += -msoft-float #hard-float is the default so we must set soft-float
29-
export LINKFLAGS += -msoft-float
30-
endif
31-
32-
ifeq ($(USE_DSP),1)
33-
export CFLAGS += -mdsp
34-
endif
9+
export CFLAGS += -march=m4k -DSKIP_COPY_TO_RAM
3510

36-
export ASFLAGS += $(CFLAGS_CPU) $(CFLAGS_OPT) #$(CFLAGS_DBG)
11+
export USEMODULE += periph
3712

38-
export LINKFLAGS += $(MIPS_HAL_LDFLAGS) -mabi=$(ABI) -Wl,--defsym,__use_excpt_boot=0
13+
export LINKFLAGS += -Wl,--defsym,__use_excpt_boot=0 $(CFLAGS)
3914
export LINKFLAGS += -T$(RIOTCPU)/$(CPU)/ldscripts/pic32mx512_12_128_uhi.ld
40-
export LINKFLAGS += $(CFLAGS_CPU) $(CFLAGS_DBG) #$(CFLAGS_OPT)
41-
export LINKFLAGS += -Wl,--gc-sections
42-
43-
# This CPU implementation is using the new core/CPU interface:
44-
export CFLAGS += -DCOREIF_NG=1
45-
46-
export USEMODULE += periph
4715

4816
# the pickit programmer (MPLAB-IPE) wants physical addresses in the hex file!!
4917
export OBJCOPY = objcopy #use system objcopy as toolchain one is broken.

0 commit comments

Comments
 (0)