24 lines
436 B
Makefile
24 lines
436 B
Makefile
|
.PHONY: all clean
|
||
|
|
||
|
OBJS := $(addprefix webcmd.,linux64 linux32 win64 win32)
|
||
|
|
||
|
all: $(OBJS)
|
||
|
|
||
|
define compile
|
||
|
/bin/bash -c 'GOARCH=$(1) GOOS=$(2) go build -o ./webcmd.$(3) -ldflags "-s -w" ./cmd/webcmd'
|
||
|
endef
|
||
|
|
||
|
webcmd.linux64:
|
||
|
$(call compile,amd64,linux,linux64)
|
||
|
|
||
|
webcmd.linux32:
|
||
|
$(call compile,386,linux,linux32)
|
||
|
|
||
|
webcmd.win64:
|
||
|
$(call compile,amd64,windows,win64)
|
||
|
|
||
|
webcmd.win32:
|
||
|
$(call compile,386,windows,win32)
|
||
|
|
||
|
clean:
|
||
|
rm $(OBJS)
|