From 2a6178e5aba3b53783ee3d36c32d3280d8ce67ac Mon Sep 17 00:00:00 2001 From: Uoti Urpala Date: Sat, 6 Dec 2008 04:41:45 +0200 Subject: 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. --- Makefile | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) (limited to 'Makefile') 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) -- cgit v1.2.3