mirror of
https://github.com/lkl/linux.git
synced 2025-12-19 16:13:19 +09:00
lkl: add tests build barrier
tools/build does not support parallel builds when objects are shared between build targets. Keep the test that uses the most common object first and insert a build barrier to avoid rebuilding common objects. Signed-off-by: Octavian Purdila <tavip@google.com>
This commit is contained in:
@@ -50,8 +50,14 @@ export CFLAGS += -I$(OUTPUT)/include -Iinclude -Wall -g -O2 -Wextra \
|
|||||||
|
|
||||||
-include Targets
|
-include Targets
|
||||||
|
|
||||||
TARGETS := $(progs-y:%=$(OUTPUT)%$(EXESUF))
|
# Expand targets to output location and suffix but preserve special
|
||||||
TARGETS += $(libs-y:%=$(OUTPUT)%$(SOSUF))
|
# targets (e.g. .WAIT)
|
||||||
|
# $1 - targets
|
||||||
|
# $2 - suffix
|
||||||
|
expand-targets = $(foreach t,$(1),$(if $(filter .%,$(t)),$(t),$(OUTPUT)$(t)$(2)))
|
||||||
|
|
||||||
|
TARGETS := $(call expand-targets,$(progs-y),$(EXESUF))
|
||||||
|
TARGETS += $(call expand-targets,$(libs-y),$(SOSUF))
|
||||||
all: $(TARGETS)
|
all: $(TARGETS)
|
||||||
|
|
||||||
# this workaround is for FreeBSD
|
# this workaround is for FreeBSD
|
||||||
@@ -135,7 +141,7 @@ libraries_install: $(libs-y:%=$(OUTPUT)%$(SOSUF)) $(OUTPUT)liblkl.a
|
|||||||
install -d $(DESTDIR)$(LIBDIR) ; \
|
install -d $(DESTDIR)$(LIBDIR) ; \
|
||||||
install -m 644 $^ $(DESTDIR)$(LIBDIR)
|
install -m 644 $^ $(DESTDIR)$(LIBDIR)
|
||||||
|
|
||||||
programs_install: $(progs-y:%=$(OUTPUT)%$(EXESUF))
|
programs_install: $(call expand-targets,$(progs-y),$(EXESUF))
|
||||||
$(call QUIET_INSTALL, programs) \
|
$(call QUIET_INSTALL, programs) \
|
||||||
install -d $(DESTDIR)$(BINDIR) ; \
|
install -d $(DESTDIR)$(BINDIR) ; \
|
||||||
install -m 755 $^ $(DESTDIR)$(BINDIR)
|
install -m 755 $^ $(DESTDIR)$(BINDIR)
|
||||||
@@ -157,4 +163,4 @@ FORCE: ;
|
|||||||
.PHONY: headers_install libraries_install programs_install install
|
.PHONY: headers_install libraries_install programs_install install
|
||||||
.NOTPARALLEL : lib/lkl.o
|
.NOTPARALLEL : lib/lkl.o
|
||||||
.SECONDARY:
|
.SECONDARY:
|
||||||
|
.WAIT:
|
||||||
|
|||||||
@@ -25,8 +25,13 @@ progs-$(LKL_HOST_CONFIG_ARCHIVE) += cptofs
|
|||||||
LDLIBS_cptofs-y := -larchive
|
LDLIBS_cptofs-y := -larchive
|
||||||
LDLIBS_cptofs-$(LKL_HOST_CONFIG_NEEDS_LARGP) += -largp
|
LDLIBS_cptofs-$(LKL_HOST_CONFIG_NEEDS_LARGP) += -largp
|
||||||
|
|
||||||
progs-y += tests/boot
|
# tools/build/Makefile.build does not support parallel builds when
|
||||||
|
# objects are shared between build objects so keep the test that uses
|
||||||
|
# the most common object first and insert a build barrier to avoid
|
||||||
|
# rebuilding common objects
|
||||||
progs-y += tests/disk
|
progs-y += tests/disk
|
||||||
|
progs-y += .WAIT
|
||||||
|
progs-y += tests/boot
|
||||||
progs-y += tests/disk-vfio-pci
|
progs-y += tests/disk-vfio-pci
|
||||||
progs-y += tests/net-test
|
progs-y += tests/net-test
|
||||||
progs-y += tests/config
|
progs-y += tests/config
|
||||||
|
|||||||
Reference in New Issue
Block a user