summaryrefslogtreecommitdiffabout
authorLars Hjemli <hjemli@gmail.com>2010-11-07 15:13:49 (UTC)
committer Lars Hjemli <hjemli@gmail.com>2010-11-07 15:13:49 (UTC)
commit5807fb79faa49e9a8f2da616e9cc821e0198fcb7 (patch) (unidiff)
treeab36f62bc5fea3856603f6653f5c8da31233abea
parentd41b2ddcb331caa74c1a90a0253f234142848552 (diff)
downloadcgit-5807fb79faa49e9a8f2da616e9cc821e0198fcb7.zip
cgit-5807fb79faa49e9a8f2da616e9cc821e0198fcb7.tar.gz
cgit-5807fb79faa49e9a8f2da616e9cc821e0198fcb7.tar.bz2
Makefile: add -MP option
Work around errors `make` gives when header files are removed without the Makefile being updated. Signed-off-by: Lynn Lin <Lynn.Lin@emc.com> Signed-off-by: Lars Hjemli <hjemli@gmail.com>
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--Makefile2
1 files changed, 1 insertions, 1 deletions
diff --git a/Makefile b/Makefile
index dda743d..15c7c20 100644
--- a/Makefile
+++ b/Makefile
@@ -46,49 +46,49 @@ endif
46# Define a way to invoke make in subdirs quietly, shamelessly ripped 46# Define a way to invoke make in subdirs quietly, shamelessly ripped
47# from git.git 47# from git.git
48# 48#
49QUIET_SUBDIR0 = +$(MAKE) -C # space to separate -C and subdir 49QUIET_SUBDIR0 = +$(MAKE) -C # space to separate -C and subdir
50QUIET_SUBDIR1 = 50QUIET_SUBDIR1 =
51 51
52ifneq ($(findstring $(MAKEFLAGS),w),w) 52ifneq ($(findstring $(MAKEFLAGS),w),w)
53PRINT_DIR = --no-print-directory 53PRINT_DIR = --no-print-directory
54else # "make -w" 54else # "make -w"
55NO_SUBDIR = : 55NO_SUBDIR = :
56endif 56endif
57 57
58ifndef V 58ifndef V
59 QUIET_CC = @echo ' ' CC $@; 59 QUIET_CC = @echo ' ' CC $@;
60 QUIET_MM = @echo ' ' MM $@; 60 QUIET_MM = @echo ' ' MM $@;
61 QUIET_SUBDIR0 = +@subdir= 61 QUIET_SUBDIR0 = +@subdir=
62 QUIET_SUBDIR1 = ;$(NO_SUBDIR) echo ' ' SUBDIR $$subdir; \ 62 QUIET_SUBDIR1 = ;$(NO_SUBDIR) echo ' ' SUBDIR $$subdir; \
63 $(MAKE) $(PRINT_DIR) -C $$subdir 63 $(MAKE) $(PRINT_DIR) -C $$subdir
64endif 64endif
65 65
66# 66#
67# Define a pattern rule for automatic dependency building 67# Define a pattern rule for automatic dependency building
68# 68#
69%.d: %.c 69%.d: %.c
70 $(QUIET_MM)$(CC) $(CFLAGS) -MM $< | sed -e 's/\($*\)\.o:/\1.o $@:/g' >$@ 70 $(QUIET_MM)$(CC) $(CFLAGS) -MM -MP $< | sed -e 's/\($*\)\.o:/\1.o $@:/g' >$@
71 71
72# 72#
73# Define a pattern rule for silent object building 73# Define a pattern rule for silent object building
74# 74#
75%.o: %.c 75%.o: %.c
76 $(QUIET_CC)$(CC) -o $*.o -c $(CFLAGS) $< 76 $(QUIET_CC)$(CC) -o $*.o -c $(CFLAGS) $<
77 77
78 78
79EXTLIBS = git/libgit.a git/xdiff/lib.a -lz -lpthread 79EXTLIBS = git/libgit.a git/xdiff/lib.a -lz -lpthread
80OBJECTS = 80OBJECTS =
81OBJECTS += cache.o 81OBJECTS += cache.o
82OBJECTS += cgit.o 82OBJECTS += cgit.o
83OBJECTS += cmd.o 83OBJECTS += cmd.o
84OBJECTS += configfile.o 84OBJECTS += configfile.o
85OBJECTS += html.o 85OBJECTS += html.o
86OBJECTS += parsing.o 86OBJECTS += parsing.o
87OBJECTS += scan-tree.o 87OBJECTS += scan-tree.o
88OBJECTS += shared.o 88OBJECTS += shared.o
89OBJECTS += ui-atom.o 89OBJECTS += ui-atom.o
90OBJECTS += ui-blob.o 90OBJECTS += ui-blob.o
91OBJECTS += ui-clone.o 91OBJECTS += ui-clone.o
92OBJECTS += ui-commit.o 92OBJECTS += ui-commit.o
93OBJECTS += ui-diff.o 93OBJECTS += ui-diff.o
94OBJECTS += ui-log.o 94OBJECTS += ui-log.o