summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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)