Update Tupfile to get it building

Merge some new changes from Makefile
Shorten the output as well
This commit is contained in:
Ivan Tham 2020-11-01 16:51:26 +08:00
parent 90043e7df0
commit a8454aa2b1

View File

@ -13,53 +13,58 @@
debug = yes debug = yes
static = no static = no
suffix = .opt
CXX = g++ CXX = g++
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 CXXFLAGS = -pedantic -std=c++17 -g -Wall -Wextra -Wno-unused-parameter -Wno-sign-compare -Wno-address
CPPFLAGS = CPPFLAGS =
LDFLAGS = LDFLAGS =
LIBS = LIBS =
ifeq ($(debug),yes) ifeq ($(debug),yes)
CXXFLAGS += -g CPPFLAGS += -DKAK_DEBUG
CPPFLAGS += -DKAK_DEBUG CXXFLAGS += -g
suffix = .debug suffix = .debug
else else
CXXFLAGS += -O3 ifeq ($(debug),no)
CXXFLAGS += -O3
suffix = .opt
else
error debug should be either yes or no
endif
endif endif
ifeq ($(static),yes) ifeq ($(static),yes)
LIBS += -ltinfo -lgpm PKG_CONFIG_FLAGS += --static
LDFLAGS += -static -pthread LDFLAGS += -static -pthread
endif endif
ifeq (@(TUP_PLATFORM),macosx) ifeq (@(TUP_PLATFORM),macosx)
LIBS += -lncurses LIBS += -lncurses
CPPFLAGS += -I/usr/local/opt/ncurses/include CPPFLAGS += -I/usr/local/opt/ncurses/include
LDFLAGS += -L/usr/local/opt/ncurses/lib LDFLAGS += -L/usr/local/opt/ncurses/lib
else else
ifeq (@(TUP_PLATFORM),win32) ifeq (@(TUP_PLATFORM),win32)
LIBS += -lncursesw -ldbghelp LIBS += -lncursesw -ldbghelp
CPPFLAGS += -D_XOPEN_SOURCE=700 CPPFLAGS += -D_XOPEN_SOURCE=700
else else
LIBS += `pkg-config --libs ncursesw` LIBS += `pkg-config --libs ncursesw $(PKG_CONFIG_FLAGS)`
CPPFLAGS += `pkg-config --cflags ncursesw` CPPFLAGS += `pkg-config --cflags ncursesw $(PKG_CONFIG_FLAGS)`
LDFLAGS += -rdynamic
ifeq ($(CXX),g++) endif
LDFLAGS += -rdynamic
endif
endif
endif endif
ifeq ($(CXX),clang++) ifeq ($(CXX),clang++)
CXXFLAGS += -Wno-unknown-attributes CXXFLAGS += -frelaxed-template-template-args
endif
ifeq ($(CXX),g++)
CXXFLAGS += -Wno-init-list-lifetime
endif endif
!cxx = |> $(CXX) $(CPPFLAGS) $(CXXFLAGS) -c %f -o %o |> !cxx = |> ^ CC %f^ $(CXX) $(CPPFLAGS) $(CXXFLAGS) -MD -MP -MF %O.d -c %f -o %o |>
!ld = |> $(CXX) $(LDFLAGS) $(LIBS) %f -o %o |> !ld = |> ^ LD %o^ $(CXX) $(LDFLAGS) %f $(LIBS) -o %o |>
!ln = |> ln -sf %f %o |> !ln = |> ^ LN %o^ ln -sf %f %o |>
:foreach *.cc |> !cxx |> .%B$(suffix).o {objects} : foreach *.cc |> !cxx |> .%B$(suffix).o | .%B$(suffix).d {objs}
:{objects} |> !ld |> kak$(suffix) : |> ^ MK %o^ printf "%%s" "namespace Kakoune { const char* version = \"`if [ -f .version ]; then cat .version; elif [ -d ../.git ]; then git describe --tags HEAD; else echo \"unknown\"; fi`\"; }" > .version.cc.tmp; if cmp -s .version.cc.tmp .version.cc; then rm .version.cc.tmp; else mv .version.cc.tmp .version.cc; fi |> .version.cc
:kak$(suffix) |> !ln |> kak : .version.cc |> ^ CC %f^ $(CXX) $(CPPFLAGS) $(CXXFLAGS) -c %f -o %o |> %B.o
: {objs} .version.o |> !ld |> kak$(suffix)
: kak$(suffix) |> !ln |> kak