Some Makefile improvements:
authorMichael Vrable <mvrable@cs.ucsd.edu>
Sun, 24 Dec 2006 01:21:10 +0000 (17:21 -0800)
committerMichael Vrable <mvrable@beleg.ucsd.edu>
Sun, 24 Dec 2006 01:21:10 +0000 (17:21 -0800)
  - (Mostly) automatic header dependency tracking.
  - Use pkg-config to pull in dependencies for libuuid.

Makefile

index 1822adc..141ce9c 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,7 +1,17 @@
-CXXFLAGS=-O -Wall -D_FILE_OFFSET_BITS=64 -g
-LDFLAGS=-g
+PACKAGES=uuid
+CXXFLAGS=-O -Wall -D_FILE_OFFSET_BITS=64 -g -pg \
+        `pkg-config --cflags $(PACKAGES)`
+LDFLAGS=-g -pg `pkg-config --libs $(PACKAGES)`
 
-OBJS=scandir.o sha1.o store.o
+SRCS=scandir.cc sha1.cc store.cc
+OBJS=$(SRCS:.cc=.o)
 
 scandir : $(OBJS)
        $(CXX) $(LDFLAGS) -o $@ $^
+
+dep:
+       touch Makefile.dep
+       makedepend -fMakefile.dep $(SRCS)
+
+-include *.dep
+