[lxc-devel] [lxd/master] Makefile: allow debug info to be specified

frobware on Github lxc-bot at linuxcontainers.org
Mon Feb 8 22:06:39 UTC 2016


A non-text attachment was scrubbed...
Name: not available
Type: text/x-mailbox
Size: 766 bytes
Desc: not available
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20160208/a72f0044/attachment.bin>
-------------- next part --------------
From 2bedd98d2a094b33866d4a39e05f76f5abbcef49 Mon Sep 17 00:00:00 2001
From: Andrew McDermott <aim at frobware.com>
Date: Mon, 8 Feb 2016 21:56:49 +0000
Subject: [PATCH] Makefile: allow debug info to be specified

Add variable `DEBUG' that can be used to specify debug flags for the Go
tool when building either the client or the lxd.

For example:

 $ DEBUG='-gcflags "-N -l"' make

The -N flag enables debug information and -l disables compiler inlining.
Example of how to debug using lldb can be found here:

 http://ribrdb.github.io/lldb/

 http://blog.ralch.com/tutorial/golang-debug-with-lldb/

Signed-off-by: Andrew McDermott <andrew.mcdermott at canonical.com>
---
 Makefile | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/Makefile b/Makefile
index 4e7c957..b534770 100644
--- a/Makefile
+++ b/Makefile
@@ -15,7 +15,7 @@ default:
 	# Must run twice due to go get race
 	-go get -t -v -d ./...
 	-go get -t -v -d ./...
-	go install -v ./...
+	go install -v $(DEBUG) ./...
 	@echo "LXD built succesfuly"
 
 .PHONY: client
@@ -23,7 +23,7 @@ client:
 	# Must run twice due to go get race
 	-go get -t -v -d ./...
 	-go get -t -v -d ./...
-	go install -v ./lxc
+	go install -v $(DEBUG) ./lxc
 	@echo "LXD client built succesfuly"
 
 .PHONY: update


More information about the lxc-devel mailing list