From 26480fb13c8d7f298c58a6a3300616f662f149f2 Mon Sep 17 00:00:00 2001 From: evandrocoan Date: Sun, 26 Apr 2020 03:02:02 -0300 Subject: [PATCH] Fixed make clean rule not working on Windows --- Makefile | 3 ++- pylib/Makefile | 2 +- qt/Makefile | 4 ++-- rslib/Makefile | 2 +- rspy/Makefile | 6 +++--- 5 files changed, 9 insertions(+), 8 deletions(-) diff --git a/Makefile b/Makefile index f1e378e49..029f29cb9 100644 --- a/Makefile +++ b/Makefile @@ -7,6 +7,7 @@ endif .SHELLFLAGS := -eu -o pipefail ${SHELLFLAGS} -c MAKEFLAGS += --warn-undefined-variables MAKEFLAGS += --no-builtin-rules +FIND := $(if $(wildcard /bin/find),/bin/find,/usr/bin/find) ifndef OS OS := unknown @@ -148,7 +149,7 @@ clean: clean-dist # remove any files in dist/ folder without current build hash .PHONY: clean-dist clean-dist: buildhash - find dist \! -name "*$$(cat meta/buildhash)*" -type f -delete + "${FIND}" dist \! -name "*$$(cat meta/buildhash)*" -type f -delete .PHONY: check check: pyenv buildhash prepare diff --git a/pylib/Makefile b/pylib/Makefile index 7782bdd84..5e5cba96f 100644 --- a/pylib/Makefile +++ b/pylib/Makefile @@ -72,7 +72,7 @@ clean: # Checking python ###################### -CHECKDEPS := $(shell ${FIND} anki tests -name '*.py' | grep -v buildinfo.py) +CHECKDEPS := $(shell "${FIND}" anki tests -name '*.py' | grep -v buildinfo.py) .build/mypy: $(CHECKDEPS) python -m mypy ${MYPY_ARGS} anki diff --git a/qt/Makefile b/qt/Makefile index d4687647e..2ebee6968 100644 --- a/qt/Makefile +++ b/qt/Makefile @@ -42,7 +42,7 @@ all: check python -m pip install -r requirements.dev @touch $@ -.build/ui: $(shell ${FIND} designer -type f) +.build/ui: $(shell "${FIND}" designer -type f) ./tools/build_ui.sh @touch $@ @@ -96,7 +96,7 @@ JSDEPS := $(patsubst ts/src/%.ts, web/%.js, $(TSDEPS)) PYLIB := ../pylib -CHECKDEPS := $(shell ${FIND} aqt tests -name '*.py' | grep -v buildinfo.py) +CHECKDEPS := $(shell "${FIND}" aqt tests -name '*.py' | grep -v buildinfo.py) .build/mypy: $(CHECKDEPS) .build/qt-stubs python -m mypy ${MYPY_ARGS} aqt diff --git a/rslib/Makefile b/rslib/Makefile index 94bb7432d..4f5eb06aa 100644 --- a/rslib/Makefile +++ b/rslib/Makefile @@ -30,7 +30,7 @@ develop: .build/vernum ftl/repo ftl/repo: (cd ftl && ./scripts/fetch-latest-translations) -ALL_SOURCE := $(shell ${FIND} src -type f | egrep -v "i18n/autogen|i18n/ftl|_proto.rs") $(wildcard ftl/*.ftl) +ALL_SOURCE := $(shell "${FIND}" src -type f | egrep -v "i18n/autogen|i18n/ftl|_proto.rs") $(wildcard ftl/*.ftl) # nightly currently required for ignoring files in rustfmt.toml RUST_TOOLCHAIN := $(shell cat rust-toolchain) diff --git a/rspy/Makefile b/rspy/Makefile index c6dd10aac..f9805ff97 100644 --- a/rspy/Makefile +++ b/rspy/Makefile @@ -50,9 +50,9 @@ develop: .build/develop DEPS := .build/tools .build/vernum ../meta/buildhash \ $(wildcard $(QT_FTL_TEMPLATES)/*.ftl) \ $(wildcard $(QT_FTL_LOCALES)/*/*.ftl) \ - $(shell ${FIND} ../rslib/src -name '*.rs') $(wildcard ../proto/*) \ - $(shell ${FIND} ../rslib/ftl -type f) \ - $(shell ${FIND} ./src -type f) + $(shell "${FIND}" ../rslib/src -name '*.rs') $(wildcard ../proto/*) \ + $(shell "${FIND}" ../rslib/ftl -type f) \ + $(shell "${FIND}" ./src -type f) .build/develop: $(DEPS) touch ../proto/backend.proto