2016-10-29 22:56:07 +02:00
|
|
|
############################################################################
|
2020-12-04 18:35:12 +01:00
|
|
|
# boards/xtensa/esp32/esp32-devkitc/scripts/Make.defs
|
2016-10-29 22:56:07 +02:00
|
|
|
#
|
2021-03-05 10:18:57 +01:00
|
|
|
# Licensed to the Apache Software Foundation (ASF) under one or more
|
|
|
|
# contributor license agreements. See the NOTICE file distributed with
|
|
|
|
# this work for additional information regarding copyright ownership. The
|
|
|
|
# ASF licenses this file to you under the Apache License, Version 2.0 (the
|
|
|
|
# "License"); you may not use this file except in compliance with the
|
|
|
|
# License. You may obtain a copy of the License at
|
2016-10-29 22:56:07 +02:00
|
|
|
#
|
2021-03-05 10:18:57 +01:00
|
|
|
# http://www.apache.org/licenses/LICENSE-2.0
|
2016-10-29 22:56:07 +02:00
|
|
|
#
|
2021-03-05 10:18:57 +01:00
|
|
|
# Unless required by applicable law or agreed to in writing, software
|
|
|
|
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
|
|
|
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
|
|
|
# License for the specific language governing permissions and limitations
|
|
|
|
# under the License.
|
2016-10-29 22:56:07 +02:00
|
|
|
#
|
|
|
|
############################################################################
|
|
|
|
|
2020-05-19 16:25:18 +02:00
|
|
|
include $(TOPDIR)/.config
|
|
|
|
include $(TOPDIR)/tools/Config.mk
|
2021-02-03 15:55:59 +01:00
|
|
|
include $(TOPDIR)/tools/esp32/Config.mk
|
2020-05-19 16:25:18 +02:00
|
|
|
include $(TOPDIR)/arch/xtensa/src/lx6/Toolchain.defs
|
2016-10-29 22:56:07 +02:00
|
|
|
|
2020-05-20 21:41:57 +02:00
|
|
|
LDSCRIPT1 = $(BOARD_DIR)$(DELIM)scripts$(DELIM)esp32_out.ld
|
|
|
|
LDSCRIPT3 = $(BOARD_DIR)$(DELIM)scripts$(DELIM)esp32_rom.ld
|
|
|
|
LDSCRIPT4 = $(BOARD_DIR)$(DELIM)scripts$(DELIM)esp32_peripherals.ld
|
2016-10-29 22:56:07 +02:00
|
|
|
|
2020-12-04 18:35:12 +01:00
|
|
|
ifeq ($(CONFIG_ESP32_DEVKITC_RUN_IRAM),y)
|
2020-05-20 21:41:57 +02:00
|
|
|
LDSCRIPT2 = $(BOARD_DIR)$(DELIM)scripts$(DELIM)esp32_iram.ld
|
2016-11-15 00:51:50 +01:00
|
|
|
else
|
2020-05-20 21:41:57 +02:00
|
|
|
LDSCRIPT2 = $(BOARD_DIR)$(DELIM)scripts$(DELIM)esp32_flash.ld
|
2016-11-15 00:51:50 +01:00
|
|
|
endif
|
|
|
|
|
2020-05-18 16:18:15 +02:00
|
|
|
ifeq ($(CONFIG_CYGWIN_WINTOOL),y)
|
2016-10-29 22:56:07 +02:00
|
|
|
ARCHSCRIPT = -T "${shell cygpath -w $(LDSCRIPT1)}"
|
|
|
|
ARCHSCRIPT += -T "${shell cygpath -w $(LDSCRIPT2)}"
|
|
|
|
ARCHSCRIPT += -T "${shell cygpath -w $(LDSCRIPT3)}"
|
|
|
|
ARCHSCRIPT += -T "${shell cygpath -w $(LDSCRIPT4)}"
|
|
|
|
else
|
|
|
|
ARCHSCRIPT = -T$(LDSCRIPT1) -T$(LDSCRIPT2) -T$(LDSCRIPT3) -T$(LDSCRIPT4)
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifeq ($(CONFIG_DEBUG_SYMBOLS),y)
|
|
|
|
ARCHOPTIMIZATION = -g
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifneq ($(CONFIG_DEBUG_NOOPT),y)
|
|
|
|
ARCHOPTIMIZATION += $(MAXOPTIMIZATION) -fno-strict-aliasing -fno-strength-reduce -fomit-frame-pointer
|
|
|
|
endif
|
|
|
|
|
2020-04-28 19:01:30 +02:00
|
|
|
ARCHCFLAGS = -fno-builtin -ffunction-sections -fdata-sections -fstrict-volatile-bitfields -mlongcalls
|
2016-10-29 22:56:07 +02:00
|
|
|
ARCHCXXFLAGS = $(ARCHCFLAGS) -fno-exceptions -fcheck-new -fno-rtti
|
|
|
|
ARCHWARNINGS = -Wall -Wstrict-prototypes -Wshadow -Wundef
|
|
|
|
ARCHWARNINGSXX = -Wall -Wshadow -Wundef
|
|
|
|
ARCHPICFLAGS = -fpic
|
|
|
|
|
2020-11-06 21:49:48 +01:00
|
|
|
# if SPIRAM/PSRAM is used then we need to include a workaround
|
|
|
|
|
|
|
|
ifeq ($(CONFIG_ESP32_SPIRAM),y)
|
|
|
|
ARCHCFLAGS += -mfix-esp32-psram-cache-issue
|
|
|
|
endif
|
|
|
|
|
2020-09-24 12:46:51 +02:00
|
|
|
CFLAGS := $(ARCHCFLAGS) $(ARCHWARNINGS) $(ARCHOPTIMIZATION) $(ARCHCPUFLAGS) $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRAFLAGS) -pipe
|
2016-10-29 22:56:07 +02:00
|
|
|
CPICFLAGS = $(ARCHPICFLAGS) $(CFLAGS)
|
2020-09-24 12:46:51 +02:00
|
|
|
CXXFLAGS := $(ARCHCXXFLAGS) $(ARCHWARNINGSXX) $(ARCHOPTIMIZATION) $(ARCHCPUFLAGS) $(ARCHXXINCLUDES) $(ARCHDEFINES) $(EXTRAFLAGS) -pipe
|
2016-10-29 22:56:07 +02:00
|
|
|
CXXPICFLAGS = $(ARCHPICFLAGS) $(CXXFLAGS)
|
2020-09-24 12:46:51 +02:00
|
|
|
CPPFLAGS := $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRAFLAGS)
|
|
|
|
AFLAGS := $(CFLAGS) -D__ASSEMBLY__
|
2016-10-29 22:56:07 +02:00
|
|
|
|
|
|
|
NXFLATLDFLAGS1 = -r -d -warn-common
|
|
|
|
NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat-pcrel.ld -no-check-sections
|
|
|
|
LDNXFLATFLAGS = -e main -s 2048
|
|
|
|
|
2020-03-05 02:07:57 +01:00
|
|
|
# Loadable module definitions
|
|
|
|
|
2020-03-05 11:14:54 +01:00
|
|
|
CMODULEFLAGS = $(CFLAGS) -mtext-section-literals
|
2020-03-05 02:07:57 +01:00
|
|
|
|
|
|
|
LDMODULEFLAGS = -r -e module_initialize
|
2020-05-18 16:18:15 +02:00
|
|
|
ifeq ($(CONFIG_CYGWIN_WINTOOL),y)
|
2020-03-05 02:07:57 +01:00
|
|
|
LDMODULEFLAGS += -T "${shell cygpath -w $(TOPDIR)/libs/libc/modlib/gnu-elf.ld}"
|
|
|
|
else
|
|
|
|
LDMODULEFLAGS += -T $(TOPDIR)/libs/libc/modlib/gnu-elf.ld
|
|
|
|
endif
|
|
|
|
|
|
|
|
# ELF module definitions
|
|
|
|
|
2020-03-05 11:14:54 +01:00
|
|
|
CELFFLAGS = $(CFLAGS) -mtext-section-literals
|
|
|
|
CXXELFFLAGS = $(CXXFLAGS) -mtext-section-literals
|
2020-03-05 02:07:57 +01:00
|
|
|
|
|
|
|
LDELFFLAGS = -r -e main
|
2020-05-18 16:18:15 +02:00
|
|
|
ifeq ($(CONFIG_CYGWIN_WINTOOL),y)
|
2020-05-20 21:41:57 +02:00
|
|
|
LDELFFLAGS += -T "${shell cygpath -w $(BOARD_DIR)$(DELIM)scripts$(DELIM)gnu-elf.ld}"
|
2020-03-05 02:07:57 +01:00
|
|
|
else
|
2020-05-20 21:41:57 +02:00
|
|
|
LDELFFLAGS += -T $(BOARD_DIR)$(DELIM)scripts$(DELIM)gnu-elf.ld
|
2020-03-05 02:07:57 +01:00
|
|
|
endif
|
|
|
|
|
2016-10-29 22:56:07 +02:00
|
|
|
LDFLAGS += -nostartfiles -nodefaultlibs
|
2020-09-12 17:18:36 +02:00
|
|
|
|
|
|
|
ifeq ($(CONFIG_CYGWIN_WINTOOL),y)
|
|
|
|
LDFLAGS += -Map="${shell cygpath -w $(TOPDIR)/nuttx.map}" --cref
|
|
|
|
else
|
|
|
|
LDFLAGS += -Map=$(TOPDIR)/nuttx.map --cref
|
|
|
|
endif
|
|
|
|
|
2016-10-29 22:56:07 +02:00
|
|
|
ifeq ($(CONFIG_DEBUG_SYMBOLS),y)
|
|
|
|
LDFLAGS += -g
|
|
|
|
endif
|