From: Sergey Matveev Date: Tue, 6 Oct 2015 07:59:13 +0000 (+0300) Subject: GNU and BSD Make compatible makefile X-Git-Tag: 1.2~5 X-Git-Url: http://www.git.cypherpunks.ru/?p=goircd.git;a=commitdiff_plain;h=e80115cf6921d4fc2d64b3b809c76a5019f82309 GNU and BSD Make compatible makefile --- diff --git a/BSDmakefile b/BSDmakefile new file mode 100644 index 0000000..e3e6326 --- /dev/null +++ b/BSDmakefile @@ -0,0 +1,3 @@ +VERSION != git describe --tags + +include common.mk diff --git a/GNUmakefile b/GNUmakefile new file mode 100644 index 0000000..04d452d --- /dev/null +++ b/GNUmakefile @@ -0,0 +1,3 @@ +VERSION = $(shell git describe --tags) + +include common.mk diff --git a/common.mk b/common.mk new file mode 100644 index 0000000..888e048 --- /dev/null +++ b/common.mk @@ -0,0 +1,4 @@ +LDFLAGS = -X main.version=$(VERSION) + +goircd: *.go + go build -ldflags "$(LDFLAGS)" diff --git a/makefile b/makefile deleted file mode 100644 index 26e28a7..0000000 --- a/makefile +++ /dev/null @@ -1,4 +0,0 @@ -LDFLAGS=-X main.version \"$(shell git describe --tags)\" - -goircd: - go build -ldflags "$(LDFLAGS)" $(BUILD_FLAGS)