Skip to content

Commit 9b9a7da

Browse files
committed
Makefile: build examples task
1 parent aaa64cd commit 9b9a7da

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

Makefile

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,27 @@
1+
.PHONY: generate test clobber example examples
2+
13
GOEXE ?= go
4+
EXAMPLES := $(wildcard macos/_examples/*)
25

36
generate:
47
$(GOEXE) generate ./...
5-
.PHONY: generate
68

79
test:
810
$(GOEXE) test ./...
9-
.PHONY: test
1011

1112
clobber:
1213
$(GOEXE) run ./generate/tools/clobbergen.go ./macos
13-
.PHONY: clobber
1414

1515
example:
1616
$(GOEXE) run ./macos/_examples/helloworld/main.go
17-
.PHONY: example
17+
18+
examples: _local/bin
19+
@for dir in $(EXAMPLES); do \
20+
$(GOEXE) build -o ./_local/bin/$$(basename $$dir) ./$$dir; \
21+
done
22+
23+
_local/bin:
24+
mkdir -p _local/bin
1825

1926
generate/symbols.zip:
2027
cd generate && wget https://github.com/mactypes/symbolsdb/releases/download/1.1/symbols.zip

0 commit comments

Comments
 (0)