You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
119 lines
2.1 KiB
Makefile
119 lines
2.1 KiB
Makefile
# ePenguin Generated Variables
|
|
PROJECT_NAME=d21test
|
|
TOOLCHAIN=${ESF_DIR}/toolchains/arm/bin/arm-none-eabi
|
|
CC=${TOOLCHAIN}-gcc
|
|
CXX=${TOOLCHAIN}-g++
|
|
OBJCOPY=${TOOLCHAIN}-objcopy
|
|
OBJDUMP=${TOOLCHAIN}-objdump
|
|
GDB=${TOOLCHAIN}-gdb
|
|
SIZE=${TOOLCHAIN}-size
|
|
AS=${TOOLCHAIN}-as
|
|
|
|
|
|
MCPU=cortex-m0plus
|
|
MCU=__SAMD21J18A__
|
|
LD_PATH=../ESF/ld
|
|
LD_SCRIPT=$(LD_PATH)/samd21j18a_flash.ld
|
|
|
|
|
|
CFLAGS= \
|
|
-D$(MCU) \
|
|
-mcpu=$(MCPU) \
|
|
-x c \
|
|
-DDEBUG \
|
|
-Os \
|
|
-g3 \
|
|
-Wall \
|
|
-c \
|
|
-std=gnu99 \
|
|
$(DIR_INCLUDES) \
|
|
-MD -MP \
|
|
-MF$(QUOTE)$(@:%.o=%.d)$(QUOTE) \
|
|
-MT$(QUOTE)$(@:%.o=%.d)$(QUOTE) \
|
|
-MT$(QUOTE)$(@:%.o=%.o)$(QUOTE)
|
|
|
|
ELF_FLAGS= \
|
|
-Wl,--start-group -l m \
|
|
-Wl,--end-group -mthumb \
|
|
-Wl,-Map=$(QUOTE)$(PROJECT_NAME).map$(QUOTE) \
|
|
--specs=nano.specs \
|
|
-Wl,--gc-sections \
|
|
-T$(QUOTE)$(LD_SCRIPT)$(QUOTE) \
|
|
-L$(QUOTE)$(LD_PATH)$(QUOTE)
|
|
|
|
HEX_FLAGS= \
|
|
-R .eeprom \
|
|
-R .fuse \
|
|
-R .lock \
|
|
-R .signature
|
|
|
|
EEP_FLAGS= \
|
|
-j .eeprom --set-section-flags=.eeprom=alloc,load \
|
|
--change-section-lma \
|
|
.eeprom=0 \
|
|
--no-change-warnings
|
|
|
|
ifdef SystemRoot
|
|
SHELL = cmd.exe
|
|
MK_DIR = mkdir
|
|
else
|
|
ifeq ($(shell uname), Linux)
|
|
MK_DIR = mkdir -p
|
|
endif
|
|
|
|
ifeq ($(shell uname | cut -d _ -f 1), CYGWIN)
|
|
MK_DIR = mkdir -p
|
|
endif
|
|
|
|
ifeq ($(shell uname | cut -d _ -f 1), MINGW32)
|
|
MK_DIR = mkdir -p
|
|
endif
|
|
|
|
ifeq ($(shell uname | cut -d _ -f 1), MINGW64)
|
|
MK_DIR = mkdir -p
|
|
endif
|
|
|
|
ifeq ($(shell uname | cut -d _ -f 1), DARWIN)
|
|
MK_DIR = mkdir -p
|
|
endif
|
|
endif
|
|
|
|
SUB_DIRS+= \
|
|
src \
|
|
ESF/mcu/src
|
|
|
|
OBJS+= \
|
|
ESF/mcu/src/startup_samd21j18a.o \
|
|
ESF/mcu/src/system_samd21j18a.o \
|
|
src/main.o
|
|
|
|
OBJS_AS_ARGS+= \
|
|
$(QUOTE)ESF/mcu/src/startup_samd21j18a.o$(QUOTE) \
|
|
$(QUOTE)ESF/mcu/src/system_samd21j18a.o$(QUOTE) \
|
|
$(QUOTE)src/main.o$(QUOTE)
|
|
|
|
DIR_INCLUDES+= \
|
|
-I$(QUOTE)../ESF/common/inc$(QUOTE) \
|
|
-I$(QUOTE)../ESF/common/inc/cmsis$(QUOTE) \
|
|
-I$(QUOTE)../ESF/mcu/inc$(QUOTE) \
|
|
-I$(QUOTE)../inc$(QUOTE)
|
|
|
|
DEPS:=$(OBJS:%.o=%.d)
|
|
|
|
DEPS_AS_ARGS:=$(OBJS:%.o=%.d)
|
|
|
|
vpath %.c ../
|
|
vpath %.s ../
|
|
vpath %.S ../
|
|
|
|
.PHONY: debug clean
|
|
|
|
all:\
|
|
$(SUB_DIRS)\
|
|
$(PROJECT_NAME).elf\
|
|
$(PROJECT_NAME).bin\
|
|
$(PROJECT_NAME).hex\
|
|
$(PROJECT_NAME).eep\
|
|
$(PROJECT_NAME).lss
|
|
\
|
|
$(QUOTE)$(SIZE)$(QUOTE) $(QUOTE)$(PROJECT_NAME).elf$(QUOTE)
|