mirror of https://github.com/mpv-player/mpv
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.
This commit is contained in:
parent
b37a869f13
commit
2a6178e5ab
19
Makefile
19
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)
|
||||
|
|
19
common.mak
19
common.mak
|
@ -22,25 +22,14 @@ CFLAGS := -DHAVE_AV_CONFIG_H -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE \
|
|||
-I$(BUILD_ROOT_REL) -I$(SRC_PATH) -I$(SRC_PATH)/ffmpeg $(OPTFLAGS)
|
||||
|
||||
%.o: %.c
|
||||
$(CC) $(CFLAGS) $(LIBOBJFLAGS) -c -o $@ $<
|
||||
$(CC) $(CFLAGS) $(LIBOBJFLAGS) -c -o $@ -MD -MP -MF $*.d $<
|
||||
|
||||
%.o: %.S
|
||||
$(CC) $(CFLAGS) $(LIBOBJFLAGS) -c -o $@ $<
|
||||
$(CC) $(CFLAGS) $(LIBOBJFLAGS) -c -o $@ -MD -MP -MF $*.d $<
|
||||
|
||||
%.ho: %.h
|
||||
$(CC) $(CFLAGS) $(LIBOBJFLAGS) -Wno-unused -c -o $@ -x c $<
|
||||
|
||||
%.d: %.c
|
||||
$(DEPEND_CMD) > $@
|
||||
|
||||
%.d: %.S
|
||||
$(DEPEND_CMD) > $@
|
||||
|
||||
%.d: %.cpp
|
||||
$(DEPEND_CMD) > $@
|
||||
|
||||
%.o: %.d
|
||||
|
||||
%$(EXESUF): %.c
|
||||
|
||||
SVN_ENTRIES = $(SRC_PATH_BARE)/.svn/entries
|
||||
|
@ -93,9 +82,7 @@ $(SUBDIR)%-test.o: $(SUBDIR)%-test.c
|
|||
|
||||
$(SUBDIR)i386/%.o: $(SUBDIR)i386/%.asm
|
||||
$(YASM) $(YASMFLAGS) -I $$(<D)/ -o $$@ $$<
|
||||
|
||||
$(SUBDIR)i386/%.d: $(SUBDIR)i386/%.asm
|
||||
$(YASM) $(YASMFLAGS) -I $$(<D)/ -M -o $$(@:%.d=%.o) $$< > $$@
|
||||
$(YASM) $(YASMFLAGS) -I $$(<D)/ -M -o $$@ $$< > $$(@:%.o=%.d)
|
||||
|
||||
clean::
|
||||
rm -f $(TESTS) $(addprefix $(SUBDIR),$(CLEANFILES) $(CLEANSUFFIXES) $(LIBSUFFIXES)) \
|
||||
|
|
Loading…
Reference in New Issue