From 7ef56789fa447a5638b949585346182b00af37ee Mon Sep 17 00:00:00 2001 From: Frank LENORMAND Date: Wed, 5 Aug 2015 15:05:15 +0300 Subject: [PATCH] Implement a Tupfile to build kak with `tup` --- contrib/Tupfile | 47 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 contrib/Tupfile diff --git a/contrib/Tupfile b/contrib/Tupfile new file mode 100644 index 00000000..24adcf41 --- /dev/null +++ b/contrib/Tupfile @@ -0,0 +1,47 @@ +## +## Tupfile for kakoune +## by lenormf +## +## How to use: +## Initialize a tup database in the main directory with `tup init` +## Create a symlink from `contrib/Tupfile` to `src/Tupfile` +## Start the build with the `tup` command +## + +.gitignore + +debug = yes + +CXX = g++ +CXXFLAGS = -std=gnu++11 -Wall -Wno-reorder -Wno-sign-compare -pedantic +CPPFLAGS = +LDFLAGS = +LIBS = + +ifeq ($(debug),yes) + CXXFLAGS += -O0 -g + CPPFLAGS += -DKAK_DEBUG +else + CXXFLAGS += -O3 +endif + +ifeq (@(TUP_PLATFORM),macosx) + LIBS += -lncurses -lboost_regex-mt +else + ifeq (@(TUP_PLATFORM),win32) + LIBS += -lncursesw -lboost_regex -ldbghelp + else + LIBS += -lncursesw -lboost_regex + CPPFLAGS += -I/usr/include/ncursesw + + ifeq ($(CXX),g++) + LDFLAGS += -rdynamic + endif + endif +endif + +!cxx = |> $(CXX) $(CPPFLAGS) $(CXXFLAGS) -c %f -o %o |> +!ld = |> $(CXX) $(LDFLAGS) $(LIBS) %f -o %o |> + +:foreach *.cc |> !cxx |> obj/%B.o {objects} +:{objects} |> !ld |> kak