Update Makefile .PHONY targets

Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
This commit is contained in:
Olivier Gayot 2021-12-13 20:20:32 +01:00
parent 2b34458d14
commit 9b638270bc
1 changed files with 21 additions and 4 deletions

View File

@ -19,10 +19,10 @@ ifneq (,$(MACHINE))
MACHARGS=--machine=$(MACHINE) MACHARGS=--machine=$(MACHINE)
endif endif
.PHONY: run clean check .PHONY: all
all: dryrun all: dryrun
.PHONY: aptdeps
aptdeps: aptdeps:
sudo apt update && \ sudo apt update && \
sudo apt-get install -y python3-urwid python3-pyudev python3-nose python3-flake8 \ sudo apt-get install -y python3-urwid python3-pyudev python3-nose python3-flake8 \
@ -32,53 +32,69 @@ aptdeps:
python3-bson xorriso isolinux python3-aiohttp cloud-init ssh-import-id \ python3-bson xorriso isolinux python3-aiohttp cloud-init ssh-import-id \
curl jq build-essential python3-pytest python3-async-timeout language-selector-common curl jq build-essential python3-pytest python3-async-timeout language-selector-common
.PHONY: install_deps
install_deps: aptdeps gitdeps install_deps: aptdeps gitdeps
.PHONY: i18n
i18n: i18n:
$(PYTHON) setup.py build_i18n $(PYTHON) setup.py build_i18n
cd po; intltool-update -r -g subiquity cd po; intltool-update -r -g subiquity
.PHONY: dryrun ui-view
dryrun ui-view: probert i18n dryrun ui-view: probert i18n
$(PYTHON) -m subiquity $(DRYRUN) $(MACHARGS) $(PYTHON) -m subiquity $(DRYRUN) $(MACHARGS)
.PHONY: dryrun-console-conf ui-view-console-conf
dryrun-console-conf ui-view-console-conf: dryrun-console-conf ui-view-console-conf:
$(PYTHON) -m console_conf.cmd.tui --dry-run $(MACHARGS) $(PYTHON) -m console_conf.cmd.tui --dry-run $(MACHARGS)
.PHONY: dryrun-serial ui-view-serial
dryrun-serial ui-view-serial: dryrun-serial ui-view-serial:
(TERM=att4424 $(PYTHON) -m subiquity $(DRYRUN) --serial) (TERM=att4424 $(PYTHON) -m subiquity $(DRYRUN) --serial)
.PHONY: dryrun-server
dryrun-server: dryrun-server:
$(PYTHON) -m subiquity.cmd.server $(DRYRUN) $(PYTHON) -m subiquity.cmd.server $(DRYRUN)
.PHONY: dryrun-system-setup
dryrun-system-setup: dryrun-system-setup:
$(PYTHON) -m system_setup.cmd.tui $(SYSTEM_SETUP_DRYRUN) $(PYTHON) -m system_setup.cmd.tui $(SYSTEM_SETUP_DRYRUN)
.PHONY: dryrun-system-setup-server
dryrun-system-setup-server: dryrun-system-setup-server:
$(PYTHON) -m system_setup.cmd.server $(SYSTEM_SETUP_DRYRUN) $(PYTHON) -m system_setup.cmd.server $(SYSTEM_SETUP_DRYRUN)
.PHONY: dryrun-system-setup-recon
dryrun-system-setup-recon: dryrun-system-setup-recon:
DRYRUN_RECONFIG=true $(PYTHON) -m system_setup.cmd.tui $(SYSTEM_SETUP_DRYRUN) DRYRUN_RECONFIG=true $(PYTHON) -m system_setup.cmd.tui $(SYSTEM_SETUP_DRYRUN)
.PHONY: dryrun-system-setup-server-recon
dryrun-system-setup-server-recon: dryrun-system-setup-server-recon:
DRYRUN_RECONFIG=true $(PYTHON) -m system_setup.cmd.server $(SYSTEM_SETUP_DRYRUN) DRYRUN_RECONFIG=true $(PYTHON) -m system_setup.cmd.server $(SYSTEM_SETUP_DRYRUN)
.PHONY: lint
lint: flake8 lint: flake8
.PHONY: flake8
flake8: flake8:
@echo 'tox -e flake8' is preferred to 'make flake8' @echo 'tox -e flake8' is preferred to 'make flake8'
$(PYTHON) -m flake8 $(CHECK_DIRS) $(PYTHON) -m flake8 $(CHECK_DIRS)
.PHONY: unit
unit: gitdeps unit: gitdeps
$(PYTHON) -m pytest --ignore curtin --ignore probert \ $(PYTHON) -m pytest --ignore curtin --ignore probert \
--ignore subiquity/tests/api --ignore subiquity/tests/api
.PHONY: api
api: gitdeps api: gitdeps
$(PYTHON) -m pytest subiquity/tests/api $(PYTHON) -m pytest subiquity/tests/api
.PHONY: integration
integration: gitdeps integration: gitdeps
echo "Running integration tests..." echo "Running integration tests..."
./scripts/runtests.sh ./scripts/runtests.sh
.PHONY: check
check: unit integration api check: unit integration api
curtin: snapcraft.yaml curtin: snapcraft.yaml
@ -88,13 +104,14 @@ probert: snapcraft.yaml
./scripts/update-part.py probert ./scripts/update-part.py probert
(cd probert && $(PYTHON) setup.py build_ext -i); (cd probert && $(PYTHON) setup.py build_ext -i);
.PHONY: gitdeps
gitdeps: curtin probert gitdeps: curtin probert
.PHONY: schema
schema: gitdeps schema: gitdeps
@$(PYTHON) -m subiquity.cmd.schema > autoinstall-schema.json @$(PYTHON) -m subiquity.cmd.schema > autoinstall-schema.json
@$(PYTHON) -m system_setup.cmd.schema > autoinstall-system-setup-schema.json @$(PYTHON) -m system_setup.cmd.schema > autoinstall-system-setup-schema.json
.PHONY: clean
clean: clean:
./debian/rules clean ./debian/rules clean
.PHONY: flake8 lint