webcmd/Makefile

24 lines
436 B
Makefile
Raw Normal View History

2017-03-25 02:41:36 +00:00
.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)