iso.mk 1.06 KB
Newer Older
1
# this makefile is designed to be included in toplevel one
2 3 4
ifndef BUILDDIR
$(error BUILDDIR not defined)
endif
5

6 7
export ARCH ?= $(shell arch | sed 's/i686/i586/')

Michael Shigorin's avatar
Michael Shigorin committed
8 9
# step 4 is kicked off here but actually done by image.in/Makefile
#
Michael Shigorin's avatar
Michael Shigorin committed
10
# adding boot/isolinux to prereqs is too late here,
Michael Shigorin's avatar
Michael Shigorin committed
11
# since profile/populate target is already done by now
12 13 14
#
# NB: /usr/bin/{i586,x86_64} are setarch(8) symlinks

Michael Shigorin's avatar
Michael Shigorin committed
15
iso:
16
	@echo -n "** starting image build"
17
	@if [ -n "$(DEBUG)" ]; then \
Michael Shigorin's avatar
Michael Shigorin committed
18
		echo ": tail -f $(BUILDLOG)" $(SHORTEN); \
19 20 21
	else \
		echo " (coffee time)"; \
	fi
22
	@if time -f "%E %PCPU %Mk" $(ARCH) \
23 24
		$(MAKE) -C $(BUILDDIR)/ GLOBAL_BUILDDIR=$(BUILDDIR) $(LOG); \
	then \
Michael Shigorin's avatar
Michael Shigorin committed
25
		echo "** build done (`tail -1 $(BUILDLOG) | cut -f1 -d. \
26 27
			|| echo "no log"`)"; \
	else \
Michael Shigorin's avatar
Michael Shigorin committed
28
		echo "** build failed, see log: $(BUILDLOG)" $(SHORTEN); \
29
		if [ -z "$(DEBUG)" ]; then \
30 31
			echo "   (you might want to re-run with DEBUG=1)"; \
		fi; \
32
		tail -100 "$(BUILDLOG)" | egrep "^E:|[Ee]rror|[Ww]arning"; \
33 34
		df -P $(BUILDDIR) | awk 'END { if ($$4 < 1024) \
			{ print "** NB: low space on "$$6" ("$$5" used)"}}'; \
35
	fi