Commit 77b71ddc authored by Philip Gladstone's avatar Philip Gladstone

AUtomatic dependency generation. Runs on Linux (at least). Probably should

update .cvsignore (somehere) to exclude .d files

Originally committed as revision 1459 to svn://svn.ffmpeg.org/ffmpeg/trunk
parent cb7c98d6
...@@ -54,9 +54,12 @@ endif ...@@ -54,9 +54,12 @@ endif
OBJS = ffmpeg.o ffserver.o OBJS = ffmpeg.o ffserver.o
SRCS = $(OBJS:.o=.c) $(ASM_OBJS:.o=.s) SRCS = $(OBJS:.o=.c) $(ASM_OBJS:.o=.s)
DEPS = $(OBJS:.o=.d)
all: lib $(PROG) $(VHOOK) all: lib $(PROG) $(VHOOK)
-include $(DEPS)
lib: lib:
$(MAKE) -C libavcodec all $(MAKE) -C libavcodec all
$(MAKE) -C libavformat all $(MAKE) -C libavformat all
...@@ -80,6 +83,10 @@ ffplay: ffmpeg$(EXE) ...@@ -80,6 +83,10 @@ ffplay: ffmpeg$(EXE)
%.o: %.c %.o: %.c
$(CC) $(CFLAGS) -c -o $@ $< $(CC) $(CFLAGS) -c -o $@ $<
%.d: %.c
@echo $@ \\ > $@
$(CC) $(CFLAGS) -MM $< >> $@
videohook: videohook:
$(MAKE) -C vhook all $(MAKE) -C vhook all
...@@ -108,7 +115,7 @@ clean: $(CLEANVHOOK) ...@@ -108,7 +115,7 @@ clean: $(CLEANVHOOK)
$(MAKE) -C libavcodec clean $(MAKE) -C libavcodec clean
$(MAKE) -C libavformat clean $(MAKE) -C libavformat clean
$(MAKE) -C tests clean $(MAKE) -C tests clean
rm -f *.o *~ .depend gmon.out TAGS ffmpeg_g$(EXE) $(PROG) rm -f *.o *.d *~ .depend gmon.out TAGS ffmpeg_g$(EXE) $(PROG)
clean-vhook: clean-vhook:
$(MAKE) -C vhook clean $(MAKE) -C vhook clean
......
...@@ -89,6 +89,7 @@ OBJS += ppc/dsputil_altivec.o ppc/mpegvideo_altivec.o ppc/idct_altivec.o \ ...@@ -89,6 +89,7 @@ OBJS += ppc/dsputil_altivec.o ppc/mpegvideo_altivec.o ppc/idct_altivec.o \
endif endif
SRCS := $(OBJS:.o=.c) $(ASM_OBJS:.o=.S) SRCS := $(OBJS:.o=.c) $(ASM_OBJS:.o=.S)
DEPS := $(OBJS:.o=.d)
OBJS := $(OBJS) $(ASM_OBJS) OBJS := $(OBJS) $(ASM_OBJS)
LIB= $(LIBPREF)avcodec$(LIBSUF) LIB= $(LIBPREF)avcodec$(LIBSUF)
...@@ -116,6 +117,12 @@ dsputil.o: dsputil.c dsputil.h ...@@ -116,6 +117,12 @@ dsputil.o: dsputil.c dsputil.h
%.o: %.c %.o: %.c
$(CC) $(CFLAGS) -c -o $@ $< $(CC) $(CFLAGS) -c -o $@ $<
%.d: %.c
@echo $@ \\ > $@
$(CC) $(CFLAGS) -MM $< >> $@
-include $(DEPS)
%.o: %.S %.o: %.S
$(CC) $(CFLAGS) -c -o $@ $< $(CC) $(CFLAGS) -c -o $@ $<
...@@ -137,7 +144,7 @@ depend: ...@@ -137,7 +144,7 @@ depend:
$(CC) -MM $(CFLAGS) $(SRCS) 1>.depend $(CC) -MM $(CFLAGS) $(SRCS) 1>.depend
clean: clean:
rm -f *.o *~ .depend $(LIB) $(SLIB) *.so i386/*.o i386/*~ \ rm -f *.o *.d *~ .depend $(LIB) $(SLIB) *.so i386/*.o i386/*~ \
armv4l/*.o armv4l/*~ \ armv4l/*.o armv4l/*~ \
mlib/*.o mlib/*~ \ mlib/*.o mlib/*~ \
alpha/*.o alpha/*~ \ alpha/*.o alpha/*~ \
......
...@@ -50,6 +50,8 @@ endif ...@@ -50,6 +50,8 @@ endif
LIB= $(LIBPREF)avformat$(LIBSUF) LIB= $(LIBPREF)avformat$(LIBSUF)
DEPS= $(OBJS:.o=.d)
all: $(LIB) all: $(LIB)
$(LIB): $(OBJS) $(LIB): $(OBJS)
...@@ -70,9 +72,15 @@ installlib: all ...@@ -70,9 +72,15 @@ installlib: all
%.o: %.c %.o: %.c
$(CC) $(CFLAGS) -c -o $@ $< $(CC) $(CFLAGS) -c -o $@ $<
%.d: %.c
@echo $@ \\ > $@
$(CC) $(CFLAGS) -MM $< >> $@
-include $(DEPS)
# BeOS: remove -Wall to get rid of all the "multibyte constant" warnings # BeOS: remove -Wall to get rid of all the "multibyte constant" warnings
%.o: %.cpp %.o: %.cpp
g++ $(subst -Wall,,$(CFLAGS)) -c -o $@ $< g++ $(subst -Wall,,$(CFLAGS)) -c -o $@ $<
clean: clean:
rm -f *.o *~ *.a $(LIB) rm -f *.o *.d *~ *.a $(LIB)
...@@ -15,18 +15,25 @@ endif ...@@ -15,18 +15,25 @@ endif
all: $(HOOKS) all: $(HOOKS)
DEPS= $(HOOKS:.so=.d)
install: install:
install -s -m 755 $(HOOKS) $(INSTDIR) install -s -m 755 $(HOOKS) $(INSTDIR)
imlib2.so: imlib2.o imlib2.so: imlib2.o
$(CC) -g -o $@ $(SHFLAGS) $< -lImlib2 $(CC) -g -o $@ $(SHFLAGS) $< -lImlib2
rm $<
%.so: %.o %.so: %.o
$(CC) -g -o $@ $(SHFLAGS) $< $(CC) -g -o $@ $(SHFLAGS) $<
%.d: %.c
@echo $@ \\ > $@
$(CC) $(CFLAGS) -MM $< >> $@
-include $(DEPS)
%.html: %.texi %.html: %.texi
texi2html -monolithic -number $< texi2html -monolithic -number $<
clean: clean:
rm -f *.o *.so *~ rm -f *.o *.d *.so *~
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment