yjftsjthsd-g / keynav

retire your mouse.
Other
18 stars 3 forks source link

Add targets for debug and release builds #5

Closed yjftsjthsd-g closed 7 years ago

yjftsjthsd-g commented 7 years ago

Currently, the Makefile generates a binary that is not stripped and apparently has some level of debugging info present, but isn't built with -g or anything. There are commented-out flags for both adding more debugging info to the binary and for building with -O2, but none of them are active. This issue is to add release and debug targets that will respectively build a stripped and optimized binary, or one with debugging explicitly supported. One possible method is discussed on this Stack Overflow post but it is unclear that this is portable or specific to GNU Make. Bonus points for being able to build a static release binary.

yjftsjthsd-g commented 7 years ago

Addressed in bcf25531838df6eddf5d6bf79f50c2f711f875ea (which is still experimental and needs testing).

yjftsjthsd-g commented 7 years ago

I've tested the above commit on Linux, FreeBSD, gcc, clang, glibc, musl, and some (but not all) combinations thereof. Everything works.

Resolution: By default, make all builds a release version of keynav, optimized and stripped. If you need a debug version, use make debug. Note that I've commented out -pg (adds some profiling info) and the associated LDFLAGS+=-lrt even in debug builds, as it's not portable to all supported platforms. If you need it just uncomment those lines.