summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOlivier Blin <oblin@mandriva.com>2007-08-14 11:52:11 +0000
committerOlivier Blin <oblin@mandriva.com>2007-08-14 11:52:11 +0000
commit1dbfa356e648537f1dba65cdfa557d43c5bf9485 (patch)
tree7f8772cbfa2d5756ba7158a3edcfbb790abb5572
parent568f040bac01f12c11375a67ff59c56adc544d1a (diff)
downloaddrakx-backup-do-not-use-1dbfa356e648537f1dba65cdfa557d43c5bf9485.tar
drakx-backup-do-not-use-1dbfa356e648537f1dba65cdfa557d43c5bf9485.tar.gz
drakx-backup-do-not-use-1dbfa356e648537f1dba65cdfa557d43c5bf9485.tar.bz2
drakx-backup-do-not-use-1dbfa356e648537f1dba65cdfa557d43c5bf9485.tar.xz
drakx-backup-do-not-use-1dbfa356e648537f1dba65cdfa557d43c5bf9485.zip
make gdb debugging easier (-g, no optimization, no stripping, stdio frontend) if DEBUG is set
-rw-r--r--mdk-stage1/Makefile.common19
1 files changed, 17 insertions, 2 deletions
diff --git a/mdk-stage1/Makefile.common b/mdk-stage1/Makefile.common
index 21586cb1c..f5209a58e 100644
--- a/mdk-stage1/Makefile.common
+++ b/mdk-stage1/Makefile.common
@@ -17,9 +17,14 @@
ARCH := $(patsubst i%86,i386,$(shell uname -m))
ARCH := $(patsubst sparc%,sparc,$(ARCH))
+# DEBUG = 1
+
#- default frontend is newt (honoured by main Makefile whenever possible)
+ifdef DEBUG
+F = STDIO
+else
F = NEWT
-# F = STDIO
+endif
DIET = $(shell test -x /usr/bin/diet && echo diet)
@@ -30,8 +35,14 @@ else
L = GLIBC
endif
+ifdef DEBUG
+OPTFLAGS = -g
+else
+OPTFLAGS = -Os
+endif
+
#- flags used by all stuff
-CFLAGS = -Os -pipe -Wall -fomit-frame-pointer -fno-strict-aliasing
+CFLAGS = $(OPTFLAGS) -pipe -Wall -fomit-frame-pointer -fno-strict-aliasing
ifneq (ppc, $(ARCH))
ifneq (sparc, $(ARCH))
@@ -49,5 +60,9 @@ LDFLAGS = $($(L)_LDFLAGS)
STAGE1_LIBC = $($(L)_LIBC)
+ifdef DEBUG
+STRIPCMD = echo not stripping
+else
STRIPCMD = strip -R .note -R .comment
+endif