now supports some basic configuration

This commit is contained in:
2019-08-21 10:31:57 +02:00
parent f36da8dde9
commit e1fc2f11d7
4 changed files with 35 additions and 7 deletions

View File

@@ -1,11 +1,19 @@
VERSION := $(shell git rev-parse --short HEAD)
BUILDTIME := $(shell date -u '+%Y-%m-%dT%H:%M:%SZ')
BUILDUSER := $(shell whoami)
BUILDHOST := $(shell hostname -s)
BUILDARCH := $(shell uname -m)
GOLDFLAGS += -X main.Version=$(VERSION)
GOLDFLAGS += -X main.Buildtime=$(BUILDTIME)
GOLDFLAGS += -X main.Builduser=$(BUILDUSER)@$(BUILDHOST)
GOLDFLAGS += -X main.Buildarch=$(BUILDARCH)
GOFLAGS = -ldflags "$(GOLDFLAGS)"
default: run
default: rundebug
rundebug: build
DEBUG=1 ./ircd
run: build
./ircd