~smlavine/navipage

b8fb6db0f1f643ca60a267ce9e04556c0ac0b1d1 — Sebastian LaVine 9 months ago cfa6272
Enable debug builds when DEBUG=1
2 files changed, 7 insertions(+), 6 deletions(-)

M README.md
M config.mk
M README.md => README.md +2 -2
@@ 25,8 25,8 @@ needs.

## Debugging

To compile with debug symbols, uncomment the line defining DEBUGFLAGS in
config.mk. Then ```make``` as usual. Line numbers and the like will be
To compile with debug symbols, set ```DEBUG``` before running
```make```, like ```DEBUG=1 make```. Line numbers and the like will be
present when debugging with tools like ```gdb ./navipage``` or
```valgrind --leak-check=full --log-file=errors ./navipage```.


M config.mk => config.mk +5 -4
@@ 9,12 9,13 @@ MANPREFIX = $(PREFIX)/share/man
INCS = -I$(PREFIX)/include
LIBS = -lreadline

#uncomment for debugging
#DEBUGFLAGS = -ggdb -Og

# flags
CPPFLAGS = $(INCS) -D_POSIX_C_SOURCE=200809L -DVERSION=\"$(VERSION)\"
CFLAGS = -std=c99 -Wall -Wextra -Wpedantic $(DEBUGFLAGS)
DEBUGFLAGS = -ggdb -Og
CFLAGS = -std=c99 -Wall -Wextra -Wpedantic
ifdef DEBUG
	CFLAGS += $(DEBUGFLAGS)
endif
LDFLAGS = -L$(PREFIX)/lib $(LIBS)

# compiler and linker