2020-05-17 12:25:46 +00:00
|
|
|
BUILD=`date +%FT%T%z`
|
|
|
|
|
|
|
|
LDFLAGS=-ldflags "-X main.buildDate=${BUILD}"
|
|
|
|
|
|
|
|
.PHONY: build deps static
|
|
|
|
|
|
|
|
build:
|
2020-05-18 09:47:30 +00:00
|
|
|
go build ${LDFLAGS} -o ledcontroller-server cmd/ledcontroller-server/main.go
|
|
|
|
|
|
|
|
emulator:
|
|
|
|
go build ${LDFLAGS} -o emulator cmd/emulator/main.go
|
2020-05-17 12:25:46 +00:00
|
|
|
|
|
|
|
deps:
|
2020-05-18 09:47:30 +00:00
|
|
|
cd cmd/ledcontroller-server ; go get ; cd ../..
|
|
|
|
|
|
|
|
deps-emulator:
|
|
|
|
cd cmd/emulator ; go get ; cd ../..
|
2020-05-17 12:25:46 +00:00
|
|
|
|
2020-05-18 09:47:30 +00:00
|
|
|
# Static only makes sense for the server
|
2020-05-17 12:25:46 +00:00
|
|
|
static:
|
2020-05-18 09:47:30 +00:00
|
|
|
CGO_ENABLED=0 GOOS=linux go build ${LDFLAGS} -a -installsuffix cgo -o ledcontroller-server cmd/ledcontroller-server/main.go
|