forked from Nitrokey/nitrokey-pro-firmware
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
51 lines (43 loc) · 1.51 KB
/
Makefile
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
ROOT_DIR=$(CURDIR)
BUILD_DIR=$(ROOT_DIR)/build/gcc
SCRIPT_DIR=$(ROOT_DIR)/scripts
OPENOCD_BIN?=
DEPS=gcc-arm-none-eabi
.PHONY: firmware flash-versaloon clean release
firmware:
cd $(BUILD_DIR) && \
make && \
cd -
# mv $(BUILD_DIR)/crypto.elf .
#Reminder: export OPENOCD_BIN=$(OPENOCD_BIN)
flash-versaloon:
cd scripts && \
./flash-versaloon.sh
#flash-versaloon:
# sudo $(OPENOCD_BIN)/openocd gdb_memory_map disable \
-f interface/vsllink-swd.cfg \
-f target/stm32f1x.cfg \
-c init -c reset -c halt \
-c "stm32f1x unlock 0" \
-c shutdown \
-c exit
# sudo $(OPENOCD_BIN)/openocd gdb_memory_map disable \
-f interface/vsllink-swd.cfg \
-f target/stm32f1x.cfg \
-c init -c reset -c halt \
-c "flash write_image erase crypto.elf" \
-c "verify_image crypto.elf" \
-c "reset run" \
-c exit
#sudo $(OPENOCD_BIN)/openocd gdb_memory_map disable -f interface/vsllink-swd.cfg -f target/stm32f1x.cfg -f $(SCRIPT_DIR)/write.tcl
clean:
cd $(BUILD_DIR) && \
make clean
deps:
sudo apt-get install ${DEPS}
release: firmware
mkdir -p release && \
cd release && \
cp $(BUILD_DIR)/nitrokey-pro-firmware.elf $(BUILD_DIR)/nitrokey-pro-firmware.hex . && \
find . -name *.elf -type f -printf "%f" | xargs -0 -n1 -I{} sh -c 'sha512sum -b {} > {}.sha512; md5sum -b {} > {}.md5' && \
find . -name *.hex -type f -printf "%f" | xargs -0 -n1 -I{} sh -c 'sha512sum -b {} > {}.sha512; md5sum -b {} > {}.md5'