diff options
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 59 |
1 files changed, 41 insertions, 18 deletions
@@ -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 |