]> Cypherpunks.ru repositories - goircd.git/commitdiff
GNU and BSD Make compatible makefile
authorSergey Matveev <stargrave@stargrave.org>
Tue, 6 Oct 2015 07:59:13 +0000 (10:59 +0300)
committerSergey Matveev <stargrave@stargrave.org>
Tue, 6 Oct 2015 08:31:11 +0000 (11:31 +0300)
BSDmakefile [new file with mode: 0644]
GNUmakefile [new file with mode: 0644]
common.mk [new file with mode: 0644]
makefile [deleted file]

diff --git a/BSDmakefile b/BSDmakefile
new file mode 100644 (file)
index 0000000..e3e6326
--- /dev/null
@@ -0,0 +1,3 @@
+VERSION != git describe --tags
+
+include common.mk
diff --git a/GNUmakefile b/GNUmakefile
new file mode 100644 (file)
index 0000000..04d452d
--- /dev/null
@@ -0,0 +1,3 @@
+VERSION = $(shell git describe --tags)
+
+include common.mk
diff --git a/common.mk b/common.mk
new file mode 100644 (file)
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 (file)
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)