changeset 26:ec4e7f9b4515 libavformat

dependency handling is consistant with libavcodec
author bellard
date Wed, 22 Jan 2003 09:53:25 +0000
parents bceee17e8d75
children fcdea3df94fe
files Makefile
diffstat 1 files changed, 13 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/Makefile	Fri Jan 17 09:22:52 2003 +0000
+++ b/Makefile	Wed Jan 22 09:53:25 2003 +0000
@@ -50,17 +50,20 @@
 
 LIB= $(LIBPREF)avformat$(LIBSUF)
 
-DEPS= $(OBJS:.o=.d)
+SRCS := $(OBJS:.o=.c)
 
 all: $(LIB)
 
-$(LIB): $(OBJS)
+$(LIB): .depend $(OBJS)
 	rm -f $@
 	$(AR) rc $@ $(OBJS)
 ifneq ($(CONFIG_OS2),yes)
 	$(RANLIB) $@
 endif
 
+.depend: $(SRCS)
+	$(CC) -MM $(CFLAGS) $^ 1>.depend
+
 installlib: all
 	install -m 644 $(LIB) $(prefix)/lib
 	mkdir -p $(prefix)/include/ffmpeg
@@ -72,15 +75,16 @@
 %.o: %.c
 	$(CC) $(CFLAGS) -c -o $@ $< 
 
-%.d: %.c
-	@echo $@ \\ > $@
-	$(CC) $(CFLAGS) -MM $< >> $@
-
--include $(DEPS)        
-
 # BeOS: remove -Wall to get rid of all the "multibyte constant" warnings
 %.o: %.cpp
 	g++ $(subst -Wall,,$(CFLAGS)) -c -o $@ $< 
 
 clean: 
-	rm -f *.o *.d *~ *.a $(LIB)
+	rm -f *.o *.d .depend *~ *.a $(LIB)
+
+#
+# include dependency files if they exist
+#
+ifneq ($(wildcard .depend),)
+include .depend
+endif