2015-06-10 20:59:55 +00:00
|
|
|
#
|
|
|
|
# Makefile for subiquity
|
|
|
|
#
|
2015-08-21 18:15:04 +00:00
|
|
|
NAME=subiquity
|
2016-06-30 18:17:01 +00:00
|
|
|
VERSION=$(shell python3 -c "import subiquitycore; print(subiquitycore.__version__)")
|
2015-08-21 18:15:04 +00:00
|
|
|
PYTHONSRC=$(NAME)
|
2015-09-01 16:28:23 +00:00
|
|
|
PYTHONPATH=$(shell pwd):$(shell pwd)/probert
|
2015-06-30 16:52:31 +00:00
|
|
|
VENVPATH=$(shell pwd)/venv
|
|
|
|
VENVACTIVATE=$(VENVPATH)/bin/activate
|
|
|
|
TOPDIR=$(shell pwd)
|
2015-06-15 19:12:26 +00:00
|
|
|
STREAM=daily
|
|
|
|
RELEASE=wily
|
|
|
|
ARCH=amd64
|
2015-07-22 00:06:58 +00:00
|
|
|
BOOTLOADER=grub2
|
2015-06-15 19:12:26 +00:00
|
|
|
INSTALLIMG=ubuntu-server-${STREAM}-${RELEASE}-${ARCH}-installer.img
|
2015-06-17 20:36:32 +00:00
|
|
|
INSTALLER_RESOURCES += $(shell find installer/resources -type f)
|
2015-09-01 15:04:24 +00:00
|
|
|
PROBERTDIR=./probert
|
2016-06-23 20:29:34 +00:00
|
|
|
PROBERT_REPO=git@github.com:CanonicalLtd/probert.git
|
2015-09-01 15:04:24 +00:00
|
|
|
GITDEBDIR=./debian.git
|
2015-08-21 18:15:04 +00:00
|
|
|
DEBDIR=./debian
|
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
|
|
|
|
|
2015-09-01 15:04:24 +00:00
|
|
|
$(NAME)_$(VERSION).orig.tar.gz: probert clean
|
2015-08-21 18:15:04 +00:00
|
|
|
cd .. && tar czf $(NAME)_$(VERSION).orig.tar.gz $(shell basename `pwd`) --exclude-vcs --exclude=debian --exclude='.tox*'
|
|
|
|
|
|
|
|
tarball: $(NAME)_$(VERSION).orig.tar.gz
|
|
|
|
|
2017-01-25 22:29:20 +00:00
|
|
|
install_deps:
|
|
|
|
sudo apt-get install python3-urwid python3-pyudev python3-nose python3-flake8 python3-yaml python3-coverage
|
2015-07-23 16:23:00 +00:00
|
|
|
|
2015-09-01 15:04:24 +00:00
|
|
|
dryrun: probert
|
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:
|
2015-09-29 21:17:00 +00:00
|
|
|
(PYTHONPATH=$(PYTHONPATH) bin/$(PYTHONSRC)-tui $(DRYRUN) $(MACHARGS))
|
2015-06-25 21:49:29 +00:00
|
|
|
|
2015-06-30 21:53:12 +00:00
|
|
|
ui-view-serial:
|
2015-09-29 21:17:00 +00:00
|
|
|
(TERM=att4424 PYTHONPATH=$(PYTHONPATH) bin/$(PYTHONSRC)-tui $(DRYRUN) --serial)
|
2015-06-30 21:53:12 +00:00
|
|
|
|
2015-06-25 21:49:29 +00:00
|
|
|
lint:
|
|
|
|
echo "Running flake8 lint tests..."
|
2015-11-02 21:27:14 +00:00
|
|
|
python3 /usr/bin/flake8 bin/$(PYTHONSRC)-tui --ignore=F403
|
|
|
|
python3 /usr/bin/flake8 --exclude $(PYTHONSRC)/tests/ $(PYTHONSRC) --ignore=F403
|
2015-06-25 21:49:29 +00:00
|
|
|
|
|
|
|
unit:
|
|
|
|
echo "Running unit tests..."
|
2015-10-06 16:23:10 +00:00
|
|
|
nosetests3 $(PYTHONSRC)/tests
|
2015-06-15 19:12:26 +00:00
|
|
|
|
2015-11-02 22:49:31 +00:00
|
|
|
check: lint unit
|
|
|
|
|
2015-09-01 15:04:24 +00:00
|
|
|
installer/$(INSTALLIMG): installer/geninstaller installer/runinstaller $(INSTALLER_RESOURCES) probert
|
2015-09-30 17:58:11 +00:00
|
|
|
(cd installer && TOPDIR=$(TOPDIR)/installer ./geninstaller -v -r $(RELEASE) -a $(ARCH) -s $(STREAM) -b $(BOOTLOADER))
|
2015-06-17 20:36:32 +00:00
|
|
|
echo $(INSTALLER_RESOURCES)
|
|
|
|
|
|
|
|
installer: installer/$(INSTALLIMG)
|
2015-06-15 19:12:26 +00:00
|
|
|
|
|
|
|
run: installer
|
|
|
|
(cd installer && INSTALLER=$(INSTALLIMG) ./runinstaller)
|
|
|
|
|
2015-09-01 15:04:24 +00:00
|
|
|
probert:
|
|
|
|
@if [ ! -d "$(PROBERTDIR)" ]; then \
|
|
|
|
git clone -q $(PROBERT_REPO) $(PROBERTDIR); \
|
2017-01-25 22:29:20 +00:00
|
|
|
(cd probert && python3 setup.py build_ext -i); \
|
2015-09-01 15:04:24 +00:00
|
|
|
fi
|
|
|
|
|
2015-08-21 18:15:04 +00:00
|
|
|
git-checkout-deb:
|
2015-09-01 15:04:24 +00:00
|
|
|
@if [ ! -d "$(DEBDIR)" ]; then \
|
2015-08-21 18:15:04 +00:00
|
|
|
git clone -q https://github.com/CanonicalLtd/subiquity-deb.git $(GITDEBDIR); \
|
2015-09-01 15:04:24 +00:00
|
|
|
mv $(GITDEBDIR)/debian $(DEBDIR); \
|
|
|
|
rm -fr $(GITDEBDIR); \
|
|
|
|
fi
|
|
|
|
|
2015-09-30 14:57:49 +00:00
|
|
|
DPKGBUILDARGS = -i'.git.*|.tox|.bzr.*|.editorconfig|.travis-yaml'
|
2015-08-21 18:15:04 +00:00
|
|
|
deb-src: git-checkout-deb clean tarball
|
|
|
|
@dpkg-buildpackage -S -sa $(DPKGBUILDARGS)
|
|
|
|
|
2015-09-01 15:04:24 +00:00
|
|
|
deb-release: git-checkout-deb tarball
|
2015-08-21 18:15:04 +00:00
|
|
|
@dpkg-buildpackage -S -sd $(DPKGBUILDARGS)
|
|
|
|
|
|
|
|
deb: git-checkout-deb
|
2015-09-30 14:57:49 +00:00
|
|
|
@dpkg-buildpackage -us -uc -b $(DPKGBUILDARGS)
|
2015-08-21 18:15:04 +00:00
|
|
|
|
2015-06-15 19:12:26 +00:00
|
|
|
clean:
|
2015-09-01 15:04:24 +00:00
|
|
|
@if [ -d "$(DEBDIR)" ]; then \
|
|
|
|
./debian/rules clean; \
|
|
|
|
rm -rf debian/subiquity; \
|
|
|
|
rm -rf ../$(NAME)_*.deb ../$(NAME)_*.tar.gz ../$(NAME)_$.dsc ../$(NAME)_*.changes \
|
|
|
|
../$(NAME)_*.build ../$(NAME)_*.upload; \
|
|
|
|
wrap-and-sort; \
|
2017-01-25 22:29:20 +00:00
|
|
|
fi
|
2015-06-15 19:12:26 +00:00
|
|
|
rm -f installer/target.img
|
2015-10-26 20:38:04 +00:00
|
|
|
rm -f installer/target.img_*
|
2015-06-15 19:12:26 +00:00
|
|
|
rm -f installer/installer.img
|
|
|
|
rm -f installer/geninstaller.log
|
|
|
|
find installer -type f -name *-installer.img | xargs -i rm {}
|