From aac665f2b3dd548a12a098bb6a6516ca1e07288b Mon Sep 17 00:00:00 2001 From: Frank LENORMAND Date: Thu, 22 Dec 2016 10:06:57 +0300 Subject: [PATCH] Update the Tupfile Compiling with `clang++` was also tweaked, in order to avoid unknown attributes warnings. --- contrib/Tupfile | 35 ++++++++++++++++++++++++++++------- 1 file changed, 28 insertions(+), 7 deletions(-) diff --git a/contrib/Tupfile b/contrib/Tupfile index 24adcf41c..29b620d70 100644 --- a/contrib/Tupfile +++ b/contrib/Tupfile @@ -10,26 +10,43 @@ .gitignore -debug = yes +debug = yes +static = no +pedantic = yes -CXX = g++ -CXXFLAGS = -std=gnu++11 -Wall -Wno-reorder -Wno-sign-compare -pedantic +suffix = .opt + +CXX = g++ +CXXFLAGS = -std=gnu++11 -Wall -Wno-reorder -Wno-sign-compare -Wno-address CPPFLAGS = -LDFLAGS = -LIBS = +LDFLAGS = +LIBS = ifeq ($(debug),yes) - CXXFLAGS += -O0 -g + CXXFLAGS += -g CPPFLAGS += -DKAK_DEBUG + suffix = .debug else CXXFLAGS += -O3 endif +ifeq ($(static),yes) + LIBS += -ltinfo -lgpm + LDFLAGS += -static -pthread +endif + +ifeq ($(pedantic),yes) + CXXFLAGS += -pedantic +endif + ifeq (@(TUP_PLATFORM),macosx) LIBS += -lncurses -lboost_regex-mt + CPPFLAGS += -I/usr/local/opt/ncurses/include + LDFLAGS += -L/usr/local/opt/ncurses/lib else ifeq (@(TUP_PLATFORM),win32) LIBS += -lncursesw -lboost_regex -ldbghelp + CPPFLAGS += -D_XOPEN_SOURCE=700 else LIBS += -lncursesw -lboost_regex CPPFLAGS += -I/usr/include/ncursesw @@ -40,8 +57,12 @@ else endif endif +ifeq ($(CXX),clang++) + CXXFLAGS += -Wno-unknown-attributes +endif + !cxx = |> $(CXX) $(CPPFLAGS) $(CXXFLAGS) -c %f -o %o |> !ld = |> $(CXX) $(LDFLAGS) $(LIBS) %f -o %o |> -:foreach *.cc |> !cxx |> obj/%B.o {objects} +:foreach *.cc |> !cxx |> obj/%B$(suffix).o {objects} :{objects} |> !ld |> kak