-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathMakefile.AVR64DU32_CNANO
More file actions
67 lines (49 loc) · 2.2 KB
/
Copy pathMakefile.AVR64DU32_CNANO
File metadata and controls
67 lines (49 loc) · 2.2 KB
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
###
### make -f Makefile.AVR64DU32_CNANO all
###
SOURCE = UPDI4AVR-USB
TARGET = AVR64DU32
TARGET1 = AVR64DU32_CNANO
TARGET2 = AVR64DU32_CNANO_DEBUG1
MF := $(MAKEFILE_LIST)
# Additional environment variables can be specified here.
BUILD_OPT1 = --build-property "build.buildopt=-DNDEBUG=1 -DHAL_PROFILE=\"HAL/AVRDU_CNANO.h\""
BUILD_OPT2 = --build-property "build.buildopt=-DDEBUG=1 -DHAL_PROFILE=\"HAL/AVRDU_CNANO.h\""
### arduino-cli @1.0.x is required. ###
ACLIPATH =
SDKURL = --additional-urls https://askn37.github.io/package_multix_zinnia_index.json
# FQBN : You only need to specify the menu items that differ from the defaults.
FQBN = --fqbn "MultiX-Zinnia:modernAVR:AVRDU_noloader:\
01_variant=22_AVR64DU32,\
02_clock=11_20MHz,\
21_resetpin=02_gpio,\
27_fusefile=03_upload,\
54_console_select=21_UART1_D6_LF2_SF6_Curiosity,\
90_console_baud=14_500000bps"
# If you have MPLAB installed, the executable path will already be there.
# If not, you should specify the path to the Arduino tools.
AVRROOT =
OBJCOPY = $(AVRROOT)avr-objcopy
OBJDUMP = $(AVRROOT)avr-objdump
LISTING = $(OBJDUMP) --disassemble --source --line-numbers --demangle --section=.text --section=.data --section=.eeprom --section=.nvmem --section=.fuse --section=.user_signatures --section=.boot_signatures
JOINING = -j .text -j .data -j --set-section-flags
### Make rule ###
hex/updi4avr-usb/$(TARGET)%.hex: build/$(TARGET)%.ino.elf
@$(OBJCOPY) $(JOINING) -O ihex $< $@
@$(LISTING) $< > hex/updi4avr-usb/$(TARGET)$*.lst
@cp -f build/$(SOURCE).ino.fuse hex/updi4avr-usb/$(TARGET)$*.fuse
ls -la hex/updi4avr-usb/$(TARGET)$*.*
build/$(TARGET1).ino.elf: src/$(SRCS:.cpp=.o) src/$(SRCS:.c=.o)
$(ACLIPATH)arduino-cli compile $(FQBN) $(BUILD_OPT1) $(SDKURL) --build-path build --no-color
@mv -f build/$(SOURCE).ino.elf build/$(TARGET1).ino.elf
build/$(TARGET2).ino.elf: src/$(SRCS:.cpp=.o) src/$(SRCS:.c=.o)
$(ACLIPATH)arduino-cli compile $(FQBN) $(BUILD_OPT2) $(SDKURL) --build-path build --no-color
@mv -f build/$(SOURCE).ino.elf build/$(TARGET2).ino.elf
all:
$(MAKE) -f $(MF) hex/updi4avr-usb/$(TARGET1).hex
$(MAKE) -f $(MF) hex/updi4avr-usb/$(TARGET2).hex
$(MAKE) -f $(MF) clean
clean:
@touch ./build/__temp
rm -rf ./build/*
# end of script