build: change filenames of generated files

Force them into a more consistent naming schema.
This commit is contained in:
wm4 2019-06-22 00:03:31 +02:00
parent c67f36dd18
commit 07b0c18bad
15 changed files with 54 additions and 69 deletions

View File

@ -16,7 +16,7 @@
*/ */
#include "common.h" #include "common.h"
#include "version.h" #include "generated/version.h"
#ifdef NO_BUILD_TIMESTAMPS #ifdef NO_BUILD_TIMESTAMPS
#undef BUILDDATE #undef BUILDDATE
#define BUILDDATE "UNKNOWN" #define BUILDDATE "UNKNOWN"

View File

@ -224,7 +224,7 @@ int ebml_resync_cluster(struct mp_log *log, stream_t *s)
#define E_S(str, count) EVALARGS(E_SN, str, count, N) #define E_S(str, count) EVALARGS(E_SN, str, count, N)
#define FN(id, name, multiple, N) { id, multiple, offsetof(struct ebml_ ## N, name), offsetof(struct ebml_ ## N, n_ ## name), &ebml_##name##_desc}, #define FN(id, name, multiple, N) { id, multiple, offsetof(struct ebml_ ## N, name), offsetof(struct ebml_ ## N, n_ ## name), &ebml_##name##_desc},
#define F(id, name, multiple) EVALARGS(FN, id, name, multiple, N) #define F(id, name, multiple) EVALARGS(FN, id, name, multiple, N)
#include "ebml_defs.c" #include "generated/ebml_defs.c"
#undef EVALARGS #undef EVALARGS
#undef SN #undef SN
#undef S #undef S

View File

@ -63,7 +63,7 @@ struct ebml_parse_ctx {
bool no_error_messages; bool no_error_messages;
}; };
#include "ebml_types.h" #include "generated/ebml_types.h"
#define EBML_ID_INVALID 0xffffffff #define EBML_ID_INVALID 0xffffffff

View File

@ -224,7 +224,7 @@ const struct m_sub_options input_config = {
}; };
static const char builtin_input_conf[] = static const char builtin_input_conf[] =
#include "input/input_conf.h" #include "generated/etc/input.conf.inc"
; ;
static bool test_rect(struct mp_rect *rc, int x, int y) static bool test_rect(struct mp_rect *rc, int x, int y)

View File

@ -143,7 +143,7 @@ static void terminate_cocoa_application(void)
} }
static const char macosx_icon[] = static const char macosx_icon[] =
#include "osdep/macosx_icon.inc" #include "generated/TOOLS/osxbundle/mpv.app/Contents/Resources/icon.icns.inc"
; ;
- (NSImage *)getMPVIcon - (NSImage *)getMPVIcon

View File

@ -16,7 +16,7 @@
*/ */
#include <winver.h> #include <winver.h>
#include "version.h" #include "generated/version.h"
VS_VERSION_INFO VERSIONINFO VS_VERSION_INFO VERSIONINFO
FILEVERSION 2, 0, 0, 0 FILEVERSION 2, 0, 0, 0

View File

@ -51,7 +51,7 @@
// All these are generated from player/javascript/*.js // All these are generated from player/javascript/*.js
static const char *const builtin_files[][3] = { static const char *const builtin_files[][3] = {
{"@/defaults.js", {"@/defaults.js",
# include "player/javascript/defaults.js.inc" # include "generated/player/javascript/defaults.js.inc"
}, },
{0} {0}
}; };

View File

@ -57,22 +57,22 @@
// All these are generated from player/lua/*.lua // All these are generated from player/lua/*.lua
static const char * const builtin_lua_scripts[][2] = { static const char * const builtin_lua_scripts[][2] = {
{"mp.defaults", {"mp.defaults",
# include "player/lua/defaults.inc" # include "generated/player/lua/defaults.lua.inc"
}, },
{"mp.assdraw", {"mp.assdraw",
# include "player/lua/assdraw.inc" # include "generated/player/lua/assdraw.lua.inc"
}, },
{"mp.options", {"mp.options",
# include "player/lua/options.inc" # include "generated/player/lua/options.lua.inc"
}, },
{"@osc.lua", {"@osc.lua",
# include "player/lua/osc.inc" # include "generated/player/lua/osc.lua.inc"
}, },
{"@ytdl_hook.lua", {"@ytdl_hook.lua",
# include "player/lua/ytdl_hook.inc" # include "generated/player/lua/ytdl_hook.lua.inc"
}, },
{"@stats.lua", {"@stats.lua",
# include "player/lua/stats.inc" # include "generated/player/lua/stats.lua.inc"
}, },
{"@console.lua", {"@console.lua",
# include "player/lua/console.inc" # include "player/lua/console.inc"

View File

@ -66,7 +66,7 @@
#include "screenshot.h" #include "screenshot.h"
static const char def_config[] = static const char def_config[] =
#include "player/builtin_conf.inc" #include "generated/etc/builtin.conf.inc"
; ;
#if HAVE_COCOA #if HAVE_COCOA

View File

@ -31,7 +31,7 @@
#include "osd_state.h" #include "osd_state.h"
static const char osd_font_pfb[] = static const char osd_font_pfb[] =
#include "sub/osd_font.h" #include "generated/sub/osd_font.otf.inc"
; ;
#include "sub/ass_mp.h" #include "sub/ass_mp.h"

View File

@ -163,7 +163,7 @@ static void disable_power_management(struct vo_cocoa_state *s)
} }
static const char macosx_icon[] = static const char macosx_icon[] =
#include "osdep/macosx_icon.inc" #include "generated/TOOLS/osxbundle/mpv.app/Contents/Resources/icon.icns.inc"
; ;
static void set_application_icon(NSApplication *app) static void set_application_icon(NSApplication *app)

View File

@ -31,16 +31,16 @@
#include "wayland_common.h" #include "wayland_common.h"
// Generated from xdg-shell.xml // Generated from xdg-shell.xml
#include "video/out/wayland/xdg-shell.h" #include "generated/wayland/xdg-shell.h"
// Generated from idle-inhibit-unstable-v1.xml // Generated from idle-inhibit-unstable-v1.xml
#include "video/out/wayland/idle-inhibit-v1.h" #include "generated/wayland/idle-inhibit-v1.h"
// Generated from xdg-decoration-unstable-v1.xml // Generated from xdg-decoration-unstable-v1.xml
#include "video/out/wayland/xdg-decoration-v1.h" #include "generated/wayland/xdg-decoration-v1.h"
// Generated from presentation-time.xml // Generated from presentation-time.xml
#include "video/out/wayland/presentation-time.h" #include "generated/wayland/presentation-time.h"
#define OPT_BASE_STRUCT struct wayland_opts #define OPT_BASE_STRUCT struct wayland_opts
const struct m_sub_options wayland_conf = { const struct m_sub_options wayland_conf = {

View File

@ -107,19 +107,19 @@ typedef struct
} MotifWmHints; } MotifWmHints;
static const char x11_icon_16[] = static const char x11_icon_16[] =
#include "video/out/x11_icon_16.inc" #include "generated/etc/mpv-icon-8bit-16x16.png.inc"
; ;
static const char x11_icon_32[] = static const char x11_icon_32[] =
#include "video/out/x11_icon_32.inc" #include "generated/etc/mpv-icon-8bit-32x32.png.inc"
; ;
static const char x11_icon_64[] = static const char x11_icon_64[] =
#include "video/out/x11_icon_64.inc" #include "generated/etc/mpv-icon-8bit-64x64.png.inc"
; ;
static const char x11_icon_128[] = static const char x11_icon_128[] =
#include "video/out/x11_icon_128.inc" #include "generated/etc/mpv-icon-8bit-128x128.png.inc"
; ;
#define ICON_ENTRY(var) { (char *)var, sizeof(var) } #define ICON_ENTRY(var) { (char *)var, sizeof(var) }

View File

@ -988,7 +988,7 @@ def __write_version__(ctx):
ctx( ctx(
source = 'version.sh', source = 'version.sh',
target = 'version.h', target = 'generated/version.h',
rule = 'sh ${SRC} ${CWD_ST:VERSIONSH_CWD} ${VERSIONH_ST:TGT}', rule = 'sh ${SRC} ${CWD_ST:VERSIONSH_CWD} ${VERSIONH_ST:TGT}',
always = True, always = True,
update_outputs = True) update_outputs = True)

View File

@ -54,49 +54,34 @@ def build(ctx):
ctx( ctx(
features = "file2string", features = "file2string",
source = "TOOLS/osxbundle/mpv.app/Contents/Resources/icon.icns", source = "TOOLS/osxbundle/mpv.app/Contents/Resources/icon.icns",
target = "osdep/macosx_icon.inc", target = "generated/TOOLS/osxbundle/mpv.app/Contents/Resources/icon.icns.inc",
) )
ctx( icons = [16, 32, 64, 128]
features = "file2string", for size in icons:
source = "etc/mpv-icon-8bit-16x16.png", name = "etc/mpv-icon-8bit-%dx%d.png" % (size, size)
target = "video/out/x11_icon_16.inc", ctx(
) features = "file2string",
source = name,
ctx( target = "generated/%s.inc" % name,
features = "file2string", )
source = "etc/mpv-icon-8bit-32x32.png",
target = "video/out/x11_icon_32.inc",
)
ctx(
features = "file2string",
source = "etc/mpv-icon-8bit-64x64.png",
target = "video/out/x11_icon_64.inc",
)
ctx(
features = "file2string",
source = "etc/mpv-icon-8bit-128x128.png",
target = "video/out/x11_icon_128.inc",
)
ctx( ctx(
features = "file2string", features = "file2string",
source = "etc/input.conf", source = "etc/input.conf",
target = "input/input_conf.h", target = "generated/etc/input.conf.inc",
) )
ctx( ctx(
features = "file2string", features = "file2string",
source = "etc/builtin.conf", source = "etc/builtin.conf",
target = "player/builtin_conf.inc", target = "generated/etc/builtin.conf.inc",
) )
ctx( ctx(
features = "file2string", features = "file2string",
source = "sub/osd_font.otf", source = "sub/osd_font.otf",
target = "sub/osd_font.h", target = "generated/sub/osd_font.otf.inc",
) )
lua_files = ["defaults.lua", "assdraw.lua", "options.lua", "osc.lua", lua_files = ["defaults.lua", "assdraw.lua", "options.lua", "osc.lua",
@ -107,43 +92,43 @@ def build(ctx):
ctx( ctx(
features = "file2string", features = "file2string",
source = fn, source = fn,
target = os.path.splitext(fn)[0] + ".inc", target = "generated/%s.inc" % fn,
) )
ctx( ctx(
features = "file2string", features = "file2string",
source = "player/javascript/defaults.js", source = "player/javascript/defaults.js",
target = "player/javascript/defaults.js.inc", target = "generated/player/javascript/defaults.js.inc",
) )
if ctx.dependency_satisfied('wayland'): if ctx.dependency_satisfied('wayland'):
ctx.wayland_protocol_code(proto_dir = ctx.env.WL_PROTO_DIR, ctx.wayland_protocol_code(proto_dir = ctx.env.WL_PROTO_DIR,
protocol = "stable/xdg-shell/xdg-shell", protocol = "stable/xdg-shell/xdg-shell",
target = "video/out/wayland/xdg-shell.c") target = "generated/wayland/xdg-shell.c")
ctx.wayland_protocol_header(proto_dir = ctx.env.WL_PROTO_DIR, ctx.wayland_protocol_header(proto_dir = ctx.env.WL_PROTO_DIR,
protocol = "stable/xdg-shell/xdg-shell", protocol = "stable/xdg-shell/xdg-shell",
target = "video/out/wayland/xdg-shell.h") target = "generated/wayland/xdg-shell.h")
ctx.wayland_protocol_code(proto_dir = ctx.env.WL_PROTO_DIR, ctx.wayland_protocol_code(proto_dir = ctx.env.WL_PROTO_DIR,
protocol = "unstable/idle-inhibit/idle-inhibit-unstable-v1", protocol = "unstable/idle-inhibit/idle-inhibit-unstable-v1",
target = "video/out/wayland/idle-inhibit-v1.c") target = "generated/wayland/idle-inhibit-unstable-v1.c")
ctx.wayland_protocol_header(proto_dir = ctx.env.WL_PROTO_DIR, ctx.wayland_protocol_header(proto_dir = ctx.env.WL_PROTO_DIR,
protocol = "unstable/idle-inhibit/idle-inhibit-unstable-v1", protocol = "unstable/idle-inhibit/idle-inhibit-unstable-v1",
target = "video/out/wayland/idle-inhibit-v1.h") target = "generated/wayland/idle-inhibit-unstable-v1.h")
ctx.wayland_protocol_code(proto_dir = ctx.env.WL_PROTO_DIR, ctx.wayland_protocol_code(proto_dir = ctx.env.WL_PROTO_DIR,
protocol = "stable/presentation-time/presentation-time", protocol = "stable/presentation-time/presentation-time",
target = "video/out/wayland/presentation-time.c") target = "generated/wayland/presentation-time.c")
ctx.wayland_protocol_header(proto_dir = ctx.env.WL_PROTO_DIR, ctx.wayland_protocol_header(proto_dir = ctx.env.WL_PROTO_DIR,
protocol = "stable/presentation-time/presentation-time", protocol = "stable/presentation-time/presentation-time",
target = "video/out/wayland/presentation-time.h") target = "generated/wayland/presentation-time.h")
ctx.wayland_protocol_code(proto_dir = ctx.env.WL_PROTO_DIR, ctx.wayland_protocol_code(proto_dir = ctx.env.WL_PROTO_DIR,
protocol = "unstable/xdg-decoration/xdg-decoration-unstable-v1", protocol = "unstable/xdg-decoration/xdg-decoration-unstable-v1",
target = "video/out/wayland/xdg-decoration-v1.c") target = "generated/wayland/xdg-decoration-unstable-v1.c")
ctx.wayland_protocol_header(proto_dir = ctx.env.WL_PROTO_DIR, ctx.wayland_protocol_header(proto_dir = ctx.env.WL_PROTO_DIR,
protocol = "unstable/xdg-decoration/xdg-decoration-unstable-v1", protocol = "unstable/xdg-decoration/xdg-decoration-unstable-v1",
target = "video/out/wayland/xdg-decoration-v1.h") target = "generated/wayland/xdg-decoration-unstable-v1.h")
ctx(features = "ebml_header", target = "ebml_types.h") ctx(features = "ebml_header", target = "generated/ebml_types.h")
ctx(features = "ebml_definitions", target = "ebml_defs.c") ctx(features = "ebml_definitions", target = "generated/ebml_defs.c")
def swift(task): def swift(task):
src = [x.abspath() for x in task.inputs] src = [x.abspath() for x in task.inputs]
@ -521,10 +506,10 @@ def build(ctx):
( "video/out/vulkan/context_xlib.c", "vulkan && x11" ), ( "video/out/vulkan/context_xlib.c", "vulkan && x11" ),
( "video/out/vulkan/utils.c", "vulkan" ), ( "video/out/vulkan/utils.c", "vulkan" ),
( "video/out/w32_common.c", "win32-desktop" ), ( "video/out/w32_common.c", "win32-desktop" ),
( "video/out/wayland/idle-inhibit-v1.c", "wayland" ), ( "generated/wayland/idle-inhibit-unstable-v1.c", "wayland" ),
( "video/out/wayland/presentation-time.c", "wayland" ), ( "generated/wayland/presentation-time.c", "wayland" ),
( "video/out/wayland/xdg-decoration-v1.c", "wayland" ), ( "generated/wayland/xdg-decoration-unstable-v1.c", "wayland" ),
( "video/out/wayland/xdg-shell.c", "wayland" ), ( "generated/wayland/xdg-shell.c", "wayland" ),
( "video/out/wayland_common.c", "wayland" ), ( "video/out/wayland_common.c", "wayland" ),
( "video/out/win32/displayconfig.c", "win32-desktop" ), ( "video/out/win32/displayconfig.c", "win32-desktop" ),
( "video/out/win32/droptarget.c", "win32-desktop" ), ( "video/out/win32/droptarget.c", "win32-desktop" ),
@ -590,7 +575,7 @@ def build(ctx):
ctx.path.find_node('osdep/mpv.rc'), ctx.path.find_node('osdep/mpv.rc'),
ctx.path.find_node(node)) ctx.path.find_node(node))
version = ctx.bldnode.find_node('version.h') version = ctx.bldnode.find_node('generated/version.h')
if version: if version:
ctx.add_manual_dependency( ctx.add_manual_dependency(
ctx.path.find_node('osdep/mpv.rc'), ctx.path.find_node('osdep/mpv.rc'),