Makefile: move dependency rules for autogenerated files

Explicit dependency rules are needed when a source file depends on an
autogenerated file. Move these rules to the same place in the Makefile
as the rules for creating the generated files.

Also, change the rules to declare the direct dependency, not a
transitive one (e.g. codecs.conf.h is needed by codec-cfg.c, not
codec-cfg.o). In practice, this shouldn't change anything, but it's
cleaner.
This commit is contained in:
wm4 2012-07-28 18:48:59 +02:00
parent b319ae9190
commit cee35cd725
1 changed files with 5 additions and 7 deletions

View File

@ -595,23 +595,26 @@ mplayer$(EXESUF): EXTRALIBS += $(EXTRALIBS_MPLAYER)
mplayer$(EXESUF):
$(CC) -o $@ $^ $(EXTRALIBS)
codec-cfg.c: codecs.conf.h
codecs.conf.h: TOOLS/file2string.py etc/codecs.conf
./$^ >$@
libvo/vo_vdpau.c: libvo/vdpau_template.c
libvo/vdpau_template.c: TOOLS/vdpau_functions.py
./$< > $@
libmpdemux/ebml.c libmpdemux/demux_mkv.c: libmpdemux/ebml_types.h
libmpdemux/ebml_types.h: TOOLS/matroska.py
./$< --generate-header > $@
libmpdemux/ebml.c: libmpdemux/ebml_defs.c
libmpdemux/ebml_defs.c: TOOLS/matroska.py
./$< --generate-definitions > $@
libvo/vo_gl3.c: libvo/vo_gl3_shaders.h
libvo/vo_gl3_shaders.h: TOOLS/file2string.py libvo/vo_gl3_shaders.glsl
./$^ >$@
libvo/vo_gl3.c: libvo/vo_gl3_shaders.h
# ./configure must be rerun if it changed
config.mak: configure
@echo "############################################################"
@ -642,12 +645,7 @@ checkheaders: $(ALLHEADERS:.h=.ho)
###### dependency declarations / specific CFLAGS ######
# Make sure all generated header files are created.
codec-cfg.o: codecs.conf.h
mpcommon.o osdep/mplayer-rc.o: version.h
libvo/vo_vdpau.o: libvo/vdpau_template.c
libmpdemux/ebml.o libmpdemux/demux_mkv.o: libmpdemux/ebml_types.h
libmpdemux/ebml.o: libmpdemux/ebml_defs.c
# Files that depend on libavcodec internals
libmpcodecs/vf_fspp.o libmpcodecs/vf_mcdeint.o libmpcodecs/vf_spp.o: CFLAGS := -I$(FFMPEG_SOURCE_PATH) $(CFLAGS)