Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions tests/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,15 @@ all: unittest kernel regression opencl riscv
unittest:
$(MAKE) -C unittest

kernel:
# kernel and regression both link the sw/kernel libraries: build them once
# first, so the two don't build them at the same time under -j.
kernel-lib:
$(MAKE) -C $(ROOT_DIR)/sw/kernel

kernel: kernel-lib
$(MAKE) -C kernel

regression:
regression: kernel-lib
$(MAKE) -C regression

opencl:
Expand Down Expand Up @@ -41,4 +46,4 @@ clean:
$(MAKE) -C graphics clean
$(MAKE) -C mpi clean

.PHONY: all unittest kernel regression opencl riscv hip graphics mpi
.PHONY: all kernel-lib unittest kernel regression opencl riscv hip graphics mpi
19 changes: 15 additions & 4 deletions tests/kernel/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -22,20 +22,31 @@ backend_tests = $(filter-out $(EXCLUDE) $(EXCLUDE_$(1)),$(TESTS))
all: $(addprefix build-,$(ACTIVE_TESTS))
clean: $(addprefix clean-,$(TESTS))

# The per-test runs build a missing simulator on demand; sim-<backend> builds
# it once first, so parallel runs don't each start the same build.
define backend_rule
.PHONY: run-$(1)
.PHONY: run-$(1) sim-$(1)
run-$(1): $$(addprefix run-$(1)-,$$(call backend_tests,$(1)))
sim-$(1):
@test -e $$(ROOT_DIR)/sim/$(1)/$(1) || $$(MAKE) -C $$(ROOT_DIR)/sim/$(1)
run-$(1)-%: kernel-lib sim-$(1)
$$(MAKE) -C $$* run-$(1)
endef
$(foreach b,$(BACKENDS),$(eval $(call backend_rule,$(b))))

# --- shared kernel library -------------------------------------------
# Every test links sw/kernel's libvortex.a. Build it once, before the
# per-test makes run in parallel, so they don't each start the same build.
.PHONY: kernel-lib
kernel-lib:
$(MAKE) -C $(ROOT_DIR)/sw/kernel

# --- pattern recipes --------------------------------------------------
.PHONY: build-% clean-%

build-%:
build-%: kernel-lib
$(MAKE) -C $* all

clean-%:
$(MAKE) -C $* clean

run-%:
$(MAKE) -C $(word 2,$(subst -, ,$*)) run-$(word 1,$(subst -, ,$*))
11 changes: 9 additions & 2 deletions tests/regression/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -50,16 +50,23 @@ run-$(1): $$(addprefix run-$(1)-,$$(call backend_tests,$(1)))
endef
$(foreach b,$(BACKENDS),$(eval $(call backend_rule,$(b))))

# --- shared kernel library -------------------------------------------
# Every test links a sw/kernel library. Build it once, before the per-test
# makes run in parallel, so they don't each start the same build.
.PHONY: kernel-lib
kernel-lib:
$(MAKE) -C $(ROOT_DIR)/sw/kernel

# --- pattern recipes --------------------------------------------------
.PHONY: build-% clean-%

build-%:
build-%: kernel-lib
$(MAKE) -C $* all

clean-%:
$(MAKE) -C $* clean

# run-<backend>-<test>: split "<backend>-<test>" on the first dash.
# Subdir names must not contain '-' (none currently do).
run-%:
run-%: kernel-lib
$(MAKE) -C $(word 2,$(subst -, ,$*)) run-$(word 1,$(subst -, ,$*))
Loading