2015-08-05 15:05:15 +03:00
|
|
|
##
|
|
|
|
## 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
|
|
|
|
|
2016-12-22 10:06:57 +03:00
|
|
|
debug = yes
|
|
|
|
static = no
|
|
|
|
pedantic = yes
|
2015-08-05 15:05:15 +03:00
|
|
|
|
2016-12-22 10:06:57 +03:00
|
|
|
suffix = .opt
|
|
|
|
|
|
|
|
CXX = g++
|
|
|
|
CXXFLAGS = -std=gnu++11 -Wall -Wno-reorder -Wno-sign-compare -Wno-address
|
2015-08-05 15:05:15 +03:00
|
|
|
CPPFLAGS =
|
2016-12-22 10:06:57 +03:00
|
|
|
LDFLAGS =
|
|
|
|
LIBS =
|
2015-08-05 15:05:15 +03:00
|
|
|
|
|
|
|
ifeq ($(debug),yes)
|
2016-12-22 10:06:57 +03:00
|
|
|
CXXFLAGS += -g
|
2015-08-05 15:05:15 +03:00
|
|
|
CPPFLAGS += -DKAK_DEBUG
|
2016-12-22 10:06:57 +03:00
|
|
|
suffix = .debug
|
2015-08-05 15:05:15 +03:00
|
|
|
else
|
|
|
|
CXXFLAGS += -O3
|
|
|
|
endif
|
|
|
|
|
2016-12-22 10:06:57 +03:00
|
|
|
ifeq ($(static),yes)
|
|
|
|
LIBS += -ltinfo -lgpm
|
|
|
|
LDFLAGS += -static -pthread
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifeq ($(pedantic),yes)
|
|
|
|
CXXFLAGS += -pedantic
|
|
|
|
endif
|
|
|
|
|
2015-08-05 15:05:15 +03:00
|
|
|
ifeq (@(TUP_PLATFORM),macosx)
|
|
|
|
LIBS += -lncurses -lboost_regex-mt
|
2016-12-22 10:06:57 +03:00
|
|
|
CPPFLAGS += -I/usr/local/opt/ncurses/include
|
|
|
|
LDFLAGS += -L/usr/local/opt/ncurses/lib
|
2015-08-05 15:05:15 +03:00
|
|
|
else
|
|
|
|
ifeq (@(TUP_PLATFORM),win32)
|
|
|
|
LIBS += -lncursesw -lboost_regex -ldbghelp
|
2016-12-22 10:06:57 +03:00
|
|
|
CPPFLAGS += -D_XOPEN_SOURCE=700
|
2015-08-05 15:05:15 +03:00
|
|
|
else
|
|
|
|
LIBS += -lncursesw -lboost_regex
|
|
|
|
CPPFLAGS += -I/usr/include/ncursesw
|
|
|
|
|
|
|
|
ifeq ($(CXX),g++)
|
|
|
|
LDFLAGS += -rdynamic
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
2016-12-22 10:06:57 +03:00
|
|
|
ifeq ($(CXX),clang++)
|
|
|
|
CXXFLAGS += -Wno-unknown-attributes
|
|
|
|
endif
|
|
|
|
|
2015-08-05 15:05:15 +03:00
|
|
|
!cxx = |> $(CXX) $(CPPFLAGS) $(CXXFLAGS) -c %f -o %o |>
|
|
|
|
!ld = |> $(CXX) $(LDFLAGS) $(LIBS) %f -o %o |>
|
|
|
|
|
2016-12-22 10:06:57 +03:00
|
|
|
:foreach *.cc |> !cxx |> obj/%B$(suffix).o {objects}
|
2015-08-05 15:05:15 +03:00
|
|
|
:{objects} |> !ld |> kak
|