diff options
author | Heikki Kallasjoki <fis@zem.fi> | 2018-12-23 13:51:46 +0000 |
---|---|---|
committer | Heikki Kallasjoki <fis+github@zem.fi> | 2018-12-23 21:50:27 +0000 |
commit | 9f9b6230dfd9ef7973641987bfd57ea7e361359a (patch) | |
tree | 4090810ced3fd70c0da07e02a942cdcd31a2e361 | |
parent | 6d65b7fb9242eb827d5d4036f0fa8816430eb364 (diff) | |
download | nano-exporter-9f9b6230dfd9ef7973641987bfd57ea7e361359a.tar.gz nano-exporter-9f9b6230dfd9ef7973641987bfd57ea7e361359a.tar.xz nano-exporter-9f9b6230dfd9ef7973641987bfd57ea7e361359a.zip |
Add Makefile support for compiling for debugging.
Adding DEBUG=1 (or any nonempty string) will swap the `-Os` flag into `-g`, and not strip the resulting binary.
-rw-r--r-- | Makefile | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Makefile b/Makefile index c4b0fc6..1e90a68 100644 --- a/Makefile +++ b/Makefile @@ -27,8 +27,8 @@ COLLECTORS += uname # compile settings -CFLAGS = -std=c11 -Wall -Wextra -pedantic -Wno-format-truncation -Os -LDFLAGS = -Os -s +CFLAGS = -std=c11 -Wall -Wextra -pedantic -Wno-format-truncation $(if $(DEBUG),-g,-Os) +LDFLAGS = $(if $(DEBUG),-g,-Os -s) # build rules |