summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authornorly <ny-git@enpas.org>2013-02-11 01:08:31 +0000
committernorly <ny-git@enpas.org>2013-02-11 01:24:36 +0000
commite0510e4c926c48e89aee352ac09af007d1bec5d1 (patch)
tree09e8068057f8ca10d950198b523a890d81620f1d /Makefile
parent66665f1c62163546617a42617db485ed6d5e214f (diff)
Makefile: debug option - attach to running instance
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile4
1 files changed, 4 insertions, 0 deletions
diff --git a/Makefile b/Makefile
index df5f59f..726b92a 100644
--- a/Makefile
+++ b/Makefile
@@ -21,6 +21,10 @@ LDFLAGS := -lelf
default: $(EXE)
+.PHONY: debug
+debug: $(EXE)
+ gdb $(EXE) $(shell ps -e | sed "s/^ *\([0-9]\+\) .*$(PROJ).*$$/\1/g;te;d;:e")
+
$(EXE): $(OBJS)
@if [ ! -d $(BUILDDIR) ] ; then echo "Error: Build dir '$(BUILDDIR)' does not exist." ; false ; fi