summaryrefslogtreecommitdiff
path: root/contrib/Makefile
blob: 7250d5a1263b733c3244a1ea34ee74c54e6d3e30 (plain) (blame)
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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
##
##  spreadspace rppico utils
##
##
##  Copyright (C) 2022 Christian Pointner <equinox@spreadspace.org>
##
##  This file is part of spreadspace rppico utils.
##
##  spreadspace rppico utils is free software: you can redistribute it and/or modify
##  it under the terms of the GNU General Public License as published by
##  the Free Software Foundation, either version 3 of the License, or
##  any later version.
##
##  spreadspace rppico utils is distributed in the hope that it will be useful,
##  but WITHOUT ANY WARRANTY; without even the implied warranty of
##  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
##  GNU General Public License for more details.
##
##  You should have received a copy of the GNU General Public License
##  along with spreadspace rppico utils. If not, see <http://www.gnu.org/licenses/>.
##

CHIBIOS_VERSION := 21.11.2
CHIBIOS_SHA256SUM := ba74eec6230b66d79c0f0a26e9af00ca46756cb47f7b4a229eb228cbff3a8b48
FMPP_VERSION := 0.9.16
FMPP_SHA256SUM := 86561e3f3a2ccb436f5f3df88d79a7dad72549a33191901f49d12a38b53759cd
GCC_VERSION := 10.3-2021.10
GCC_HOST := $(shell uname -m)-$(shell uname | tr '[:upper:]' '[:lower:]')
GCC_SHA256SUM := 97dbb4f019ad1650b732faffcc881689cedc14e2b7ee863d390e0a41ef16c9a3


all: download-picoprobe download-flash_nuke clone-openocd download-chibios download-gcc
clean: clean-picoprobe clean-flash_nuke clean-openocd clean-chibios clean-gcc


download-picoprobe: picoprobe.u2f

picoprobe.u2f:
	wget "https://datasheets.raspberrypi.com/soft/picoprobe.uf2" -O "$@"

clean-picoprobe:
	rm -f picoprobe.u2f


download-flash_nuke: flash_nuke.u2f

flash_nuke.u2f:
	wget "https://datasheets.raspberrypi.com/soft/flash_nuke.uf2" -O "$@"

clean-flash_nuke:
	rm -f flash_nuke.u2f


openocd/src/openocd:
	git clone https://github.com/raspberrypi/openocd.git --branch rp2040 --depth=1 --no-single-branch
	cd openocd; ./bootstrap; ./configure --enable-picoprobe; make -j 4

clone-openocd: openocd/src/openocd

clean-openocd:
	rm -rf openocd


download-chibios: ChibiOS_${CHIBIOS_VERSION}.7z

ChibiOS_${CHIBIOS_VERSION}.7z:
	wget "https://osdn.net/dl/chibios/$@" -O "$@"
	echo "${CHIBIOS_SHA256SUM} $@" | sha256sum -c
	7z x $@
	7z "-oChibiOS_${CHIBIOS_VERSION}/ext/" x "ChibiOS_${CHIBIOS_VERSION}/ext/pico-sdk *.7z"

clean-chibios:
	rm -f ChibiOS_${CHIBIOS_VERSION}.7z
	rm -rf ChibiOS_${CHIBIOS_VERSION}


download-gcc: gcc-arm-none-eabi-${GCC_VERSION}-${GCC_HOST}.tar.bz2

gcc-arm-none-eabi-${GCC_VERSION}-${GCC_HOST}.tar.bz2:
	wget "https://developer.arm.com/-/media/Files/downloads/gnu-rm/${GCC_VERSION}/$@" -O "$@"
	echo "${GCC_SHA256SUM} $@" | sha256sum -c
	tar -xjf $@

clean-gcc:
	rm -f gcc-arm-none-eabi-${GCC_VERSION}-${GCC_HOST}.tar.bz2
	rm -rf gcc-arm-none-eabi-${GCC_VERSION}