# HG changeset patch # User philipjsg # Date 1042558242 0 # Node ID f6aae828c3205312c7e928380726f54d76838c6f # Parent 65433f1b254904ab626052b5e38a33237655b523 AUtomatic dependency generation. Runs on Linux (at least). Probably should update .cvsignore (somehere) to exclude .d files diff -r 65433f1b2549 -r f6aae828c320 Makefile --- a/Makefile Sat Jan 11 20:34:38 2003 +0000 +++ b/Makefile Tue Jan 14 15:30:42 2003 +0000 @@ -50,6 +50,8 @@ LIB= $(LIBPREF)avformat$(LIBSUF) +DEPS= $(OBJS:.o=.d) + all: $(LIB) $(LIB): $(OBJS) @@ -70,9 +72,15 @@ %.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 *~ *.a $(LIB) + rm -f *.o *.d *~ *.a $(LIB)