Skip to content

Commit

Permalink
build: use python3 to generate some files previously in git
Browse files Browse the repository at this point in the history
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
  • Loading branch information
Uoti Urpala committed Jul 16, 2012
1 parent 8657143 commit 39a45c7
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 949 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,6 @@
/TAGS
/locale
/po
/libmpdemux/ebml_defs.c
/libmpdemux/ebml_types.h
/libvo/vdpau_template.c
18 changes: 14 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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 "############################################################"
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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:
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion TOOLS/matroska.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/python3
#!/usr/bin/env python3
"""
Generate C definitions for parsing Matroska files.
Can also be used to directly parse Matroska files and display their contents.
Expand Down
2 changes: 2 additions & 0 deletions TOOLS/vdpau_functions.py
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#!/usr/bin/env python3

# Generate vdpau_template.c

functions = """
Expand Down
Loading

0 comments on commit 39a45c7

Please sign in to comment.