Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow building for Kobo in debug mode #17

Merged
merged 2 commits into from
Dec 1, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 18 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ GITHASH='"'$(shell git rev-parse --short HEAD)'"'
CROSS_TC?=/home/llandsmeer/Build/gcc-linaro-7.5.0-2019.12-i686_arm-linux-gnueabihf/bin/arm-linux-gnueabihf
# CROSS_TC?=arm-linux-gnueabihf

ifeq ("$(DEBUG)","true")
CFLAGS += -g -pg
CXXFLAGS += -g -pg
ifdef DEBUG
CFLAGS += -g -fno-omit-frame-pointer -pg
CXXFLAGS += -g -fno-omit-frame-pointer -pg
else
CFLAGS ?= -O2
CXXFLAGS ?= -O2
Expand Down Expand Up @@ -73,16 +73,18 @@ linux: build/libfbink.a build/libvterm.a src/_kbsend.hpp
python3 keymap.py > src/_keymap.hpp
python3 src/kblayout.py > src/_kblayout.hpp
g++ $(CPPFLAGS) $(CXXFLAGS) $(EXTRA_WARNINGS) src/main.cpp -lvterm -lfbink -o build/inkvt.host $(LDFLAGS)
ifneq ("$(DEBUG)","true")
ifndef DEBUG
strip --strip-unneeded build/inkvt.host
endif

kobo: build/fbdepth build/libfbink_kobo.a build/libvterm_kobo.a src/_kbsend.hpp
python3 keymap.py > src/_keymap.hpp
python3 src/kblayout.py > src/_kblayout.hpp
$(CROSS_TC)-g++ -DTARGET_KOBO $(CPPFLAGS) $(CXXFLAGS) $(EXTRA_WARNINGS) src/main.cpp -lvterm_kobo -lfbink_kobo -o build/inkvt.armhf $(LDFLAGS) $(STATIC_STL_FLAG)
ifndef DEBUG
$(CROSS_TC)-strip --strip-unneeded build/inkvt.armhf
upx build/inkvt.armhf || echo "install UPX for smaller executables"
endif

release: clean kobo
mkdir -p Kobo/.adds/inkvt Kobo/.adds/kfmon/config
Expand All @@ -106,19 +108,31 @@ build/libfbink.a:
mkdir -p build
make -C FBInk clean || (echo "TRY git submodule update --init --recursive" && false)
env -u CROSS_TC -u CPPFLAGS -u CFLAGS -u CXXFLAGS -u LDFLAGS -u AR -u RANLIB make -C FBInk LINUX=true MINIMAL=true FONTS=true IMAGE=true staticlib
ifdef DEBUG
cp FBInk/Debug/libfbink.a build/libfbink.a
else
cp FBInk/Release/libfbink.a build/libfbink.a
endif

build/libfbink_kobo.a:
mkdir -p build
make -C FBInk clean
make -C FBInk CROSS_TC=$(CROSS_TC) KOBO=true MINIMAL=true FONTS=true IMAGE=true staticlib
ifdef DEBUG
cp FBInk/Debug/libfbink.a build/libfbink_kobo.a
else
cp FBInk/Release/libfbink.a build/libfbink_kobo.a
endif

build/fbdepth:
mkdir -p build
make -C FBInk clean
make -C FBInk CROSS_TC=$(CROSS_TC) KOBO=true utils
ifdef DEBUG
cp FBInk/Debug/fbdepth build/fbdepth
else
cp FBInk/Release/fbdepth build/fbdepth
endif

clean:
make -C FBInk clean || (echo "TRY git submodule update --init --recursive" && false)
Expand Down