diff options
author | Fabrice Bellard <fabrice@bellard.org> | 2003-01-22 09:53:25 +0000 |
---|---|---|
committer | Fabrice Bellard <fabrice@bellard.org> | 2003-01-22 09:53:25 +0000 |
commit | 7c235fe23831802b60ec9d200d0811750e946f76 (patch) | |
tree | edda1d17d0682fc636c9bdbac7f7567065a78626 | |
parent | 8f0a61620dec3774798afc9ce42ff69b9e87e9e0 (diff) | |
download | ffmpeg-7c235fe23831802b60ec9d200d0811750e946f76.tar.gz |
dependency handling is consistant with libavcodec
Originally committed as revision 1490 to svn://svn.ffmpeg.org/ffmpeg/trunk
-rw-r--r-- | libavformat/Makefile | 22 | ||||
-rw-r--r-- | vhook/Makefile | 15 |
2 files changed, 21 insertions, 16 deletions
diff --git a/libavformat/Makefile b/libavformat/Makefile index 0ecdcc2cc7..897c4014dd 100644 --- a/libavformat/Makefile +++ b/libavformat/Makefile @@ -50,17 +50,20 @@ endif 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 @@ installlib: all %.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 diff --git a/vhook/Makefile b/vhook/Makefile index 5e9023a6ef..17f8411d7c 100644 --- a/vhook/Makefile +++ b/vhook/Makefile @@ -15,7 +15,10 @@ endif all: $(HOOKS) -DEPS= $(HOOKS:.so=.d) +SRCS := $(OBJS:.o=.c) + +.depend: $(SRCS) + $(CC) -MM $(CFLAGS) $^ 1>.depend install: install -s -m 755 $(HOOKS) $(INSTDIR) @@ -26,14 +29,12 @@ imlib2.so: imlib2.o %.so: %.o $(CC) -g -o $@ $(SHFLAGS) $< -%.d: %.c - @echo $@ \\ > $@ - $(CC) $(CFLAGS) -MM $< >> $@ - --include $(DEPS) - %.html: %.texi texi2html -monolithic -number $< clean: rm -f *.o *.d *.so *~ + +ifneq ($(wildcard .depend),) +include .depend +endif |