summaryrefslogtreecommitdiff
path: root/hw/bsp/cxd56/family.mk
blob: 627dc6ec244a1cc8147cb4c744da62c2e7fd6005 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
include $(TOP)/$(BOARD_PATH)/board.mk

# Platforms are: Linux, Darwin, MSYS, CYGWIN
PLATFORM := $(firstword $(subst _, ,$(shell uname -s 2>/dev/null)))

ifeq ($(PLATFORM),Darwin)
  # macOS
  MKSPK = $(TOP)/hw/mcu/sony/cxd56/mkspk/mkspk
else ifeq ($(PLATFORM),Linux)
  # Linux
  MKSPK = $(TOP)/hw/mcu/sony/cxd56/mkspk/mkspk
else
  # Cygwin/MSYS2
  MKSPK = $(TOP)/hw/mcu/sony/cxd56/mkspk/mkspk.exe
endif

CFLAGS += \
	-DCONFIG_HAVE_DOUBLE \
	-Dmain=spresense_main \
	-pipe \
	-std=gnu11 \
	-fno-strength-reduce \
	-fomit-frame-pointer \
	-Wno-error=undef \
	-Wno-error=cast-align \
	-Wno-error=unused-parameter \
	-DCFG_TUSB_MCU=OPT_MCU_CXD56 \

CPU_CORE ?= cortex-m4

# suppress following warnings from mcu driver
# lwip/src/core/raw.c:334:43: error: declaration of 'recv' shadows a global declaration
CFLAGS += -Wno-error=shadow  -Wno-error=redundant-decls

LDFLAGS += -specs=nosys.specs -specs=nano.specs

SPRESENSE_SDK = $(TOP)/hw/mcu/sony/cxd56/spresense-exported-sdk

SRC_C += src/portable/sony/cxd56/dcd_cxd56.c

INC += \
	$(SPRESENSE_SDK)/nuttx/include \
	$(SPRESENSE_SDK)/nuttx/arch \
	$(SPRESENSE_SDK)/nuttx/arch/chip \
	$(SPRESENSE_SDK)/nuttx/arch/os \
	$(SPRESENSE_SDK)/sdk/include \
	$(TOP)/$(BOARD_PATH)

LIBS += \
	$(SPRESENSE_SDK)/nuttx/libs/libapps.a \
	$(SPRESENSE_SDK)/nuttx/libs/libnuttx.a \

LD_FILE = hw/mcu/sony/cxd56/spresense-exported-sdk/nuttx/scripts/ramconfig.ld

LDFLAGS += \
	-Xlinker --entry=__start \
	-nostartfiles \
	-nodefaultlibs \
	-Wl,--gc-sections \
	-u spresense_main

$(MKSPK): $(BUILD)/$(PROJECT).elf
	$(MAKE) -C $(TOP)/hw/mcu/sony/cxd56/mkspk

$(BUILD)/$(PROJECT).spk: $(MKSPK)
	@echo CREATE $@
	@$(MKSPK) -c 2 $(BUILD)/$(PROJECT).elf nuttx $@

# For freeRTOS port source
FREERTOS_PORTABLE_SRC = $(FREERTOS_PORTABLE_PATH)/ARM_CM4F