From 39a45c7a175acf7ef5546073f62f5b9b7f83a893 Mon Sep 17 00:00:00 2001 From: Uoti Urpala Date: Mon, 2 Jul 2012 02:09:03 +0300 Subject: build: use python3 to generate some files previously in git Some files used during build are generated with Python scripts in TOOLS/. Before, the generated files were included in the git tree. Start creating them at build time. This introduces a build-dependency on python3. The files in question are: libvo/vdpau_template.c libmpdemux/ebml_types.h libmpdemux/ebml_defs.c --- Makefile | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index eb81564ce0..f90aa5e906 100644 --- a/Makefile +++ b/Makefile @@ -598,6 +598,15 @@ codec-cfg$(EXESUF): codec-cfg.c codec-cfg.h codecs.conf.h: codec-cfg$(EXESUF) etc/codecs.conf ./$^ > $@ +libvo/vdpau_template.c: TOOLS/vdpau_functions.py + ./$< > $@ + +libmpdemux/ebml_types.h: TOOLS/matroska.py + ./$< --generate-header > $@ + +libmpdemux/ebml_defs.c: TOOLS/matroska.py + ./$< --generate-definitions > $@ + # ./configure must be rerun if it changed config.mak: configure @echo "############################################################" @@ -631,6 +640,9 @@ checkheaders: $(ALLHEADERS:.h=.ho) # 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) @@ -702,6 +714,8 @@ distclean: clean testsclean toolsclean driversclean -$(RM) -r locale -$(RM) $(call ADD_ALL_DIRS,/*.d) -$(RM) config.log config.mak config.h codecs.conf.h version.h TAGS tags + -$(RM) libvo/vdpau_template.c + -$(RM) libmpdemux/ebml_types.h libmpdemux/ebml_defs.c -$(RM) $(call ADD_ALL_EXESUFS,codec-cfg cpuinfo) doxygen: @@ -713,10 +727,6 @@ TAGS: tags: $(RM) $@; find . -name '*.[chS]' -o -name '*.asm' | xargs ctags -a -generated_ebml: - TOOLS/matroska.py --generate-header >libmpdemux/ebml_types.h - TOOLS/matroska.py --generate-definitions >libmpdemux/ebml_defs.c - ###### tests / tools ####### TEST_OBJS = mp_msg.o mp_fifo.o osdep/$(GETCH) osdep/$(TIMER) -ltermcap -lm -- cgit v1.2.3 From 2ba8b91a97e7e873a522f365e41a293af980c91a Mon Sep 17 00:00:00 2001 From: Uoti Urpala Date: Mon, 2 Jul 2012 02:35:57 +0300 Subject: build, codec-cfg.c: simplify builtin codecs.conf handling The player can read codec mapping (codecs.conf) from an external file or use embedded defaults. Before, the defaults were stored in the player binary in the form of final already-parsed data structures. Simplify things by storing the text of the codecs.conf file instead, and parse that at runtime the same way an external file would be parsed. To create the previous parsed form, the build system first compiled a separate binary named "codec-cfg", which parsed etc/codecs.conf and then wrote the results as a C data structure that could be compiled into the program. The new simple conversion of codecs.conf into a C string is handled by the new script TOOLS/file2string.py. After removing the codec-cfg binary, HOST_CC is no longer used for anything. Remove the --host-cc configure option and associated logic. Also remove the codec2html and codec-cfg-test functionality. Building those was already broken and nobody cared. There was a broken 3-character-long "fourcc" entry in etc/codecs.conf. This happened to be accepted before but triggered a parse error after the changes. Remove the broken entry and make the parsing functions explicitly test for this error. --- Makefile | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index f90aa5e906..871beb782e 100644 --- a/Makefile +++ b/Makefile @@ -592,11 +592,8 @@ mplayer$(EXESUF): EXTRALIBS += $(EXTRALIBS_MPLAYER) mplayer$(EXESUF): $(CC) -o $@ $^ $(EXTRALIBS) -codec-cfg$(EXESUF): codec-cfg.c codec-cfg.h - $(HOST_CC) -O -DCODECS2HTML -I. -o $@ $< - -codecs.conf.h: codec-cfg$(EXESUF) etc/codecs.conf - ./$^ > $@ +codecs.conf.h: TOOLS/file2string.py etc/codecs.conf + ./$^ >$@ libvo/vdpau_template.c: TOOLS/vdpau_functions.py ./$< > $@ @@ -716,7 +713,7 @@ distclean: clean testsclean toolsclean driversclean -$(RM) config.log config.mak config.h codecs.conf.h version.h TAGS tags -$(RM) libvo/vdpau_template.c -$(RM) libmpdemux/ebml_types.h libmpdemux/ebml_defs.c - -$(RM) $(call ADD_ALL_EXESUFS,codec-cfg cpuinfo) + -$(RM) $(call ADD_ALL_EXESUFS,cpuinfo) doxygen: doxygen DOCS/tech/Doxyfile @@ -731,18 +728,12 @@ tags: TEST_OBJS = mp_msg.o mp_fifo.o osdep/$(GETCH) osdep/$(TIMER) -ltermcap -lm -codec-cfg-test$(EXESUF): codec-cfg.c codecs.conf.h $(TEST_OBJS) - $(CC) -I. -DTESTING -o $@ $^ - -codecs2html$(EXESUF): codec-cfg.c $(TEST_OBJS) - $(CC) -I. -DCODECS2HTML -o $@ $^ - LOADER_TEST_OBJS = $(SRCS_WIN32_EMULATION:.c=.o) $(SRCS_QTX_EMULATION:.S=.o) libavutil/libavutil.a osdep/mmap_anon.o cpudetect.o path.o $(TEST_OBJS) loader/qtx/list$(EXESUF) loader/qtx/qtxload$(EXESUF): CFLAGS += -g loader/qtx/list$(EXESUF) loader/qtx/qtxload$(EXESUF): $(LOADER_TEST_OBJS) -TESTS = codecs2html codec-cfg-test +TESTS = ifdef ARCH_X86 TESTS += loader/qtx/list loader/qtx/qtxload -- cgit v1.2.3 From d9c1577c4e62d0a76aa67070ec5da3484aa3abf6 Mon Sep 17 00:00:00 2001 From: Uoti Urpala Date: Sat, 14 Jul 2012 07:32:57 +0300 Subject: Makefile: delete .d files in "clean" target too Previously, .d files were only deleted by "distclean" target. I see no reason why they should be kept by "clean". Delete them in that target too. --- Makefile | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 871beb782e..d1ce8dd532 100644 --- a/Makefile +++ b/Makefile @@ -702,14 +702,13 @@ uninstall: $(RM) $(foreach lang,$(MSG_LANGS),$(LOCALEDIR)/$(lang)/LC_MESSAGES/mplayer.1) clean: - -$(RM) $(call ADD_ALL_DIRS,/*.o /*.a /*.ho /*~) + -$(RM) $(call ADD_ALL_DIRS,/*.o /*.d /*.a /*.ho /*~) -$(RM) $(call ADD_ALL_EXESUFS,mplayer) -$(RM) $(MOFILES) distclean: clean testsclean toolsclean driversclean -$(RM) -r DOCS/tech/doxygen -$(RM) -r locale - -$(RM) $(call ADD_ALL_DIRS,/*.d) -$(RM) config.log config.mak config.h codecs.conf.h version.h TAGS tags -$(RM) libvo/vdpau_template.c -$(RM) libmpdemux/ebml_types.h libmpdemux/ebml_defs.c -- cgit v1.2.3