From a0eefcc5e54fee72074a9d1dc993e251c8b897ad Mon Sep 17 00:00:00 2001 From: Daniil Baturin Date: Fri, 18 Dec 2015 06:57:25 -0500 Subject: Extend the makefile. Split the 'iso' target into 'prepare' and 'iso' so it's possible to debug the preparation stage without having to start an actual ISO build. Add build and clean stages. Also add 'purge' target that "factory resets" the build environment. Add some tsun-tsun feel to the build log. --- Makefile | 27 +++++++++++++++++++++++---- 1 file changed, 23 insertions(+), 4 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 19021376..1ded0c8a 100644 --- a/Makefile +++ b/Makefile @@ -1,10 +1,12 @@ +build_dir := build + .PHONY: all all: @echo "Make what specifically?" @echo "The most common target is 'iso'" -.PHONY: iso -iso: +.PHONY: prepare +prepare: @echo "Starting VyOS ISO image build" @scripts/check-build-env @@ -13,6 +15,23 @@ iso: @scripts/live-build-config cp -r data/includes.chroot/* build/config/includes.chroot/ - @echo "The rest is not yet implemented ;)" +.PHONY: iso +.ONESHELL: +iso: prepare + @echo "It's not like I'm building this specially for you or anything!" + cd $(build_dir) + lb build 2>&1 | tee build.log + @echo "VyOS ISO build successful" + +.PHONY: clean +.ONESHELL: +clean: + cd $(build_dir) + lb clean + + rm -f config/binary config/bootstrap config/chroot config/common config/source + rm -f build.log - @echo "ISO build successful" +.PHONY: purge +purge: + rm -rf build/* -- cgit v1.2.3