From 1e6ec3b83e2027b0183d0e89eb1003d24fe9c7cb Mon Sep 17 00:00:00 2001 From: Michel Machado Date: Thu, 14 Aug 2014 09:31:05 -0400 Subject: [PATCH] Improve Makefile for debugging code - Addopt -ggdb to add debugging information to binary. - Add cscope target to help navigating the code. - Add cscope.out to .gitignore. - Add *.swp to .gitignore. --- .gitignore | 3 +++ Makefile | 9 ++++++--- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index 9f8b814..219b7ed 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,6 @@ +cscope.out + +*.swp *.d *.o *~ diff --git a/Makefile b/Makefile index e70d93c..ea240d9 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,5 @@ CC ?= gcc -CFLAGS += -std=c99 -Wall -Wextra -pedantic -MMD +CFLAGS += -std=c99 -Wall -Wextra -pedantic -MMD -ggdb TARGETS = f3write f3read EXPERIMENTAL_TARGETS = f3probe @@ -18,7 +18,10 @@ f3probe: libprobe.o f3probe.o -include *.d -PHONY: clean +PHONY: cscope clean + +cscope: + cscope -b *.c *.h clean: - rm -f *.o *.d $(TARGETS) $(EXPERIMENTAL_TARGETS) + rm -f *.o *.d cscope.out $(TARGETS) $(EXPERIMENTAL_TARGETS)