sircd/Makefile

29 lines
588 B
Makefile
Raw Normal View History

2019-08-21 08:15:45 +00:00
VERSION := $(shell git rev-parse --short HEAD)
BUILDTIME := $(shell date -u '+%Y-%m-%dT%H:%M:%SZ')
2019-08-21 08:31:57 +00:00
BUILDUSER := $(shell whoami)
BUILDHOST := $(shell hostname -s)
BUILDARCH := $(shell uname -m)
2019-08-21 08:15:45 +00:00
GOLDFLAGS += -X main.Version=$(VERSION)
GOLDFLAGS += -X main.Buildtime=$(BUILDTIME)
2019-08-21 08:31:57 +00:00
GOLDFLAGS += -X main.Builduser=$(BUILDUSER)@$(BUILDHOST)
GOLDFLAGS += -X main.Buildarch=$(BUILDARCH)
2019-08-21 08:15:45 +00:00
GOFLAGS = -ldflags "$(GOLDFLAGS)"
2019-08-21 08:31:57 +00:00
default: rundebug
rundebug: build
DEBUG=1 ./ircd
2019-08-19 23:30:59 +00:00
2019-08-21 08:15:45 +00:00
run: build
./ircd
build: ./ircd
./ircd: *.go */*.go
go build -o $@ $(GOFLAGS) .
2019-08-20 02:15:56 +00:00
fmt:
go fmt *.go
go fmt sircd/*.go