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
|
2015-08-05 15:05:15 +03:00
|
|
|
|
2016-12-22 10:06:57 +03:00
|
|
|
suffix = .opt
|
|
|
|
|
|
|
|
CXX = g++
|
2017-11-04 09:35:59 +03:00
|
|
|
CXXFLAGS = -pedantic -std=gnu++14 -Wall -Wno-unused-parameter -Wno-reorder -Wno-sign-compare -Wno-address -Wno-noexcept-type -Wno-unknown-attributes -Wno-unknown-warning-option
|
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
|
|
|
|
|
2015-08-05 15:05:15 +03:00
|
|
|
ifeq (@(TUP_PLATFORM),macosx)
|
2017-11-01 09:15:11 +03:00
|
|
|
LIBS += -lncurses
|
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)
|
2017-11-01 09:15:11 +03:00
|
|
|
LIBS += -lncursesw -ldbghelp
|
2016-12-22 10:06:57 +03:00
|
|
|
CPPFLAGS += -D_XOPEN_SOURCE=700
|
2015-08-05 15:05:15 +03:00
|
|
|
else
|
2017-11-04 09:35:59 +03:00
|
|
|
LIBS += `pkg-config --libs ncursesw`
|
|
|
|
CPPFLAGS += `pkg-config --cflags ncursesw`
|
2015-08-05 15:05:15 +03:00
|
|
|
|
|
|
|
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 |>
|
2017-03-15 17:35:44 +03:00
|
|
|
!ln = |> ln -sf %f %o |>
|
2015-08-05 15:05:15 +03:00
|
|
|
|
2018-02-24 15:54:34 +03:00
|
|
|
:foreach *.cc |> !cxx |> .%B$(suffix).o {objects}
|
2017-03-15 17:35:44 +03:00
|
|
|
:{objects} |> !ld |> kak$(suffix)
|
|
|
|
:kak$(suffix) |> !ln |> kak
|