configure/Makefile: add option to generate pdb symbols
[fio.git] / Makefile
index b00daca2581ce273cde82924f0c4e3124d5c20b9..cc5727c3c204cd4943e2099b8614a9c8e36d9cb0 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -34,6 +34,12 @@ ifdef CONFIG_BUILD_NATIVE
   CFLAGS := -march=native $(CFLAGS)
 endif
 
+ifdef CONFIG_PDB
+  LINK_PDBFILE ?= -Wl,-pdb,$(dir $@)/$(basename $(@F)).pdb
+  CFLAGS := -gcodeview $(CFLAGS)
+  LDFLAGS += -fuse-ld=lld $(LINK_PDBFILE)
+endif
+
 ifdef CONFIG_GFIO
   PROGS += gfio
 endif