about summary refs log tree commit diff
path: root/Makefile
diff options
context:
space:
mode:
authorHeikki Kallasjoki <fis@zem.fi>2018-12-23 13:51:46 +0000
committerHeikki Kallasjoki <fis+github@zem.fi>2018-12-23 21:50:27 +0000
commit9f9b6230dfd9ef7973641987bfd57ea7e361359a (patch)
tree4090810ced3fd70c0da07e02a942cdcd31a2e361 /Makefile
parent6d65b7fb9242eb827d5d4036f0fa8816430eb364 (diff)
downloadnano-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.
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile4
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