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,24 +13,27 @@
debug = yes
static = no
suffix = .opt
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 =
LDFLAGS =
LIBS =
ifeq ($(debug),yes)
CXXFLAGS += -g
CPPFLAGS += -DKAK_DEBUG
CXXFLAGS += -g
suffix = .debug
else
ifeq ($(debug),no)
CXXFLAGS += -O3
suffix = .opt
else
error debug should be either yes or no
endif
endif
ifeq ($(static),yes)
LIBS += -ltinfo -lgpm
PKG_CONFIG_FLAGS += --static
LDFLAGS += -static -pthread
endif
@ -43,23 +46,25 @@ else
LIBS += -lncursesw -ldbghelp
CPPFLAGS += -D_XOPEN_SOURCE=700
else
LIBS += `pkg-config --libs ncursesw`
CPPFLAGS += `pkg-config --cflags ncursesw`
ifeq ($(CXX),g++)
LIBS += `pkg-config --libs ncursesw $(PKG_CONFIG_FLAGS)`
CPPFLAGS += `pkg-config --cflags ncursesw $(PKG_CONFIG_FLAGS)`
LDFLAGS += -rdynamic
endif
endif
endif
ifeq ($(CXX),clang++)
CXXFLAGS += -Wno-unknown-attributes
CXXFLAGS += -frelaxed-template-template-args
endif
ifeq ($(CXX),g++)
CXXFLAGS += -Wno-init-list-lifetime
endif
!cxx = |> $(CXX) $(CPPFLAGS) $(CXXFLAGS) -c %f -o %o |>
!ld = |> $(CXX) $(LDFLAGS) $(LIBS) %f -o %o |>
!ln = |> ln -sf %f %o |>
!cxx = |> ^ CC %f^ $(CXX) $(CPPFLAGS) $(CXXFLAGS) -MD -MP -MF %O.d -c %f -o %o |>
!ld = |> ^ LD %o^ $(CXX) $(LDFLAGS) %f $(LIBS) -o %o |>
!ln = |> ^ LN %o^ ln -sf %f %o |>
:foreach *.cc |> !cxx |> .%B$(suffix).o {objects}
:{objects} |> !ld |> kak$(suffix)
: foreach *.cc |> !cxx |> .%B$(suffix).o | .%B$(suffix).d {objs}
: |> ^ 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
: .version.cc |> ^ CC %f^ $(CXX) $(CPPFLAGS) $(CXXFLAGS) -c %f -o %o |> %B.o
: {objs} .version.o |> !ld |> kak$(suffix)
: kak$(suffix) |> !ln |> kak