Skip to content

Commit 69b5f8c

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

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

Makefile

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,14 @@ GITREVDATE=$(shell git log -n 1 --format="%cd" --date=format:%Y%m%d-%H%M%S)
7373
# Reduces build time and binary sizes considerably.
7474
# That's only needed if you use gdb or nm.
7575
# 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)'"
76+
LDFLAGS := ""
77+
DFLAGS := ""
78+
ifeq ("$(DEBUG)", "true")
79+
DFLAGS := -gcflags="all=-N -l"
80+
else
81+
LDFLAGS := -s -w
82+
endif
83+
GOFLAGS := "-ldflags=$(LDFLAGS) -X github.com/google/syzkaller/prog.GitRevision=$(REV) -X github.com/google/syzkaller/prog.gitRevisionDate=$(GITREVDATE) $(DFLAGS)"
7784
ifneq ("$(GOTAGS)", "")
7885
GOFLAGS += " -tags=$(GOTAGS)"
7986
endif

0 commit comments

Comments
 (0)