Commit 81d7bf7a3596ca144cf404100979064b49cebb5c

Authored by Matti Virkkunen
1 parent c88003bb

Fix make dependency handling

Showing 1 changed file with 8 additions and 12 deletions
libpurple/Makefile
... ... @@ -45,10 +45,14 @@ $(MAIN): $(OBJS) $(THRIFT_DEP)
45 45 .cpp.o:
46 46 $(CXX) $(CXXFLAGS) -std=c++11 -c $< -o $@
47 47  
48   -thrift_line: line.thrift $(THRIFT_DEP)
  48 +# The Thrift generator generates three files at once, this file shall represent them.
  49 +thrift_line/TalkService.cpp: line.thrift $(THRIFT_DEP) $@
49 50 mkdir -p thrift_line
50 51 $(THRIFT) --gen cpp -out thrift_line line.thrift
51 52  
  53 +# If the representative file exists, the others should too.
  54 +thrift_line/line_types.cpp thrift_line/line_constants.cpp: thrift_line/TalkService.cpp
  55 +
52 56 $(THRIFT):
53 57 mkdir -p $(THRIFT_STATIC_DIR)
54 58 wget -P $(THRIFT_STATIC_DIR) \
... ... @@ -66,6 +70,7 @@ $(THRIFT):
66 70  
67 71 .PHONY: clean
68 72 clean:
  73 + rm -f .depend
69 74 rm -f $(MAIN)
70 75 rm -f *.o
71 76 rm -rf thrift_line
... ... @@ -97,18 +102,9 @@ uninstall:
97 102  
98 103 depend: .depend
99 104  
100   -.depend: thrift_line $(REAL_SRCS)
101   - rm -f .depend
102   - $(CXX) $(CXXFLAGS) -MM $(REAL_SRCS) >>.depend
  105 +.depend: $(SRCS)
  106 + $(CXX) $(CXXFLAGS) -MM $(REAL_SRCS) >.depend
103 107  
104 108 ifneq ($(MAKECMDGOALS),clean)
105   -ifneq ($(MAKECMDGOALS),user-install)
106   -ifneq ($(MAKECMDGOALS),user-uninstall)
107   -ifneq ($(MAKECMDGOALS),install)
108   -ifneq ($(MAKECMDGOALS),uninstall)
109 109 -include .depend
110 110 endif
111   -endif
112   -endif
113   -endif
114   -endif
... ...