summaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authorUoti Urpala <uau@glyph.nonexistent.invalid>2008-12-06 04:41:45 +0200
committerUoti Urpala <uau@glyph.nonexistent.invalid>2008-12-06 05:33:33 +0200
commit2a6178e5aba3b53783ee3d36c32d3280d8ce67ac (patch)
tree9607147de2a4a09febf5e7afef3e573f0306b7e4 /Makefile
parentb37a869f130a5246d4c98f532d07b73146672c95 (diff)
downloadmpv-2a6178e5aba3b53783ee3d36c32d3280d8ce67ac.tar.bz2
mpv-2a6178e5aba3b53783ee3d36c32d3280d8ce67ac.tar.xz
Makefile, common.mak: Create .d files when creating corresponding .o
The separate .d file creation logic has caused various problems, most notably cases where 'make' exits without doing anybut but without giving any error either. Change the Makefile so that .d files are always created or updated when the corresponding .o file is. This avoids the problems of current .d file generation and still gives correct dependencies. The common.mak change does the same for the libswscale build. However it does not affect the directories under ffmpeg/ because those use ffmpeg/common.mak. The MPlayer common.mak can be copied over the ffmpeg/common.mak file to make the fix apply to the FFmpeg directories too. This is not done automatically because the FFmpeg file is under version control and changing it could cause problems.
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile19
1 files changed, 8 insertions, 11 deletions
diff --git a/Makefile b/Makefile
index 9e6e1c6dd8..a18334ba46 100644
--- a/Makefile
+++ b/Makefile
@@ -776,21 +776,18 @@ FFMPEGFILES = $(foreach part, $(PARTS), $(part)/*.[chS] ffmpeg/libavcodec/*/*.[c
all: $(ALL_PRG-yes)
-%.d: %.c
- $(MPDEPEND_CMD) > $@
+%.o: %.c
+ $(CC) $(CFLAGS) -c -o $@ -MD -MP -MF $*.d $<
-%.d: %.cpp
- $(MPDEPEND_CMD_CXX) > $@
+%.o: %.cpp
+ $(CXX) $(CFLAGS) -c -o $@ -MD -MP -MF $*.d $<
-%.d: %.m
- $(MPDEPEND_CMD) > $@
+%.o: %.m
+ $(CC) $(CFLAGS) -c -o $@ -MD -MP -MF $*.d $<
%.ho: %.h
$(CC) $(CFLAGS) -Wno-unused -c -o $@ -x c $<
-%.o: %.m
- $(CC) $(CFLAGS) -c -o $@ $<
-
%-rc.o: %.rc
$(WINDRES) -I. $< $@
@@ -837,8 +834,8 @@ version.h:
###### dependency declarations / specific CFLAGS ######
-codec-cfg.d: codecs.conf.h
-mencoder.d mplayer.d vobsub.d gui/win32/gui.d libmpdemux/muxer_avi.d osdep/mplayer-rc.o stream/network.d stream/stream_cddb.d: version.h
+codec-cfg.o: codecs.conf.h
+mencoder.o mplayer.o vobsub.o gui/win32/gui.o libmpdemux/muxer_avi.o osdep/mplayer-rc.o stream/network.o stream/stream_cddb.o: version.h
$(DEPS): help_mp.h
libdvdcss/%.o libdvdcss/%.d: CFLAGS += -D__USE_UNIX98 -D_GNU_SOURCE -DVERSION=\"1.2.9\" $(CFLAGS_LIBDVDCSS)