aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorjaseg <git@jaseg.de>2020-11-18 13:21:38 +0100
committerjaseg <git@jaseg.de>2020-11-18 13:21:38 +0100
commit0a678f936b569bbc2dc36c745bb966bc3cee061e (patch)
treee7a8ad40ac56d86082f39a130fe7b7b2a50d986c /Makefile
parent43d49d978ea441e0987eda471ba5744a74ee3c79 (diff)
downloadstm32square-0a678f936b569bbc2dc36c745bb966bc3cee061e.tar.gz
stm32square-0a678f936b569bbc2dc36c745bb966bc3cee061e.tar.bz2
stm32square-0a678f936b569bbc2dc36c745bb966bc3cee061e.zip
Add auto-release infrastructure
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile59
1 files changed, 41 insertions, 18 deletions
diff --git a/Makefile b/Makefile
index a029670..1d573db 100644
--- a/Makefile
+++ b/Makefile
@@ -4,38 +4,61 @@ BUILDDIR ?= build
WGET ?= wget
PYTHON ?= python3
-$(BUILDDIR):
- mkdir -p $(BUILDDIR)
-
.PRECIOUS: $(BUILDDIR)/%.jar
+.PRECIOUS: $(BUILDDIR)/%.jar.version
$(BUILDDIR)/%.jar:
mkdir -p $(BUILDDIR)
- $(WGET) --tries=10 -N -O $@ $$($(PYTHON) tools/get_p2_url.py $*)
+ $(WGET) --tries=10 -O $@ $$($(PYTHON) tools/get_p2_url.py --write-version $@.version $*)
touch $@
+OUTPUTS := svd mx_mcu_db prog_db chip_db
+
+all: $(OUTPUTS)
+
$(BUILDDIR)/%.dir: $(BUILDDIR)/%.jar
mkdir -p $@
rm -rf $@
- unzip -d $@ $<
+ unzip -q -d $@ $<
.PHONY: update_svd
-update_svd: $(BUILDDIR)/com.st.stm32cube.ide.mcu.productdb.debug.dir
- rm -rf svd
- mkdir -p svd
- cp $</resources/cmsis/STMicroelectronics_CMSIS_SVD/{*.svd,License.html} svd/
+svd: $(BUILDDIR)/com.st.stm32cube.ide.mcu.productdb.debug.dir
+ rm -rf $@
+ mkdir -p $@
+ cp $</resources/cmsis/STMicroelectronics_CMSIS_SVD/{*.svd,License.html} $@/
+ cp $(BUILDDIR)/com.st.stm32cube.ide.mcu.productdb.debug.jar.version $@/source_file_versions.txt
.PHONY: update_xml
-update_xml: $(BUILDDIR)/com.st.stm32cube.common.mx.dir
- rm -rf mx_mcu_db
- mkdir -p mx_mcu_db
- cp $</about.html mx_mcu_db/License.html
- cp -r $</db/mcu/* mx_mcu_db/
+mx_mcu_db: $(BUILDDIR)/com.st.stm32cube.common.mx.dir
+ rm -rf $@
+ mkdir -p $@
+ cp $</about.html $@/License.html
+ cp -r $</db/mcu/* $@/
+ cp $(BUILDDIR)/com.st.stm32cube.common.mx.jar.version $@/source_file_versions.txt
-update_prog_db: $(BUILDDIR)/com.st.stm32cube.ide.mcu.externaltools.cubeprogrammer.linux64.dir
+prog_db: $(BUILDDIR)/com.st.stm32cube.ide.mcu.externaltools.cubeprogrammer.linux64.dir
+ rm -rf $@
+ mkdir -p $@
+ cp $</about.html $@/License.html
+ cp $</tools/Data_Base/*.xml $@/
+ cp $(BUILDDIR)/com.st.stm32cube.ide.mcu.externaltools.cubeprogrammer.linux64.jar.version $@/source_file_versions.txt
+
+$(BUILDDIR)/STM32CubeMX.unpacked: build/com.st.stm32cube.common.mx.dir
+ unzip -q -d $@ $</STM32CubeMX.jar -x '/*'
+
+chip_db: $(BUILDDIR)/STM32CubeMX.unpacked
+ rm -rf $@
+ mkdir -p $@
+ cp $</LICENSE.txt $@/
+ cp $</devices/* $@/
+ cp $(BUILDDIR)/com.st.stm32cube.common.mx.jar.version $@/source_file_versions.txt
+
+.PHONY: clean
+clean:
+ rm -rf svd
+ rm -rf mx_mcu_db
rm -rf prog_db
- mkdir -p prog_db
- cp $</about.html prog_db/License.html
- cp $</tools/Data_Base/*.xml prog_db/
+ rm -rf chip_db
+ rm -rf build
# The following file contains garbage data on the µC's memories.
#stm32targets.xml: $(BUILDDIR)/com.st.stm32cube.ide.mcu.productdb.dir