Skip to content

Commit f729663

Browse files
committed
Makefile: add DEBUG=true env to enable debug symbols
1 parent dbf35fa commit f729663

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

Makefile

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,11 +69,16 @@ else
6969
endif
7070
GITREVDATE=$(shell git log -n 1 --format="%cd" --date=format:%Y%m%d-%H%M%S)
7171

72+
GOFLAGS := "-ldflags=-X github.com/google/syzkaller/prog.GitRevision=$(REV) -X 'github.com/google/syzkaller/prog.gitRevisionDate=$(GITREVDATE)'"
73+
ifeq ("$(DEBUG)","true")
74+
GOFLAGS += -gcflags="all=-N -l"
75+
else
7276
# Don't generate symbol table and DWARF debug info.
7377
# Reduces build time and binary sizes considerably.
7478
# That's only needed if you use gdb or nm.
75-
# If you need that, build manually without these flags.
76-
GOFLAGS := "-ldflags=-s -w -X github.com/google/syzkaller/prog.GitRevision=$(REV) -X 'github.com/google/syzkaller/prog.gitRevisionDate=$(GITREVDATE)'"
79+
# If you need that, build manually with DEBUG=true env.
80+
GOFLAGS += -ldflags=-s -w
81+
endif
7782
ifneq ("$(GOTAGS)", "")
7883
GOFLAGS += " -tags=$(GOTAGS)"
7984
endif

0 commit comments

Comments
 (0)