build: move mpcommon.c to version.c

mpcommon.c used to be the only file to include version.h. version.h is
generated by the build system, and contains the git revision. Any time
a commit is made (or the tree is rebased etc.), the file is rewritten,
and mpcommon.c rebuilt. To make rebuilding less annoying, the definition
of the version string is the only thing in mpcommon.c.

Since I want to add other things to mpcommon.c, add a new file named
version.c, that takes over mpcommon.c's role as described above.
mpcommon.c doesn't include version.h anymore, and will be used to park
code that doesn't really belong anywhere else.
This commit is contained in:
wm4 2012-09-01 21:32:03 +02:00
parent e47b779bfc
commit 5a13f5a5e8
3 changed files with 23 additions and 5 deletions

View File

@ -106,6 +106,7 @@ SRCS_COMMON = asxparser.c \
m_struct.c \
mp_msg.c \
mpcommon.c \
version.c \
parser-cfg.c \
path.c \
playlist.c \
@ -446,7 +447,7 @@ checkheaders: $(ALLHEADERS:.h=.ho)
###### dependency declarations / specific CFLAGS ######
mpcommon.o osdep/mplayer-rc.o: version.h
version.c osdep/mplayer-rc.o: version.h
# Files that depend on libavcodec internals
libmpcodecs/vf_fspp.o libmpcodecs/vf_mcdeint.o libmpcodecs/vf_spp.o: CFLAGS := -I$(FFMPEG_SOURCE_PATH) $(CFLAGS)

View File

@ -15,7 +15,3 @@
* with MPlayer; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#include "version.h"
const char *mplayer_version = "mplayer " VERSION;

21
version.c Normal file
View File

@ -0,0 +1,21 @@
/*
* This file is part of MPlayer.
*
* MPlayer is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* MPlayer is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with MPlayer; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#include "version.h"
const char *mplayer_version = "mplayer " VERSION;