-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
31 lines (24 loc) · 795 Bytes
/
Makefile
File metadata and controls
31 lines (24 loc) · 795 Bytes
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
ARCH_TARGETS=386 amd64
OUTPUTS=out/tor-tools-darwin-amd64 $(addprefix out/tor-tools-windows-$(GOARCH),$(addsuffix .exe,$(ARCH_TARGETS))) $(addprefix out/tor-tools-linux-,$(ARCH_TARGETS) arm64)
.PHONY: all
all: clean $(OUTPUTS)
define compileTarget =
ifeq ($(1),windows)
out/tor-tools-$(1)-$(2).exe: out/
env GOOS=$(1) GOARCH=$(2) go build -o ./out/tor-tools-$(1)-$(2).exe ./cmd
else
out/tor-tools-$(1)-$(2): out/
env GOOS=$(1) GOARCH=$(2) go build -o ./out/tor-tools-$(1)-$(2) ./cmd
endif
endef
$(foreach GOARCH,$(ARCH_TARGETS) arm64,$(eval $(call compileTarget,linux,$(GOARCH))))
$(foreach GOARCH,$(ARCH_TARGETS),$(eval $(call compileTarget,windows,$(GOARCH))))
$(eval $(call compileTarget,darwin,amd64))
out/:
mkdir ./out
.PHONY: test
test:
@true
.PHONY: clean
clean:
rm -rf ./out