summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Matveev <stargrave@stargrave.org>2015-10-06 10:59:13 +0300
committerSergey Matveev <stargrave@stargrave.org>2015-10-06 11:31:11 +0300
commite80115cf6921d4fc2d64b3b809c76a5019f82309 (patch)
tree93f332cc36055a062f3b5274db64025530845772
parent62b4ca67a0fb6f3da4e1268c6d3ecefc84e24d61 (diff)
downloadgoircd-e80115cf6921d4fc2d64b3b809c76a5019f82309.tar.xz
GNU and BSD Make compatible makefile
-rw-r--r--BSDmakefile3
-rw-r--r--GNUmakefile3
-rw-r--r--common.mk4
-rw-r--r--makefile4
4 files changed, 10 insertions, 4 deletions
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)