Revision caec74dd common.mak

View differences:

common.mak
24 24
%.ho: %.h
25 25
	$(CC) $(CFLAGS) $(LIBOBJFLAGS) -Wno-unused -c -o $@ -x c $<
26 26

  
27
%.d: %.c
28
	$(DEPEND_CMD) > $@
29

  
30
%.d: %.S
31
	$(DEPEND_CMD) > $@
32

  
33
%.d: %.cpp
34
	$(DEPEND_CMD) > $@
35

  
27 36
install: install-libs install-headers
28 37

  
29 38
uninstall: uninstall-libs uninstall-headers
......
51 60
ALLHEADERS := $(subst $(SRC_DIR)/,$(SUBDIR),$(wildcard $(SRC_DIR)/*.h))
52 61
checkheaders: $(filter-out %_template.ho,$(ALLHEADERS:.h=.ho))
53 62

  
54
depend dep: $(SUBDIR).depend
63
DEPS := $(OBJS:.o=.d)
64
depend dep: $(DEPS)
55 65

  
56 66
CLEANFILES += *.o *~ *.a *.lib *.so *.so.* *.dylib *.dll \
57 67
              *.def *.dll.a *.exp *.ho *.map
......
63 73
$(SUBDIR)%-test$(EXESUF): $(SUBDIR)%.c $(LIBNAME)
64 74
	$(CC) $(CFLAGS) $(FFLDFLAGS) -DTEST -o $$@ $$^ $(FFEXTRALIBS)
65 75

  
66
$(SUBDIR).depend: $(SRCS)
67
	$(DEPEND_CMD) > $$@
68

  
69 76
clean::
70 77
	rm -f $(TESTS) $(addprefix $(SUBDIR),$(CLEANFILES))
71 78

  
72 79
distclean:: clean
73
	rm -f $(SUBDIR).depend
80
	rm -f $(DEPS)
74 81
endef
75 82

  
76 83
$(eval $(RULES))
77 84

  
78 85
tests: $(TESTS)
79 86

  
80
-include $(SUBDIR).depend
87
-include $(DEPS)

Also available in: Unified diff