summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile5
1 files changed, 5 insertions, 0 deletions
diff --git a/Makefile b/Makefile
index 93bd7648..177d4260 100644
--- a/Makefile
+++ b/Makefile
@@ -30,6 +30,7 @@ tag-sanitize-undefined = .san_u
LDFLAGS-static-yes = -static -pthread
+version = $(shell cat .version 2>/dev/null || git describe --tags HEAD 2>/dev/null || echo unknown)
version != cat .version 2>/dev/null || git describe --tags HEAD 2>/dev/null || echo unknown
PREFIX = /usr/local
@@ -42,6 +43,7 @@ docdir = $(DESTDIR)$(PREFIX)/share/doc/kak
mandir = $(DESTDIR)$(PREFIX)/share/man/man1
# Both Cygwin and MSYS2 have "_NT" in their uname.
+os = $(shell uname | sed 's/.*_NT.*/Windows/')
os != uname | sed 's/.*_NT.*/Windows/'
CPPFLAGS-os-Darwin = -I/opt/local/include
@@ -63,6 +65,7 @@ LIBS-os-Windows = -ldbghelp
CXXFLAGS-default = -std=c++2a -Wall -Wextra -pedantic -Wno-unused-parameter -Wno-sign-compare
+compiler = $(shell $(CXX) --version | grep -E -o 'clang|g\+\+|c\+\+' | head -1)
compiler != $(CXX) --version | grep -E -o 'clang|g\+\+|c\+\+' | head -1
CXXFLAGS-compiler-clang = -fsized-deallocation
CXXFLAGS-compiler-g++ = -Wno-init-list-lifetime -Wno-stringop-overflow
@@ -97,6 +100,7 @@ tag = $(tag-debug-$(debug))$(tag-sanitize-$(sanitize))
.SUFFIXES: $(tag).o .cc
.PHONY: src/kak
+sources = $(shell find src -type f -name '*.cc' | sed -e '/\.version\.cc/d')
sources != find src -type f -name '*.cc' | sed -e '/\.version\.cc/d'
objects = $(sources:.cc=$(tag).o)
@@ -108,6 +112,7 @@ src/kak: src/kak$(tag)
src/kak$(tag): src/.version.o $(objects)
$(CXX) $(KAK_LDFLAGS) $(KAK_CXXFLAGS) $(KAK_LIBS) $(objects) src/.version.o -o $@
+deps = $(shell touch src/.version$(tag).d && find src -type f -name '.*$(tag).d' # Ensure we find one deps for FreeBSD make)
deps != touch src/.version$(tag).d && find src -type f -name '.*$(tag).d' # Ensure we find one deps for FreeBSD make
include $(deps)