2015-06-10 20:59:55 +00:00
|
|
|
#
|
|
|
|
# Makefile for subiquity
|
|
|
|
#
|
2015-08-21 18:15:04 +00:00
|
|
|
NAME=subiquity
|
|
|
|
PYTHONSRC=$(NAME)
|
2015-09-01 16:28:23 +00:00
|
|
|
PYTHONPATH=$(shell pwd):$(shell pwd)/probert
|
2015-09-01 15:04:24 +00:00
|
|
|
PROBERTDIR=./probert
|
2017-01-25 22:46:05 +00:00
|
|
|
PROBERT_REPO=https://github.com/CanonicalLtd/probert
|
2018-05-24 16:47:16 +00:00
|
|
|
export PYTHONPATH
|
2018-05-21 19:00:41 +00:00
|
|
|
CWD := $(shell pwd)
|
2015-08-28 18:19:13 +00:00
|
|
|
|
2018-06-05 20:38:28 +00:00
|
|
|
CHECK_DIRS := console_conf/ subiquity/ subiquitycore/
|
|
|
|
PYTHON := python3
|
|
|
|
|
2015-08-28 18:19:13 +00:00
|
|
|
ifneq (,$(MACHINE))
|
|
|
|
MACHARGS=--machine=$(MACHINE)
|
|
|
|
endif
|
|
|
|
|
2015-11-02 22:49:31 +00:00
|
|
|
.PHONY: run clean check
|
2015-06-17 20:36:32 +00:00
|
|
|
|
2015-07-06 15:55:49 +00:00
|
|
|
all: dryrun
|
|
|
|
|
2017-01-25 22:29:20 +00:00
|
|
|
install_deps:
|
2018-05-17 22:25:41 +00:00
|
|
|
sudo apt-get install -y python3-urwid python3-pyudev python3-nose python3-flake8 \
|
2018-02-15 00:27:56 +00:00
|
|
|
python3-yaml python3-coverage python3-dev pkg-config libnl-genl-3-dev \
|
2018-05-22 11:15:13 +00:00
|
|
|
libnl-route-3-dev python3-attr python3-distutils-extra python3-requests \
|
2018-06-05 20:38:28 +00:00
|
|
|
python3-requests-unixsocket
|
2018-02-14 22:40:50 +00:00
|
|
|
|
|
|
|
i18n:
|
2018-06-05 20:38:28 +00:00
|
|
|
$(PYTHON) setup.py build
|
2018-02-14 22:40:50 +00:00
|
|
|
|
|
|
|
dryrun: probert i18n
|
2017-01-25 22:29:20 +00:00
|
|
|
$(MAKE) ui-view DRYRUN="--dry-run --uefi"
|
2015-06-10 20:59:55 +00:00
|
|
|
|
2015-06-30 20:08:42 +00:00
|
|
|
ui-view:
|
2018-06-06 18:30:03 +00:00
|
|
|
$(PYTHON) -m subiquity $(DRYRUN) $(MACHARGS)
|
2015-06-25 21:49:29 +00:00
|
|
|
|
2015-06-30 21:53:12 +00:00
|
|
|
ui-view-serial:
|
2018-06-06 18:30:03 +00:00
|
|
|
(TERM=att4424 $(PYTHON) -m subiquity $(DRYRUN) --serial)
|
2015-06-30 21:53:12 +00:00
|
|
|
|
2018-06-05 20:38:28 +00:00
|
|
|
lint: flake8
|
2018-05-21 19:52:38 +00:00
|
|
|
|
2018-06-05 20:38:28 +00:00
|
|
|
flake8:
|
|
|
|
@echo 'tox -e flake8' is preferred to 'make flake8'
|
|
|
|
$(PYTHON) -m flake8 $(CHECK_DIRS)
|
2015-06-25 21:49:29 +00:00
|
|
|
|
|
|
|
unit:
|
|
|
|
echo "Running unit tests..."
|
2018-06-05 20:38:28 +00:00
|
|
|
$(PYTHON) -m nose $(CHECK_DIRS)
|
2015-06-15 19:12:26 +00:00
|
|
|
|
2018-06-05 20:38:28 +00:00
|
|
|
check: unit
|
2015-11-02 22:49:31 +00:00
|
|
|
|
2015-09-01 15:04:24 +00:00
|
|
|
probert:
|
|
|
|
@if [ ! -d "$(PROBERTDIR)" ]; then \
|
|
|
|
git clone -q $(PROBERT_REPO) $(PROBERTDIR); \
|
2018-06-05 20:38:28 +00:00
|
|
|
(cd probert && $(PYTHON) setup.py build_ext -i); \
|
2015-09-01 15:04:24 +00:00
|
|
|
fi
|
|
|
|
|
2015-06-15 19:12:26 +00:00
|
|
|
clean:
|
2017-09-22 18:28:55 +00:00
|
|
|
./debian/rules clean
|
2018-05-24 19:33:25 +00:00
|
|
|
|
2018-06-05 20:38:28 +00:00
|
|
|
.PHONY: flake8 lint
|