summaryrefslogtreecommitdiff
path: root/contrib/Makefile
blob: 79f730a63f7c790226409a0faa94b0d58df16262 (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
##
##  spreadspace stm8 utils
##
##
##  Copyright (C) 2017 Christian Pointner <equinox@spreadspace.org>
##
##  This file is part of spreadspace stm8 utils.
##
##  spreadspace stm8 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 stm8 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 stm8 utils. If not, see <http://www.gnu.org/licenses/>.
##

all: download-spl update-stm8flash update-stm8gal
doxygen := $(shell which doxygen)

clean: clean-spl clean-stm8flash clean-stm8gal

download-spl: stsw-stm8069.zip

stsw-stm8069.zip:
	wget "http://www.st.com/st-web-ui/static/active/en/st_prod_software_internet/resource/technical/software/firmware/stsw-stm8069.zip" -O "$@"
	unzip $@
	cd STM8S_StdPeriph_Lib; patch -p1 < ../STM8_SPL_v2.2.0_SDCC.patch; $(doxygen)

clean-spl:
	rm -rf STM8S_StdPeriph_Lib
	rm -f stsw-stm8069.zip


.stm8flash.prepared:
	git clone https://github.com/vdudouyt/stm8flash.git
	touch $@

update-stm8flash: .stm8flash.prepared
	cd stm8flash; git pull; make

clean-stm8flash:
	rm -rf stm8flash
	rm -f .stm8flash.prepared


.stm8gal.prepared:
	git clone https://github.com/gicking/STM8gal.git
	touch $@

update-stm8gal: .stm8gal.prepared
	cd STM8gal; git pull; make

clean-stm8gal:
	rm -rf STM8gal
	rm -f .stm8gal.prepared