[url]http://www.cs.colby.edu/maxwell/courses/tutorials/maketutor/[/url]
gdb调试技巧:
[url]http://linuxtools-rst.readthedocs.org/zh_CN/latest/tool/gdb.html[/url]
IDIR =include
CC=gcc
CFLAGS=-I$(IDIR) -g
ODIR = obj
LDIR = lib
LIBS=-lm
_DEPS = vcardparser.h
DEPS = $(patsubst %, $(IDIR)/%, $(_DEPS))
_OBJ = vcardparser_main.o vcardparser.o
OBJ = $(patsubst %, $(ODIR)/%, $(_OBJ))
$(ODIR)/%.o: %.c $(DEPS)
$(CC) -c -o $@ $< $(CFLAGS)
vcardparser: $(OBJ)
$(CC) -o $@ $^ $(CFLAGS) $(LIBS)
.PHONY: clean
clean:
rm -f $(ODIR)/*.o *~core $(INCDIR)/*~
gdb调试技巧:
[url]http://linuxtools-rst.readthedocs.org/zh_CN/latest/tool/gdb.html[/url]