mirror of
https://github.com/mkxp-z/mkxp-z.git
synced 2025-04-22 06:02:04 +02:00
Add dependency makefile for Windows
This commit is contained in:
parent
be051461e5
commit
262b62b10b
4 changed files with 481 additions and 168 deletions
|
@ -17,13 +17,10 @@ option('default_framerate', type: 'boolean', value: false, description: 'Disable
|
||||||
option('no_preload_scripts', type: 'boolean', value: false, description: 'Disable the preloadScript configuration option')
|
option('no_preload_scripts', type: 'boolean', value: false, description: 'Disable the preloadScript configuration option')
|
||||||
option('workdir_current', type: 'boolean', value: false, description: 'Keep current directory on startup')
|
option('workdir_current', type: 'boolean', value: false, description: 'Keep current directory on startup')
|
||||||
|
|
||||||
option('static_executable', type: 'boolean', value: false, description: 'Build a static executable (Windows-only)')
|
option('static_executable', type: 'boolean', value: true, description: 'Build a static executable (Windows-only)')
|
||||||
option('appimagekit_path', type: 'string', value: '', description: 'Path to AppImageKit, used for building AppImages')
|
option('appimagekit_path', type: 'string', value: '', description: 'Path to AppImageKit, used for building AppImages')
|
||||||
option('appimage', type: 'boolean', value: false, description: 'Whether to install to an AppImage or just copy everything')
|
option('appimage', type: 'boolean', value: false, description: 'Whether to install to an AppImage or just copy everything')
|
||||||
option('steamworks_path', type: 'string', value: '', description: 'Path to Steamshim')
|
option('steamworks_path', type: 'string', value: '', description: 'Path to Steamshim')
|
||||||
option('steam_appid', type: 'string', value: '', description: 'Steam AppID. Set this to use SteamAPI_RestartAppIfNecessary')
|
option('steam_appid', type: 'string', value: '', description: 'Steam AppID. Set this to use SteamAPI_RestartAppIfNecessary')
|
||||||
|
|
||||||
option('gfx_backend', type: 'combo', value: 'gl', choices: ['gl', 'gles'], description: 'Graphics rendering API to use.')
|
option('gfx_backend', type: 'combo', value: 'gl', choices: ['gl', 'gles'], description: 'Graphics rendering API to use.')
|
||||||
|
|
||||||
option('codesign', type: 'boolean', value: true, description: 'Whether to codesign the Mac app bundle upon creation. If codesign_identity is not set, signs for local use.')
|
|
||||||
option('codesign_identity', type: 'string', value: '', description: 'A valid Apple Developer ID for signing Mac apps.')
|
|
330
src/meson.build
Normal file → Executable file
330
src/meson.build
Normal file → Executable file
|
@ -1,163 +1,167 @@
|
||||||
sigcxx = dependency('sigc++-2.0', version: '>=2.10.0', static: build_static)
|
sigcxx = dependency('sigc++-2.0', version: '>=2.10.0', static: build_static)
|
||||||
pixman = dependency('pixman-1', static: build_static)
|
pixman = dependency('pixman-1', static: build_static)
|
||||||
physfs = dependency('physfs', version: '>=2.1', static: build_static)
|
physfs = dependency('physfs', version: '>=2.1', static: build_static)
|
||||||
vorbisfile = dependency('vorbisfile', static: build_static)
|
sdl2_ttf = dependency('SDL2_ttf', static: build_static)
|
||||||
sdl2_ttf = dependency('SDL2_ttf', static: build_static)
|
freetype = dependency('freetype2', static: build_static)
|
||||||
sdl2_image = dependency('SDL2_image', static: build_static)
|
sdl2_image = dependency('SDL2_image', static: build_static)
|
||||||
openal = dependency('openal', static: build_static, method: 'pkg-config')
|
jpeg = dependency('libjpeg', static: build_static)
|
||||||
zlib = dependency('zlib', static: build_static)
|
png = dependency('libpng', static: build_static)
|
||||||
|
openal = dependency('openal', static: build_static, method: 'pkg-config')
|
||||||
# On Windows, SDL needs to be set up manually in order to avoid
|
vorbisfile = dependency('vorbisfile', static: build_static)
|
||||||
# the -mwindows flag
|
vorbis = dependency('vorbis', static: build_static)
|
||||||
if host_system != 'windows'
|
ogg = dependency('ogg', static: build_static)
|
||||||
global_dependencies += dependency('sdl2')
|
bz2 = dependency('bzip2', static: build_static)
|
||||||
else
|
zlib = dependency('zlib', static: build_static)
|
||||||
sdl2cfg = find_program('sdl2-config')
|
|
||||||
global_args += run_command(sdl2cfg, '--cflags').stdout().split()
|
# On Windows, SDL needs to be set up manually in order to avoid
|
||||||
if build_static == false
|
# the -mwindows flag
|
||||||
libarg = '--libs'
|
if host_system != 'windows'
|
||||||
else
|
global_dependencies += dependency('sdl2')
|
||||||
libarg = '--static-libs'
|
else
|
||||||
endif
|
sdl2cfg = find_program('sdl2-config')
|
||||||
link_args = run_command(sdl2cfg, libarg).stdout().split()
|
global_args += run_command(sdl2cfg, '--cflags').stdout().split()
|
||||||
foreach arg : link_args
|
if build_static == false
|
||||||
if arg != '-mwindows'
|
libarg = '--libs'
|
||||||
global_link_args += arg
|
else
|
||||||
endif
|
libarg = '--static-libs'
|
||||||
endforeach
|
endif
|
||||||
endif
|
link_args = run_command(sdl2cfg, libarg).stdout().split()
|
||||||
|
foreach arg : link_args
|
||||||
# If OpenSSL is present, you get HTTPS support
|
if arg != '-mwindows'
|
||||||
if get_option('enable-https') == true
|
global_link_args += arg
|
||||||
openssl = dependency('openssl', required: false, static: build_static)
|
endif
|
||||||
if openssl.found() == true
|
endforeach
|
||||||
global_dependencies += openssl
|
endif
|
||||||
global_args += '-DMKXPZ_SSL'
|
|
||||||
if host_system == 'windows'
|
# If OpenSSL is present, you get HTTPS support
|
||||||
global_link_args += '-lcrypt32'
|
if get_option('enable-https') == true
|
||||||
endif
|
openssl = dependency('openssl', required: false, static: build_static)
|
||||||
else
|
if openssl.found() == true
|
||||||
warning('Could not locate OpenSSL. HTTPS will be disabled.')
|
global_dependencies += openssl
|
||||||
endif
|
global_args += '-DMKXPZ_SSL'
|
||||||
endif
|
if host_system == 'windows'
|
||||||
|
global_link_args += '-lcrypt32'
|
||||||
# Windows needs to be treated like a special needs child here
|
endif
|
||||||
explicit_libs = ''
|
else
|
||||||
if host_system == 'windows'
|
warning('Could not locate OpenSSL. HTTPS will be disabled.')
|
||||||
# Newer versions of Ruby will refuse to link without these
|
endif
|
||||||
explicit_libs += 'libmsvcrt;libgcc;libmingwex;libgmp;'
|
endif
|
||||||
endif
|
|
||||||
if build_static == true
|
# Windows needs to be treated like a special needs child here
|
||||||
explicit_libs += 'libfreetype;libbz2;libharfbuzz;libgraphite2;'
|
explicit_libs = ''
|
||||||
explicit_libs += 'libjpeg;libpng;libtiff;libwebp;liblzma;libzstd;'
|
if host_system == 'windows'
|
||||||
global_link_args += '-static'
|
# Newer versions of Ruby will refuse to link without these
|
||||||
global_args += '-DAL_LIBTYPE_STATIC'
|
explicit_libs += 'libmsvcrt;libgcc;libmingwex;libgmp;'
|
||||||
endif
|
endif
|
||||||
|
if build_static == true
|
||||||
foreach l : explicit_libs.split(';')
|
global_link_args += ['-Wl,-Bstatic', '-lstdc++', '-lpthread', '-lgcc', '-Wl,-Bdynamic']
|
||||||
if l != ''
|
global_args += '-DAL_LIBTYPE_STATIC'
|
||||||
global_link_args += '-l:' + l + '.a'
|
endif
|
||||||
endif
|
|
||||||
endforeach
|
foreach l : explicit_libs.split(';')
|
||||||
|
if l != ''
|
||||||
alcdev_struct = 'ALCdevice_struct'
|
global_link_args += '-l:' + l + '.a'
|
||||||
if openal.type_name() == 'pkgconfig'
|
endif
|
||||||
if openal.version().version_compare('>=1.20.1')
|
endforeach
|
||||||
alcdev_struct = 'ALCdevice'
|
|
||||||
endif
|
alcdev_struct = 'ALCdevice_struct'
|
||||||
endif
|
if openal.type_name() == 'pkgconfig'
|
||||||
|
if openal.version().version_compare('>=1.20.1')
|
||||||
global_args += '-DMKXPZ_ALCDEVICE=' + alcdev_struct
|
alcdev_struct = 'ALCdevice'
|
||||||
|
endif
|
||||||
|
endif
|
||||||
global_include_dirs += include_directories('.',
|
|
||||||
'audio',
|
global_args += '-DMKXPZ_ALCDEVICE=' + alcdev_struct
|
||||||
'crypto',
|
|
||||||
'display', 'display/gl',
|
|
||||||
'etc',
|
global_include_dirs += include_directories('.',
|
||||||
'filesystem', 'filesystem/ghc',
|
'audio',
|
||||||
'input',
|
'crypto',
|
||||||
'net',
|
'display', 'display/gl',
|
||||||
'system',
|
'etc',
|
||||||
'util'
|
'filesystem', 'filesystem/ghc',
|
||||||
)
|
'input',
|
||||||
|
'net',
|
||||||
global_dependencies += [sigcxx, openal, zlib, pixman, physfs, vorbisfile, sdl2_ttf, sdl2_image]
|
'system',
|
||||||
if host_system == 'windows'
|
'util'
|
||||||
global_dependencies += compilers['cpp'].find_library('wsock32')
|
)
|
||||||
endif
|
|
||||||
|
global_dependencies += [sigcxx, openal, zlib, pixman, physfs, vorbisfile, ogg, sdl2_ttf, freetype, sdl2_image, png, jpeg, vorbis, bz2]
|
||||||
if get_option('shared_fluid') == true
|
if host_system == 'windows'
|
||||||
fluidsynth = dependency('fluidsynth', static: build_static)
|
global_dependencies += compilers['cpp'].find_library('wsock32')
|
||||||
add_project_arguments('-DSHARED_FLUID', language: 'cpp')
|
endif
|
||||||
global_dependencies += fluidsynth
|
|
||||||
endif
|
if get_option('shared_fluid') == true
|
||||||
|
fluidsynth = dependency('fluidsynth', static: build_static)
|
||||||
if get_option('default_framerate') == true
|
add_project_arguments('-DSHARED_FLUID', language: 'cpp')
|
||||||
add_project_arguments('-DMKXPZ_STATIC_FRAMERATE', language: 'cpp')
|
global_dependencies += fluidsynth
|
||||||
endif
|
endif
|
||||||
|
|
||||||
if get_option('cjk_fallback_font') == true
|
if get_option('default_framerate') == true
|
||||||
add_project_arguments('-DMKXPZ_CJK_FONT', language: 'cpp')
|
add_project_arguments('-DMKXPZ_STATIC_FRAMERATE', language: 'cpp')
|
||||||
endif
|
endif
|
||||||
|
|
||||||
main_source = files(
|
if get_option('cjk_fallback_font') == true
|
||||||
'main.cpp',
|
add_project_arguments('-DMKXPZ_CJK_FONT', language: 'cpp')
|
||||||
'config.cpp',
|
endif
|
||||||
'eventthread.cpp',
|
|
||||||
'settingsmenu.cpp',
|
main_source = files(
|
||||||
'sharedstate.cpp',
|
'main.cpp',
|
||||||
|
'config.cpp',
|
||||||
'audio/alstream.cpp',
|
'eventthread.cpp',
|
||||||
'audio/audio.cpp',
|
'settingsmenu.cpp',
|
||||||
'audio/audiostream.cpp',
|
'sharedstate.cpp',
|
||||||
'audio/fluid-fun.cpp',
|
|
||||||
'audio/midisource.cpp',
|
'audio/alstream.cpp',
|
||||||
'audio/sdlsoundsource.cpp',
|
'audio/audio.cpp',
|
||||||
'audio/soundemitter.cpp',
|
'audio/audiostream.cpp',
|
||||||
'audio/vorbissource.cpp',
|
'audio/fluid-fun.cpp',
|
||||||
|
'audio/midisource.cpp',
|
||||||
'crypto/rgssad.cpp',
|
'audio/sdlsoundsource.cpp',
|
||||||
|
'audio/soundemitter.cpp',
|
||||||
'display/autotiles.cpp',
|
'audio/vorbissource.cpp',
|
||||||
'display/autotilesvx.cpp',
|
|
||||||
'display/bitmap.cpp',
|
'crypto/rgssad.cpp',
|
||||||
'display/font.cpp',
|
|
||||||
'display/graphics.cpp',
|
'display/autotiles.cpp',
|
||||||
'display/plane.cpp',
|
'display/autotilesvx.cpp',
|
||||||
'display/sprite.cpp',
|
'display/bitmap.cpp',
|
||||||
'display/tilemap.cpp',
|
'display/font.cpp',
|
||||||
'display/tilemapvx.cpp',
|
'display/graphics.cpp',
|
||||||
'display/viewport.cpp',
|
'display/plane.cpp',
|
||||||
'display/window.cpp',
|
'display/sprite.cpp',
|
||||||
'display/windowvx.cpp',
|
'display/tilemap.cpp',
|
||||||
|
'display/tilemapvx.cpp',
|
||||||
'display/gl/gl-debug.cpp',
|
'display/viewport.cpp',
|
||||||
'display/gl/gl-fun.cpp',
|
'display/window.cpp',
|
||||||
'display/gl/gl-meta.cpp',
|
'display/windowvx.cpp',
|
||||||
'display/gl/glstate.cpp',
|
|
||||||
'display/gl/scene.cpp',
|
'display/gl/gl-debug.cpp',
|
||||||
'display/gl/shader.cpp',
|
'display/gl/gl-fun.cpp',
|
||||||
'display/gl/texpool.cpp',
|
'display/gl/gl-meta.cpp',
|
||||||
'display/gl/tileatlas.cpp',
|
'display/gl/glstate.cpp',
|
||||||
'display/gl/tileatlasvx.cpp',
|
'display/gl/scene.cpp',
|
||||||
'display/gl/tilequad.cpp',
|
'display/gl/shader.cpp',
|
||||||
'display/gl/vertex.cpp',
|
'display/gl/texpool.cpp',
|
||||||
|
'display/gl/tileatlas.cpp',
|
||||||
'etc/etc.cpp',
|
'display/gl/tileatlasvx.cpp',
|
||||||
'etc/table.cpp',
|
'display/gl/tilequad.cpp',
|
||||||
|
'display/gl/vertex.cpp',
|
||||||
'filesystem/filesystem.cpp',
|
|
||||||
'filesystem/filesystemImpl.cpp',
|
'etc/etc.cpp',
|
||||||
|
'etc/table.cpp',
|
||||||
'input/input.cpp',
|
|
||||||
'input/keybindings.cpp',
|
'filesystem/filesystem.cpp',
|
||||||
|
'filesystem/filesystemImpl.cpp',
|
||||||
'net/LUrlParser.cpp',
|
|
||||||
'net/net.cpp',
|
'input/input.cpp',
|
||||||
|
'input/keybindings.cpp',
|
||||||
'system/fake-api.cpp',
|
|
||||||
'system/systemImpl.cpp'
|
'net/LUrlParser.cpp',
|
||||||
)
|
'net/net.cpp',
|
||||||
|
|
||||||
global_sources += main_source
|
'system/fake-api.cpp',
|
||||||
|
'system/systemImpl.cpp'
|
||||||
|
)
|
||||||
|
|
||||||
|
global_sources += main_source
|
||||||
|
|
1
windows/.gitignore
vendored
Normal file
1
windows/.gitignore
vendored
Normal file
|
@ -0,0 +1 @@
|
||||||
|
downloads/
|
311
windows/Makefile
Executable file
311
windows/Makefile
Executable file
|
@ -0,0 +1,311 @@
|
||||||
|
SDL_FLAGS := ${SDL_FLAGS}
|
||||||
|
SDL2_IMAGE_FLAGS := ${SDL2_IMAGE_FLAGS}
|
||||||
|
SDL2_TTF_FLAGS := ${SDL2_TTF_FLAGS}
|
||||||
|
OPENAL_FLAGS := ${OPENAL_FLAGS}
|
||||||
|
OPENSSL_FLAGS := ${OPENSSL_FLAGS}
|
||||||
|
RUBY_FLAGS := ${RUBY_FLAGS}
|
||||||
|
|
||||||
|
BUILD_PREFIX := /opt/mkxp
|
||||||
|
LIBDIR := $(BUILD_PREFIX)/lib
|
||||||
|
INCLUDEDIR := $(BUILD_PREFIX)/include
|
||||||
|
DOWNLOADS := ${PWD}/downloads
|
||||||
|
NPROC := $(shell nproc)
|
||||||
|
CFLAGS := -I$(INCLUDEDIR)
|
||||||
|
LDFLAGS := -L$(LIBDIR)
|
||||||
|
CC := gcc
|
||||||
|
PKG_CONFIG_LIBDIR := $(BUILD_PREFIX)/lib/pkgconfig
|
||||||
|
GIT := git
|
||||||
|
CLONE := $(GIT) clone -q
|
||||||
|
GITHUB := https://github.com
|
||||||
|
GITLAB := https://gitlab.com
|
||||||
|
|
||||||
|
CONFIGURE_ENV := \
|
||||||
|
$(DEPLOYMENT_TARGET_ENV) \
|
||||||
|
PKG_CONFIG_LIBDIR=$(PKG_CONFIG_LIBDIR) \
|
||||||
|
CC="$(CC)" CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)"
|
||||||
|
|
||||||
|
CONFIGURE_ARGS := \
|
||||||
|
--prefix="$(BUILD_PREFIX)" \
|
||||||
|
--host=$(HOST)
|
||||||
|
|
||||||
|
CMAKE_ARGS := \
|
||||||
|
-DCMAKE_INSTALL_PREFIX="$(BUILD_PREFIX)" \
|
||||||
|
-DCMAKE_C_FLAGS="$(CFLAGS)" \
|
||||||
|
-G "MSYS Makefiles"
|
||||||
|
|
||||||
|
RUBY_CONFIGURE_ARGS := \
|
||||||
|
--enable-install-static-library \
|
||||||
|
--disable-install-doc \
|
||||||
|
--with-out-ext=openssl \
|
||||||
|
--with-static-linked-ext \
|
||||||
|
--disable-rubygems
|
||||||
|
|
||||||
|
CONFIGURE := $(CONFIGURE_ENV) ./configure $(CONFIGURE_ARGS)
|
||||||
|
AUTOGEN := $(CONFIGURE_ENV) ./autogen.sh $(CONFIGURE_ARGS)
|
||||||
|
CMAKE := $(CONFIGURE_ENV) cmake .. $(CMAKE_ARGS)
|
||||||
|
|
||||||
|
default: everything
|
||||||
|
|
||||||
|
# Vorbis
|
||||||
|
libvorbis: init_dirs libogg $(LIBDIR)/libvorbis.a
|
||||||
|
|
||||||
|
$(LIBDIR)/libvorbis.a: $(LIBDIR)/libogg.a $(DOWNLOADS)/vorbis/Makefile
|
||||||
|
cd $(DOWNLOADS)/vorbis; \
|
||||||
|
make -j$(NPROC); make install
|
||||||
|
|
||||||
|
$(DOWNLOADS)/vorbis/Makefile: $(DOWNLOADS)/vorbis/configure
|
||||||
|
cd $(DOWNLOADS)/vorbis; \
|
||||||
|
$(CONFIGURE) --with-ogg=$(BUILD_PREFIX) --enable-shared=false --enable-static=true
|
||||||
|
|
||||||
|
$(DOWNLOADS)/vorbis/configure: $(DOWNLOADS)/vorbis/autogen.sh
|
||||||
|
cd $(DOWNLOADS)/vorbis; \
|
||||||
|
./autogen.sh
|
||||||
|
|
||||||
|
$(DOWNLOADS)/vorbis/autogen.sh:
|
||||||
|
$(CLONE) $(GITLAB)/mkxp-z/vorbis $(DOWNLOADS)/vorbis
|
||||||
|
|
||||||
|
|
||||||
|
# Ogg, dependency of Vorbis
|
||||||
|
libogg: init_dirs $(LIBDIR)/libogg.a
|
||||||
|
|
||||||
|
$(LIBDIR)/libogg.a: $(DOWNLOADS)/ogg/Makefile
|
||||||
|
cd $(DOWNLOADS)/ogg; \
|
||||||
|
make -j$(NPROC); make install
|
||||||
|
|
||||||
|
$(DOWNLOADS)/ogg/Makefile: $(DOWNLOADS)/ogg/configure
|
||||||
|
cd $(DOWNLOADS)/ogg; \
|
||||||
|
$(CONFIGURE) --enable-static=true --enable-shared=false
|
||||||
|
|
||||||
|
$(DOWNLOADS)/ogg/configure: $(DOWNLOADS)/ogg/autogen.sh
|
||||||
|
cd $(DOWNLOADS)/ogg; ./autogen.sh
|
||||||
|
|
||||||
|
$(DOWNLOADS)/ogg/autogen.sh:
|
||||||
|
$(CLONE) $(GITLAB)/mkxp-z/ogg $(DOWNLOADS)/ogg
|
||||||
|
|
||||||
|
# Pixman
|
||||||
|
pixman: init_dirs libpng $(LIBDIR)/libpixman-1.a
|
||||||
|
|
||||||
|
$(LIBDIR)/libpixman-1.a: $(DOWNLOADS)/pixman/Makefile
|
||||||
|
cd $(DOWNLOADS)/pixman
|
||||||
|
make -C $(DOWNLOADS)/pixman -j$(NPROC)
|
||||||
|
make -C $(DOWNLOADS)/pixman install
|
||||||
|
|
||||||
|
$(DOWNLOADS)/pixman/Makefile: $(DOWNLOADS)/pixman/autogen.sh
|
||||||
|
cd $(DOWNLOADS)/pixman; \
|
||||||
|
$(AUTOGEN) --enable-static=yes --enable-shared=no
|
||||||
|
|
||||||
|
$(DOWNLOADS)/pixman/autogen.sh:
|
||||||
|
$(CLONE) $(GITLAB)/mkxp-z/pixman $(DOWNLOADS)/pixman
|
||||||
|
|
||||||
|
|
||||||
|
# PhysFS
|
||||||
|
|
||||||
|
physfs: init_dirs $(LIBDIR)/libphysfs.a
|
||||||
|
|
||||||
|
$(LIBDIR)/libphysfs.a: $(DOWNLOADS)/physfs/cmakebuild/Makefile
|
||||||
|
cd $(DOWNLOADS)/physfs/cmakebuild; \
|
||||||
|
make -j$(NPROC); make install
|
||||||
|
|
||||||
|
$(DOWNLOADS)/physfs/cmakebuild/Makefile: $(DOWNLOADS)/physfs/CMakeLists.txt
|
||||||
|
cd $(DOWNLOADS)/physfs; \
|
||||||
|
mkdir cmakebuild; cd cmakebuild; \
|
||||||
|
$(CMAKE) -DPHYSFS_BUILD_STATIC=true -DPHYSFS_BUILD_SHARED=false
|
||||||
|
|
||||||
|
$(DOWNLOADS)/physfs/CMakeLists.txt:
|
||||||
|
$(CLONE) $(GITLAB)/mkxp-z/physfs $(DOWNLOADS)/physfs
|
||||||
|
|
||||||
|
# libpng
|
||||||
|
libpng: init_dirs $(LIBDIR)/libpng.a
|
||||||
|
|
||||||
|
$(LIBDIR)/libpng.a: $(DOWNLOADS)/libpng/Makefile
|
||||||
|
cd $(DOWNLOADS)/libpng; \
|
||||||
|
make -j$(NPROC); make install
|
||||||
|
|
||||||
|
$(DOWNLOADS)/libpng/Makefile: $(DOWNLOADS)/libpng/configure
|
||||||
|
cd $(DOWNLOADS)/libpng; \
|
||||||
|
$(CONFIGURE) \
|
||||||
|
--enable-shared=no --enable-static=yes
|
||||||
|
|
||||||
|
$(DOWNLOADS)/libpng/configure:
|
||||||
|
$(CLONE) $(GITLAB)/mkxp-z/libpng $(DOWNLOADS)/libpng
|
||||||
|
|
||||||
|
# libjpeg
|
||||||
|
libjpeg: init_dirs $(LIBDIR)/libjpeg.a
|
||||||
|
|
||||||
|
$(LIBDIR)/libjpeg.a: $(DOWNLOADS)/libjpeg/cmakebuild/Makefile
|
||||||
|
cd $(DOWNLOADS)/libjpeg/cmakebuild; \
|
||||||
|
make -j$(NPROC); make install
|
||||||
|
|
||||||
|
$(DOWNLOADS)/libjpeg/cmakebuild/Makefile: $(DOWNLOADS)/libjpeg/CMakeLists.txt
|
||||||
|
cd $(DOWNLOADS)/libjpeg; mkdir -p cmakebuild; cd cmakebuild; \
|
||||||
|
$(CMAKE) -DENABLE_SHARED=no -DENABLE_STATIC=yes
|
||||||
|
|
||||||
|
$(DOWNLOADS)/libjpeg/CMakeLists.txt:
|
||||||
|
$(CLONE) $(GITLAB)/mkxp-z/libjpeg-turbo $(DOWNLOADS)/libjpeg
|
||||||
|
|
||||||
|
# SDL2
|
||||||
|
sdl2: init_dirs $(LIBDIR)/libSDL2.a
|
||||||
|
|
||||||
|
$(LIBDIR)/libSDL2.a: $(DOWNLOADS)/sdl2/Makefile
|
||||||
|
cd $(DOWNLOADS)/sdl2; \
|
||||||
|
make -j$(NPROC); make install;
|
||||||
|
|
||||||
|
$(DOWNLOADS)/sdl2/Makefile: $(DOWNLOADS)/sdl2/configure
|
||||||
|
cd $(DOWNLOADS)/sdl2; \
|
||||||
|
$(CONFIGURE) --enable-static=true --enable-shared=false $(SDL_FLAGS)
|
||||||
|
|
||||||
|
$(DOWNLOADS)/sdl2/configure: $(DOWNLOADS)/sdl2/autogen.sh
|
||||||
|
cd $(DOWNLOADS)/sdl2; ./autogen.sh
|
||||||
|
|
||||||
|
$(DOWNLOADS)/sdl2/autogen.sh:
|
||||||
|
$(CLONE) $(GITLAB)/mkxp-z/SDL $(DOWNLOADS)/sdl2 -b mkxp-z; cd $(DOWNLOADS)/sdl2
|
||||||
|
|
||||||
|
# SDL2 (Image)
|
||||||
|
sdl2image: init_dirs sdl2 libpng libjpeg $(LIBDIR)/libSDL2_image.a
|
||||||
|
|
||||||
|
$(LIBDIR)/libSDL2_image.a: $(DOWNLOADS)/sdl2_image/Makefile
|
||||||
|
cd $(DOWNLOADS)/sdl2_image; \
|
||||||
|
make -j$(NPROC); make install
|
||||||
|
|
||||||
|
$(DOWNLOADS)/sdl2_image/Makefile: $(DOWNLOADS)/sdl2_image/configure
|
||||||
|
cd $(DOWNLOADS)/sdl2_image; \
|
||||||
|
LIBPNG_LIBS=$(LIBDIR)/libpng.a \
|
||||||
|
$(CONFIGURE) --enable-static=true --enable-shared=false \
|
||||||
|
--disable-imageio \
|
||||||
|
--enable-png=yes --enable-png-shared=no \
|
||||||
|
--enable-jpg=yes --enable-jpg-shared=no \
|
||||||
|
--enable-webp=no $(SDL2_IMAGE_FLAGS)
|
||||||
|
|
||||||
|
$(DOWNLOADS)/sdl2_image/configure: $(DOWNLOADS)/sdl2_image/autogen.sh
|
||||||
|
cd $(DOWNLOADS)/sdl2_image; ./autogen.sh
|
||||||
|
|
||||||
|
$(DOWNLOADS)/sdl2_image/autogen.sh:
|
||||||
|
$(CLONE) $(GITLAB)/mkxp-z/SDL_image $(DOWNLOADS)/sdl2_image -b mkxp-z
|
||||||
|
|
||||||
|
# SDL2 (ttf)
|
||||||
|
sdl2ttf: init_dirs sdl2 freetype $(LIBDIR)/libSDL2_ttf.a
|
||||||
|
|
||||||
|
$(LIBDIR)/libSDL2_ttf.a: $(DOWNLOADS)/sdl2_ttf/Makefile
|
||||||
|
cd $(DOWNLOADS)/sdl2_ttf; \
|
||||||
|
make -j$(NPROC); make install
|
||||||
|
|
||||||
|
$(DOWNLOADS)/sdl2_ttf/Makefile: $(DOWNLOADS)/sdl2_ttf/configure
|
||||||
|
cd $(DOWNLOADS)/sdl2_ttf; \
|
||||||
|
$(CONFIGURE) --enable-static=true --enable-shared=false $(SDL2_TTF_FLAGS)
|
||||||
|
|
||||||
|
$(DOWNLOADS)/sdl2_ttf/configure: $(DOWNLOADS)/sdl2_ttf/autogen.sh
|
||||||
|
cd $(DOWNLOADS)/sdl2_ttf; ./autogen.sh
|
||||||
|
|
||||||
|
$(DOWNLOADS)/sdl2_ttf/autogen.sh:
|
||||||
|
$(CLONE) $(GITLAB)/mkxp-z/SDL_ttf $(DOWNLOADS)/sdl2_ttf -b mkxp-z
|
||||||
|
|
||||||
|
# Freetype (dependency of SDL2_ttf)
|
||||||
|
freetype: init_dirs $(LIBDIR)/libfreetype.a
|
||||||
|
|
||||||
|
$(LIBDIR)/libfreetype.a: $(DOWNLOADS)/freetype/Makefile
|
||||||
|
cd $(DOWNLOADS)/freetype; \
|
||||||
|
make -j$(NPROC); make install
|
||||||
|
|
||||||
|
$(DOWNLOADS)/freetype/Makefile: $(DOWNLOADS)/freetype/configure
|
||||||
|
cd $(DOWNLOADS)/freetype; \
|
||||||
|
$(CONFIGURE) --enable-static=true --enable-shared=false
|
||||||
|
|
||||||
|
$(DOWNLOADS)/freetype/configure: $(DOWNLOADS)/freetype/autogen.sh
|
||||||
|
cd $(DOWNLOADS)/freetype; ./autogen.sh
|
||||||
|
|
||||||
|
$(DOWNLOADS)/freetype/autogen.sh:
|
||||||
|
$(CLONE) $(GITLAB)/mkxp-z/freetype2 $(DOWNLOADS)/freetype
|
||||||
|
|
||||||
|
# OpenAL
|
||||||
|
openal: init_dirs libogg $(LIBDIR)/libOpenAL32.a
|
||||||
|
|
||||||
|
$(LIBDIR)/libOpenAL32.a: $(DOWNLOADS)/openal/cmakebuild/Makefile
|
||||||
|
cd $(DOWNLOADS)/openal/cmakebuild; \
|
||||||
|
make -j$(NPROC); make install
|
||||||
|
|
||||||
|
$(DOWNLOADS)/openal/cmakebuild/Makefile: $(DOWNLOADS)/openal/CMakeLists.txt
|
||||||
|
cd $(DOWNLOADS)/openal; mkdir cmakebuild; cd cmakebuild; \
|
||||||
|
$(CMAKE) -DLIBTYPE=STATIC -DALSOFT_EXAMPLES=no -DALSOFT_UTILS=no $(OPENAL_FLAGS)
|
||||||
|
|
||||||
|
$(DOWNLOADS)/openal/CMakeLists.txt:
|
||||||
|
$(CLONE) $(GITLAB)/mkxp-z/openal-soft $(DOWNLOADS)/openal
|
||||||
|
|
||||||
|
# OpenSSL
|
||||||
|
openssl: init_dirs $(LIBDIR)/libssl.a
|
||||||
|
$(LIBDIR)/libssl.a: $(DOWNLOADS)/openssl/Makefile
|
||||||
|
cd $(DOWNLOADS)/openssl; \
|
||||||
|
make -j$(NPROC); make install_sw
|
||||||
|
|
||||||
|
$(DOWNLOADS)/openssl/Makefile: $(DOWNLOADS)/openssl/Configure
|
||||||
|
cd $(DOWNLOADS)/openssl; \
|
||||||
|
./Configure $(OPENSSL_FLAGS) \
|
||||||
|
no-shared \
|
||||||
|
--prefix="$(BUILD_PREFIX)" \
|
||||||
|
--openssldir="$(BUILD_PREFIX)"
|
||||||
|
|
||||||
|
$(DOWNLOADS)/openssl/Configure:
|
||||||
|
$(CLONE) $(GITHUB)/openssl/openssl $(DOWNLOADS)/openssl; \
|
||||||
|
cd $(DOWNLOADS)/openssl; git checkout OpenSSL_1_1_1i
|
||||||
|
|
||||||
|
# Standard ruby
|
||||||
|
ruby: init_dirs $(LIBDIR)/libx64-msvcrt-ruby300-static.a
|
||||||
|
|
||||||
|
$(LIBDIR)/libx64-msvcrt-ruby300-static.a: $(DOWNLOADS)/ruby/Makefile
|
||||||
|
cd $(DOWNLOADS)/ruby; \
|
||||||
|
make -j$(NPROC); make install
|
||||||
|
|
||||||
|
$(DOWNLOADS)/ruby/Makefile: $(DOWNLOADS)/ruby/configure
|
||||||
|
cd $(DOWNLOADS)/ruby; \
|
||||||
|
$(CONFIGURE) $(RUBY_CONFIGURE_ARGS) $(RUBY_FLAGS)
|
||||||
|
|
||||||
|
$(DOWNLOADS)/ruby/configure: $(DOWNLOADS)/ruby/*.c
|
||||||
|
cd $(DOWNLOADS)/ruby; autoconf
|
||||||
|
|
||||||
|
$(DOWNLOADS)/ruby/*.c:
|
||||||
|
$(CLONE) $(GITLAB)/mkxp-z/ruby $(DOWNLOADS)/ruby -b mkxp-z;
|
||||||
|
|
||||||
|
# Old geezer ruby
|
||||||
|
legacy-ruby: init_dirs $(LIBDIR)/libruby18.a
|
||||||
|
|
||||||
|
$(LIBDIR)/libruby18.a: $(DOWNLOADS)/ruby18/Makefile
|
||||||
|
cd $(DOWNLOADS)/ruby18; \
|
||||||
|
make -j$(NPROC); make install
|
||||||
|
|
||||||
|
$(DOWNLOADS)/ruby18/Makefile: $(DOWNLOADS)/ruby18/configure
|
||||||
|
cd $(DOWNLOADS)/ruby18; \
|
||||||
|
$(CONFIGURE) \
|
||||||
|
--with-static-linked-ext \
|
||||||
|
$(RUBY_FLAGS)
|
||||||
|
|
||||||
|
$(DOWNLOADS)/ruby18/configure: $(DOWNLOADS)/ruby18/*.c
|
||||||
|
cd $(DOWNLOADS)/ruby18; autoconf
|
||||||
|
|
||||||
|
$(DOWNLOADS)/ruby18/*.c:
|
||||||
|
$(CLONE) $(GITLAB)/mkxp-z/ruby --single-branch --branch ruby_1_8_7 $(DOWNLOADS)/ruby18; \
|
||||||
|
rm -rf $(DOWNLOADS)/ruby18/ext/tk $(DOWNLOADS)/ruby18/ext/openssl
|
||||||
|
|
||||||
|
# Build your own ruby!
|
||||||
|
RUBY_PATH := ${RUBY_PATH}
|
||||||
|
custom-ruby: custom-ruby-makefile
|
||||||
|
cd $(RUBY_PATH); \
|
||||||
|
make -j$(NPROC); make install
|
||||||
|
|
||||||
|
custom-ruby-makefile: custom-ruby-configure
|
||||||
|
cd $(RUBY_PATH); $(CONFIGURE) $(RUBY_FLAGS)
|
||||||
|
|
||||||
|
custom-ruby-configure: $(RUBY_PATH)/*.c
|
||||||
|
cd $(RUBY_PATH); autoconf
|
||||||
|
|
||||||
|
|
||||||
|
# ====
|
||||||
|
init_dirs:
|
||||||
|
@mkdir -p $(LIBDIR) $(INCLUDEDIR)
|
||||||
|
|
||||||
|
powerwash: clean-downloads
|
||||||
|
|
||||||
|
clean-downloads:
|
||||||
|
-rm -rf downloads
|
||||||
|
|
||||||
|
deps-core: libvorbis pixman libpng libjpeg physfs sdl2 sdl2image sdl2ttf openal openssl
|
||||||
|
everything: deps-core ruby
|
||||||
|
legacy: deps-core legacy-ruby
|
Loading…
Add table
Reference in a new issue