summaryrefslogtreecommitdiff
path: root/Makefile
blob: a19af3e40571d88ef5471d2fdbf410b5cd9f85b9 (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))

clean:
	$(MAKE) -C exports clean
	$(MAKE) .clean_libs $(foreach wrapper,$(wrappers),.clean_$(wrapper) )

.clean_libs:
	$(MAKE) -C exports clean

define wrapper_targets
.test_$(1):
	$(MAKE) -C $(1) test
.clean_$(1):
	$(MAKE) -C $(1) clean
endef

$(foreach wrapper,$(wrappers),$(eval $(call wrapper_targets,$(wrapper))))