blob: 13b95f58fc9baaa8ec23584c8d4de9da41a61dce (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
|
.PHONY: build test test-go test-wrappers clean
build:
$(MAKE) -C exports build
test: test-go test-wrappers
test-go:
go test
wrappers = $(wildcard wrappers/*/)
# Enable parallelism if -j is specified
test-wrappers: build
$(MAKE) $(foreach wrapper,$(wrappers),.test_$(wrapper))
# Enable parallelism if -j is specified
clean:
$(MAKE) .clean_libs $(foreach wrapper,$(wrappers),.clean_$(wrapper))
.clean_libs:
$(MAKE) -C exports clean
# Define test & clean for each wrapper
define wrapper_targets
.test_$(1):
$(MAKE) -C "$(1)" test
.clean_$(1):
$(MAKE) -C "$(1)" clean
endef
$(foreach wrapper,$(wrappers),$(eval $(call wrapper_targets,$(wrapper))))
|