mirror of
https://github.com/ankitects/anki.git
synced 2025-09-18 14:02:21 -04:00
avoid running checks/builds when nothing has changed
with some defaults taken from https://tech.davis-hansson.com/p/make/
This commit is contained in:
parent
ff6b58c265
commit
c1cbab0d23
4 changed files with 54 additions and 14 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -10,3 +10,4 @@ tools/runanki.system
|
|||
anki/buildhash.py
|
||||
.mypy_cache
|
||||
.pytype
|
||||
.build
|
||||
|
|
54
Makefile
54
Makefile
|
@ -1,4 +1,16 @@
|
|||
PREFIX=/usr
|
||||
PREFIX := /usr
|
||||
SHELL := bash
|
||||
.SHELLFLAGS := -eu -o pipefail -c
|
||||
.ONESHELL:
|
||||
.DELETE_ON_ERROR:
|
||||
MAKEFLAGS += --warn-undefined-variables
|
||||
MAKEFLAGS += --no-builtin-rules
|
||||
RUNARGS :=
|
||||
.SUFFIXES:
|
||||
|
||||
$(shell mkdir -p .build)
|
||||
|
||||
.PHONY: all install uninstall
|
||||
|
||||
all:
|
||||
@echo "You can run Anki with ./runanki"
|
||||
|
@ -32,3 +44,43 @@ uninstall:
|
|||
-xdg-mime uninstall ${DESTDIR}${PREFIX}/share/mime/packages/anki.xml
|
||||
@echo
|
||||
@echo "Uninstall complete."
|
||||
|
||||
.PHONY: clean build run
|
||||
|
||||
clean:
|
||||
rm -rf .build
|
||||
|
||||
build: .build/ui
|
||||
|
||||
.build/ui: $(shell find designer -name '*.ui')
|
||||
./tools/build_ui.sh
|
||||
touch $@
|
||||
|
||||
run: build
|
||||
./runanki ${RUNARGS}
|
||||
|
||||
CHECKDEPS := .build/ui $(shell find anki aqt -name '*.py')
|
||||
|
||||
.PHONY: check mypy test lint pytype
|
||||
|
||||
check: mypy test lint pytype
|
||||
mypy: .build/mypy
|
||||
test: .build/test
|
||||
lint: .build/lint
|
||||
pytype: .build/pytype
|
||||
|
||||
.build/mypy: $(CHECKDEPS)
|
||||
mypy anki aqt
|
||||
touch $@
|
||||
|
||||
.build/test: $(CHECKDEPS)
|
||||
./tools/tests.sh
|
||||
touch $@
|
||||
|
||||
.build/lint: $(CHECKDEPS)
|
||||
pylint -j 0 --rcfile=.pylintrc -f colorized --extension-pkg-whitelist=PyQt5 anki aqt
|
||||
touch $@
|
||||
|
||||
.build/pytype: $(CHECKDEPS)
|
||||
pytype --config pytype.conf
|
||||
touch $@
|
||||
|
|
|
@ -1,6 +0,0 @@
|
|||
#!/bin/bash
|
||||
|
||||
set -e
|
||||
|
||||
TOOLS="$(cd "`dirname "$0"`"; pwd)"
|
||||
pylint -j 0 --rcfile=$TOOLS/../.pylintrc -f colorized --extension-pkg-whitelist=PyQt5 $TOOLS/../anki $TOOLS/../aqt
|
|
@ -1,7 +0,0 @@
|
|||
#!/bin/bash
|
||||
|
||||
set -e
|
||||
|
||||
TOOLS="$(cd "`dirname "$0"`"; pwd)"
|
||||
mypy $TOOLS/../anki $TOOLS/../aqt
|
||||
(cd $TOOLS/.. && pytype --config pytype.conf)
|
Loading…
Reference in a new issue