avoid unnecessary work in 'make build'

This commit is contained in:
Damien Elmes 2020-04-07 10:56:41 +10:00
parent c29184d874
commit 16ab351bf8
4 changed files with 16 additions and 7 deletions

View File

@ -145,9 +145,10 @@ clean: clean-dist
$(SUBMAKE) -C $$dir clean; \
done
# remove any files in dist/ folder without current build hash
.PHONY: clean-dist
clean-dist:
rm -rf dist
clean-dist: buildhash
find dist \! -name "*$$(cat meta/buildhash)*" -type f -delete
.PHONY: check
check: pyenv buildhash prepare
@ -181,7 +182,7 @@ add-buildhash:
fi; \
ver="$$(cat meta/version)"; \
hash="$$(cat meta/buildhash)"; \
${RENAME_BIN} "s/-$${ver}(\.|-)/-$${ver}+$${hash}\$$1/" dist/*-"$${ver}"*
${RENAME_BIN} -f "s/-$${ver}(\.|-)/-$${ver}+$${hash}\$$1/" dist/*-"$${ver}"*
.PHONY: pull-i18n

View File

@ -99,10 +99,13 @@ CHECKDEPS := $(shell ${FIND} anki tests -name '*.py' | grep -v buildinfo.py)
######################
.PHONY: build
build: $(BUILD_STEPS) $(CHECKDEPS)
build: .build/build
.build/build: $(BUILD_STEPS) $(CHECKDEPS)
rm -rf dist build
python setup.py -q bdist_wheel
rsync -a dist/*.whl ../dist/
touch $@
# prepare code for running in place
.PHONY: develop

View File

@ -127,10 +127,13 @@ CHECKDEPS := $(shell ${FIND} aqt tests -name '*.py' | grep -v buildinfo.py)
######################
.PHONY: build
build: $(BUILD_STEPS)
build: .build/build
.build/build: $(BUILD_STEPS) $(CHECKDEPS)
rm -rf dist build
python setup.py -q bdist_wheel
rsync -a dist/*.whl ../dist/
touch $@
.PHONY: develop
develop: $(BUILD_STEPS)

View File

@ -60,11 +60,13 @@ DEPS := .build/tools .build/vernum ../meta/buildhash \
CARGO_TARGET_DIR="$(RSPY_TARGET_DIR)" maturin develop $(DEVFLAGS)
touch $@
build: $(DEPS)
rm -rf "$(OUTDIR)"/ankirspy*
build: .build/build
.build/build: $(DEPS)
touch ../proto/backend.proto
FTL_TEMPLATE_DIRS="$(QT_FTL_TEMPLATES)" FTL_LOCALE_DIRS="$(QT_FTL_LOCALES)" \
maturin build -i "${PYTHON_FILE}" -o "$(OUTDIR)" $(BUILDFLAGS)
touch $@
check: .build/check