Commit 390f4f6b authored by Michael Shigorin's avatar Michael Shigorin

lib/build.mk: add basic CHECK support

The idea is to check: - the reachability of every target used to build the image in question; - the availability of all the package lists and subsequently packages for that image; - the lack of "dangling" intermediate targets, features, pkglists, hooks etc. So far only the first step is implemented -- it's easy and somewhat helpful already for make CHECK=1 all
parent a1d0b4a7
......@@ -22,6 +22,11 @@
+ значение: пусто (по умолчанию авто) либо строка
+ см. ../lib/profile.mk
- CHECK
+ включает режим проверки сборки конфигурации
+ значение: пусто (по умолчанию) либо любая строка
+ см. ../lib/build.mk
- CLEAN
+ экономия RAM+swap при сборке в tmpfs, иначе места на диске
+ очистка рабочего каталога после успешной сборки очередной стадии
......
......@@ -29,8 +29,12 @@ IMAGEDIR ?= $(shell [ -d "$$HOME/out" -a -w "$$HOME/out" ] \
# poehali
build: profile/populate
@echo -n "$(TIME) starting image build"
@if [ -n "$(DEBUG)" ]; then \
@if [ -n "$(CHECK)" ]; then \
echo "$(TIME) skipping actual image build (CHECK is set)"; \
exit; \
fi; \
echo -n "$(TIME) starting image build"; \
if [ -n "$(DEBUG)" ]; then \
echo ": tail -f $(BUILDLOG)" $(SHORTEN); \
else \
if [ -n "$(ALL)" ]; then \
......@@ -38,8 +42,8 @@ build: profile/populate
else \
echo " (coffee time)"; \
fi; \
fi
@if $(START) $(MAKE) -C $(BUILDDIR)/ $(LOG); then \
fi; \
if $(START) $(MAKE) -C $(BUILDDIR)/ $(LOG); then \
echo "$(TIME) done (`tail -1 $(BUILDLOG) | cut -f1 -d.`)"; \
tail -200 "$(BUILDLOG)" \
| GREP_COLOR="$(ANSI_OK)" \
......@@ -54,5 +58,5 @@ build: profile/populate
egrep --color=always "^(E:|[Ee]rror|[Ww]arning).*"; \
df -P $(BUILDDIR) | awk 'END { if ($$4 < $(LOWSPACE)) \
{ print "NB: low space on "$$6" ("$$5" used)"}}'; \
fi
@if [ -n "$(BELL)" ]; then echo -ne '\a' >&2; fi
fi; \
if [ -n "$(BELL)" ]; then echo -ne '\a' >&2; fi
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment