mame/makefile

1646 lines
45 KiB
Makefile
Raw Normal View History

2007-12-17 16:19:59 +01:00
###########################################################################
#
# makefile
#
# Core makefile for building MAME and derivatives
#
###########################################################################
###########################################################################
################# BEGIN USER-CONFIGURABLE OPTIONS #####################
###########################################################################
# REGENIE = 1
# VERBOSE = 1
# NOWERROR = 1
# IGNORE_GIT = 1
# TARGET = mame
# SUBTARGET = tiny
# TOOLS = 1
# TESTS = 1
# BENCHMARKS = 1
# OSD = sdl
# USE_DISPATCH_GL = 0
2016-01-20 00:38:14 +01:00
# MODERN_WIN_API = 0
# DIRECTINPUT = 7
# USE_SDL = 1
2015-06-06 16:32:04 +02:00
# SDL_INI_PATH = .;$HOME/.mame/;ini;
# SDL2_MULTIAPI = 1
# NO_USE_MIDI = 1
# DONT_USE_NETWORK = 1
# USE_QTDEBUG = 1
# NO_X11 = 1
# NO_USE_XINPUT = 0
# FORCE_DRC_C_BACKEND = 1
# DEBUG = 1
# PROFILER = 1
# SANITIZE = 1
# PTR64 = 1
# BIGENDIAN = 1
# NOASM = 1
# OPTIMIZE = 3
# SYMBOLS = 1
# SYMLEVEL = 2
# MAP = 1
# PROFILE = 1
# ARCHOPTS =
2015-06-06 13:38:19 +02:00
# OPT_FLAGS =
# LDOPTS =
# USE_SYSTEM_LIB_EXPAT = 1
# USE_SYSTEM_LIB_ZLIB = 1
# USE_SYSTEM_LIB_JPEG = 1
# USE_SYSTEM_LIB_FLAC = 1
# USE_SYSTEM_LIB_LUA = 1
# USE_SYSTEM_LIB_PORTMIDI = 1
2015-07-05 22:08:10 +02:00
# USE_SYSTEM_LIB_PORTAUDIO = 1
# USE_SYSTEM_LIB_UV = 1
2016-02-27 19:36:19 +01:00
# USE_BUNDLED_LIB_SDL2 = 1
# MESA_INSTALL_ROOT = /opt/mesa
# SDL_INSTALL_ROOT = /opt/sdl2
# SDL_FRAMEWORK_PATH = $(HOME)/Library/Frameworks
# USE_LIBSDL = 1
# CYGWIN_BUILD = 1
# BUILDDIR = build
# TARGETOS = windows
# CROSS_BUILD = 1
# TOOLCHAIN =
# OVERRIDE_CC = cc
# OVERRIDE_CXX = c++
# OVERRIDE_LD = ld
# DEPRECATED = 1
# LTO = 1
# SSE2 = 1
# OPENMP = 1
2015-04-06 16:33:21 +02:00
# FASTDEBUG = 1
# SEPARATE_BIN = 1
# PYTHON_EXECUTABLE = python3
# SHADOW_CHECK = 1
# STRIP_SYMBOLS = 0
# QT_HOME = /usr/lib64/qt48/
2015-11-17 20:07:00 +01:00
# SOURCES = src/mame/drivers/asteroid.cpp,src/mame/audio/llander.cpp
# FORCE_VERSION_COMPILE = 1
2016-02-26 14:50:09 +01:00
# MSBUILD = 1
# USE_LIBUV = 1
# IGNORE_BAD_LOCALISATION=1
# PRECOMPILE = 0
# DEBUG_DIR=c:\test\location
# DEBUG_ARGS= -window -video bgfx
ifdef PREFIX_MAKEFILE
include $(PREFIX_MAKEFILE)
else
-include useroptions.mak
endif
###########################################################################
################## END USER-CONFIGURABLE OPTIONS ######################
###########################################################################
ifndef MAKETYPE
MAKETYPE := gmake
endif
MAKEPARAMS := -R
#
# Determine running OS
#
ifeq ($(OS),Windows_NT)
OS := windows
GENIEOS := windows
PLATFORM := x86
else
UNAME := $(shell uname -mps)
2015-12-27 15:48:44 +01:00
UNAME_M := $(shell uname -m)
UNAME_P := $(shell uname -p)
GENIEOS := linux
PLATFORM := unknown
ifneq ($(filter x86_64,$(UNAME_P)),)
PLATFORM := x86
endif
ifneq ($(filter %86,$(UNAME_P)),)
2015-12-27 15:48:44 +01:00
PLATFORM := x86
endif
ifneq ($(filter arm%,$(UNAME_M)),)
PLATFORM := arm
endif
ifneq ($(filter arm%,$(UNAME_P)),)
PLATFORM := arm
endif
2016-03-11 13:09:47 +01:00
ifneq ($(filter aarch64%,$(UNAME_M)),)
PLATFORM := arm64
endif
ifneq ($(filter aarch64%,$(UNAME_P)),)
PLATFORM := arm64
endif
ifneq ($(filter powerpc,$(UNAME_P)),)
PLATFORM := powerpc
endif
ifeq ($(firstword $(filter Linux,$(UNAME))),Linux)
OS := linux
endif
ifeq ($(firstword $(filter Solaris,$(UNAME))),Solaris)
OS := solaris
GENIEOS := solaris
endif
ifeq ($(firstword $(filter SunOS,$(UNAME))),SunOS)
OS := solaris
GENIEOS := solaris
endif
ifeq ($(firstword $(filter FreeBSD,$(UNAME))),FreeBSD)
OS := freebsd
2016-06-08 19:36:57 +02:00
GENIEOS := freebsd
endif
ifeq ($(firstword $(filter GNU/kFreeBSD,$(UNAME))),GNU/kFreeBSD)
OS := freebsd
2016-06-08 19:36:57 +02:00
GENIEOS := freebsd
endif
ifeq ($(firstword $(filter NetBSD,$(UNAME))),NetBSD)
OS := netbsd
2016-06-08 19:36:57 +02:00
GENIEOS := freebsd
endif
ifeq ($(firstword $(filter OpenBSD,$(UNAME))),OpenBSD)
OS := openbsd
2016-06-08 19:36:57 +02:00
GENIEOS := freebsd
endif
ifeq ($(firstword $(filter Darwin,$(UNAME))),Darwin)
OS := macosx
GENIEOS := darwin
endif
ifeq ($(firstword $(filter Haiku,$(UNAME))),Haiku)
OS := haiku
endif
ifndef OS
$(error Unable to detect OS from uname -a: $(UNAME))
endif
2015-03-26 14:43:39 +01:00
endif
2007-12-17 16:19:59 +01:00
MINGW:=
ifdef MINGW64
MINGW := $(MINGW64)
else
MINGW := $(MINGW32)
endif
2007-12-17 16:19:59 +01:00
#-------------------------------------------------
2015-12-28 22:10:24 +01:00
# specify core target: mame, ldplayer
# specify subtarget: mame, arcade, mess, tiny, etc.
2015-12-28 22:10:24 +01:00
# build scripts will be run from
# scripts/target/$(TARGET)/$(SUBTARGET).lua
2007-12-17 16:19:59 +01:00
#-------------------------------------------------
ifndef TARGET
TARGET := mame
2007-12-17 16:19:59 +01:00
endif
ifndef SUBTARGET
SUBTARGET := $(TARGET)
2007-12-17 16:19:59 +01:00
endif
SUBTARGET_FULL := $(subst -,_,$(SUBTARGET))
CONFIG = release
ifdef DEBUG
CONFIG := debug
endif
2007-12-17 16:19:59 +01:00
ifdef VERBOSE
MAKEPARAMS += verbose=1
else
SILENT := @
MAKEPARAMS += --no-print-directory
endif
ifndef BUILDDIR
BUILDDIR := build
endif
2007-12-17 16:19:59 +01:00
#-------------------------------------------------
# specify OS target, which further differentiates
# the underlying OS; supported values are:
# win32, unix, macosx
2007-12-17 16:19:59 +01:00
#-------------------------------------------------
ifndef TARGETOS
2010-01-16 05:40:55 +01:00
ifeq ($(OS),windows)
TARGETOS := windows
ifeq ($(PROCESSOR_ARCHITECTURE),AMD64)
ARCHITECTURE := _x64
endif
ifeq ($(PROCESSOR_ARCHITECTURE),x86)
ARCHITECTURE := _x64
ifeq ($(PROCESSOR_ARCHITEW6432),AMD64)
2010-01-19 22:53:06 +01:00
else
ARCHITECTURE := _x86
endif
endif
else
UNAME := $(shell uname -mps)
TARGETOS := $(OS)
ARCHITECTURE := _x86
ifeq ($(firstword $(filter x86_64,$(UNAME))),x86_64)
ARCHITECTURE := _x64
endif
ifeq ($(firstword $(filter amd64,$(UNAME))),amd64)
ARCHITECTURE := _x64
endif
ifeq ($(firstword $(filter ppc64,$(UNAME))),ppc64)
ARCHITECTURE := _x64
endif
endif
2010-01-16 05:40:55 +01:00
else
CROSS_BUILD := 1
endif # TARGET_OS
2007-12-17 16:19:59 +01:00
ifdef PTR64
2015-03-27 08:16:44 +01:00
ifeq ($(PTR64),1)
ARCHITECTURE := _x64
2015-03-27 08:16:44 +01:00
else
ARCHITECTURE := _x86
2015-03-27 08:16:44 +01:00
endif
endif
2015-04-15 09:39:43 +02:00
ifeq ($(OS),windows)
2016-03-27 17:16:49 +02:00
ifndef MINGW64
ARCHITECTURE := _x86
endif
2015-04-15 09:39:43 +02:00
ifeq ($(ARCHITECTURE),_x64)
WINDRES := $(MINGW64)/bin/windres
else
WINDRES := $(MINGW32)/bin/windres
endif
else
ifeq ($(ARCHITECTURE),_x64)
WINDRES := $(word 1,$(TOOLCHAIN) x86_64-w64-mingw32-)windres
2015-04-15 09:39:43 +02:00
else
WINDRES := $(word 1,$(TOOLCHAIN) i686-w64-mingw32-)windres
2015-04-15 09:39:43 +02:00
endif
endif
2015-03-26 14:01:14 +01:00
2015-04-01 07:11:48 +02:00
ifeq ($(findstring arm,$(UNAME)),arm)
2015-07-16 22:54:34 +02:00
ARCHITECTURE :=
2015-04-01 07:11:48 +02:00
ifndef NOASM
NOASM := 1
endif
endif
2016-03-11 13:09:47 +01:00
ifeq ($(findstring aarch64,$(UNAME)),aarch64)
ARCHITECTURE :=
ifndef NOASM
NOASM := 1
endif
endif
# Emscripten
ifeq ($(findstring emcc,$(CC)),emcc)
TARGETOS := asmjs
ARCHITECTURE :=
ifndef NOASM
NOASM := 1
endif
endif
# Autodetect BIGENDIAN
# MacOSX
ifndef BIGENDIAN
ifneq (,$(findstring Power,$(UNAME)))
BIGENDIAN := 1
endif
# Linux
ifneq (,$(findstring ppc,$(UNAME)))
BIGENDIAN := 1
endif
endif # BIGENDIAN
ifndef PYTHON_EXECUTABLE
PYTHON := python
else
PYTHON := $(PYTHON_EXECUTABLE)
endif
CC := $(SILENT)gcc
LD := $(SILENT)g++
2016-02-15 12:05:31 +01:00
CXX:= $(SILENT)g++
2015-03-26 14:01:14 +01:00
#-------------------------------------------------
# specify OSD layer: windows, sdl, etc.
2015-12-28 22:10:24 +01:00
# build scripts will be run from
# scripts/src/osd/$(OSD).lua
#-------------------------------------------------
ifndef OSD
OSD := sdl
ifeq ($(TARGETOS),windows)
OSD := windows
endif
ifeq ($(TARGETOS),linux)
OSD := sdl
endif
ifeq ($(TARGETOS),freebsd)
OSD := sdl
endif
ifeq ($(TARGETOS),netbsd)
OSD := sdl
endif
2016-05-19 23:11:43 +02:00
ifeq ($(TARGETOS),openbsd)
OSD := sdl
endif
ifeq ($(TARGETOS),solaris)
OSD := sdl
endif
ifeq ($(TARGETOS),macosx)
OSD := sdl
endif
2015-08-25 05:01:38 +02:00
2015-11-21 10:40:59 +01:00
ifeq ($(TARGETOS),asmjs)
OSD := sdl
endif
endif
#-------------------------------------------------
# which 3rdparty library to build;
# link against system (common) library otherwise
#-------------------------------------------------
ifdef USE_SYSTEM_LIB_EXPAT
PARAMS += --with-system-expat='$(USE_SYSTEM_LIB_EXPAT)'
endif
ifdef USE_SYSTEM_LIB_ZLIB
PARAMS += --with-system-zlib='$(USE_SYSTEM_LIB_ZLIB)'
endif
ifdef USE_SYSTEM_LIB_JPEG
PARAMS += --with-system-jpeg='$(USE_SYSTEM_LIB_JPEG)'
endif
ifdef USE_SYSTEM_LIB_FLAC
PARAMS += --with-system-flac='$(USE_SYSTEM_LIB_FLAC)'
endif
ifdef USE_SYSTEM_LIB_LUA
PARAMS += --with-system-lua='$(USE_SYSTEM_LIB_LUA)'
endif
ifdef USE_SYSTEM_LIB_PORTMIDI
PARAMS += --with-system-portmidi='$(USE_SYSTEM_LIB_PORTMIDI)'
endif
ifdef USE_SYSTEM_LIB_PORTAUDIO
PARAMS += --with-system-portaudio='$(USE_SYSTEM_LIB_PORTAUDIO)'
2015-07-05 22:08:10 +02:00
endif
# reverse logic for this one
2016-02-27 19:36:19 +01:00
ifdef USE_BUNDLED_LIB_SDL2
PARAMS += --with-bundled-sdl2
endif
ifdef USE_SYSTEM_LIB_UV
PARAMS += --with-system-uv='$(USE_SYSTEM_LIB_UV)'
endif
2015-03-26 14:01:14 +01:00
#-------------------------------------------------
# distribution may change things
#-------------------------------------------------
ifeq ($(DISTRO),)
DISTRO := generic
2015-03-26 14:01:14 +01:00
else
ifeq ($(DISTRO),debian-stable)
else
$(error DISTRO $(DISTRO) unknown)
endif
endif
2015-03-26 14:47:10 +01:00
PARAMS+= --distro=$(DISTRO)
ifdef TOOLCHAIN
PARAMS += --TOOLCHAIN='$(TOOLCHAIN)'
endif
ifdef OVERRIDE_CC
PARAMS += --CC='$(OVERRIDE_CC)'
ifndef CROSS_BUILD
CC := $(OVERRIDE_CC)
endif
endif
ifdef OVERRIDE_CXX
PARAMS += --CXX='$(OVERRIDE_CXX)'
ifndef CROSS_BUILD
CXX := $(OVERRIDE_CXX)
endif
endif
ifdef OVERRIDE_LD
PARAMS += --LD='$(OVERRIDE_LD)'
ifndef CROSS_BUILD
LD := $(OVERRIDE_LD)
endif
endif
2015-03-26 15:45:59 +01:00
#-------------------------------------------------
# sanity check the configuration
#-------------------------------------------------
# enable symbols as it is useless without them
ifdef SANITIZE
SYMBOLS = 1
endif
# profiler defaults to on for DEBUG builds
ifdef DEBUG
ifndef PROFILER
PROFILER = 1
endif
endif
# allow gprof profiling as well, which overrides the internal PROFILER
# also enable symbols as it is useless without them
ifdef PROFILE
PROFILER =
SYMBOLS = 1
ifndef SYMLEVEL
SYMLEVEL = 1
endif
endif
# specify a default optimization level if none explicitly stated
ifndef OPTIMIZE
OPTIMIZE = 3
endif
# set the symbols level
ifdef SYMBOLS
ifndef SYMLEVEL
SYMLEVEL = 1
ifdef SOURCES
2015-03-26 15:45:59 +01:00
SYMLEVEL = 2
endif
endif
endif
2015-03-26 15:45:59 +01:00
ifdef TOOLS
ifneq '$(TOOLS)' '0'
PARAMS += --with-tools
endif
endif
ifdef TESTS
ifneq '$(TESTS)' '0'
PARAMS += --with-tests
endif
endif
ifdef BENCHMARKS
ifneq '$(BENCHMARKS)' '0'
PARAMS += --with-benchmarks
endif
endif
2015-03-26 15:45:59 +01:00
ifdef SYMBOLS
PARAMS += --SYMBOLS='$(SYMBOLS)'
2015-03-26 15:45:59 +01:00
endif
ifdef SYMLEVEL
PARAMS += --SYMLEVEL='$(SYMLEVEL)'
2015-03-26 15:45:59 +01:00
endif
ifdef PROFILER
PARAMS += --PROFILER='$(PROFILER)'
2015-03-26 15:45:59 +01:00
endif
ifdef PROFILE
PARAMS += --PROFILE='$(PROFILE)'
2015-03-26 15:45:59 +01:00
endif
ifdef OPTIMIZE
PARAMS += --OPTIMIZE=$(OPTIMIZE)
2015-03-26 15:45:59 +01:00
endif
ifdef SHLIB
PARAMS += --SHLIB=$(SHLIB)
endif
2015-03-26 15:45:59 +01:00
ifdef ARCHOPTS
PARAMS += --ARCHOPTS='$(ARCHOPTS)'
2015-03-26 15:45:59 +01:00
endif
2015-06-06 13:38:19 +02:00
ifdef OPT_FLAGS
PARAMS += --OPT_FLAGS='$(OPT_FLAGS)'
endif
2015-03-26 15:45:59 +01:00
ifdef MAP
2015-04-01 07:11:48 +02:00
PARAMS += --MAP='$(MAP)'
2015-03-26 15:45:59 +01:00
endif
ifdef USE_BGFX
2015-04-01 07:11:48 +02:00
PARAMS += --USE_BGFX='$(USE_BGFX)'
endif
ifdef NOASM
TARGET_PARAMS += --NOASM='$(NOASM)'
2015-04-01 07:11:48 +02:00
endif
ifdef BIGENDIAN
PARAMS += --BIGENDIAN='$(BIGENDIAN)'
endif
2015-04-01 07:11:48 +02:00
ifdef FORCE_DRC_C_BACKEND
PARAMS += --FORCE_DRC_C_BACKEND='$(FORCE_DRC_C_BACKEND)'
endif
2015-03-28 07:03:44 +01:00
ifdef NOWERROR
PARAMS += --NOWERROR='$(NOWERROR)'
2015-03-28 07:03:44 +01:00
endif
2015-03-28 12:50:15 +01:00
ifdef TARGET
PARAMS += --target='$(TARGET)'
2015-03-28 12:50:15 +01:00
endif
ifdef SUBTARGET_FULL
PARAMS += --subtarget='$(SUBTARGET_FULL)'
2015-03-28 12:50:15 +01:00
endif
ifdef OSD
TARGET_PARAMS += --osd='$(OSD)'
2015-03-28 12:50:15 +01:00
endif
ifdef BUILDDIR
PARAMS += --build-dir='$(BUILDDIR)'
endif
2015-03-28 12:50:15 +01:00
ifdef TARGETOS
TARGET_PARAMS += --targetos='$(TARGETOS)'
2015-03-28 12:50:15 +01:00
endif
2015-03-31 18:44:38 +02:00
ifdef DONT_USE_NETWORK
PARAMS += --DONT_USE_NETWORK='$(DONT_USE_NETWORK)'
endif
2015-03-31 15:41:59 +02:00
ifdef USE_DISPATCH_GL
PARAMS += --USE_DISPATCH_GL='$(USE_DISPATCH_GL)'
endif
ifdef NO_USE_MIDI
PARAMS += --NO_USE_MIDI='$(NO_USE_MIDI)'
endif
ifdef USE_QTDEBUG
PARAMS += --USE_QTDEBUG='$(USE_QTDEBUG)'
endif
2016-01-20 00:38:14 +01:00
ifdef MODERN_WIN_API
PARAMS += --MODERN_WIN_API='$(MODERN_WIN_API)'
endif
ifdef DIRECTINPUT
PARAMS += --DIRECTINPUT='$(DIRECTINPUT)'
endif
ifdef USE_SDL
PARAMS += --USE_SDL='$(USE_SDL)'
endif
2015-06-06 16:32:04 +02:00
ifdef SDL_INI_PATH
PARAMS += --SDL_INI_PATH='$(SDL_INI_PATH)'
endif
ifdef CYGWIN_BUILD
PARAMS += --CYGWIN_BUILD='$(CYGWIN_BUILD)'
endif
2015-03-31 16:00:23 +02:00
ifdef MESA_INSTALL_ROOT
PARAMS += --MESA_INSTALL_ROOT='$(MESA_INSTALL_ROOT)'
endif
ifdef NO_X11
PARAMS += --NO_X11='$(NO_X11)'
endif
ifdef NO_USE_XINPUT
PARAMS += --NO_USE_XINPUT='$(NO_USE_XINPUT)'
endif
ifdef SDL_LIBVER
PARAMS += --SDL_LIBVER='$(SDL_LIBVER)'
endif
2015-03-31 18:02:58 +02:00
ifdef SDL2_MULTIAPI
PARAMS += --SDL2_MULTIAPI='$(SDL2_MULTIAPI)'
endif
ifdef SDL_INSTALL_ROOT
PARAMS += --SDL_INSTALL_ROOT='$(SDL_INSTALL_ROOT)'
endif
ifdef SDL_FRAMEWORK_PATH
PARAMS += --SDL_FRAMEWORK_PATH='$(SDL_FRAMEWORK_PATH)'
endif
ifdef USE_LIBSDL
PARAMS += --USE_LIBSDL='$(USE_LIBSDL)'
endif
ifdef LDOPTS
PARAMS += --LDOPTS='$(LDOPTS)'
endif
ifdef LTO
PARAMS += --LTO='$(LTO)'
endif
ifdef DEPRECATED
PARAMS += --DEPRECATED='$(DEPRECATED)'
endif
ifdef SSE2
PARAMS += --SSE2='$(SSE2)'
endif
ifdef OPENMP
PARAMS += --OPENMP='$(OPENMP)'
endif
2015-04-06 16:33:21 +02:00
ifdef FASTDEBUG
PARAMS += --FASTDEBUG='$(FASTDEBUG)'
endif
ifdef SEPARATE_BIN
PARAMS += --SEPARATE_BIN='$(SEPARATE_BIN)'
endif
ifdef PYTHON_EXECUTABLE
PARAMS += --PYTHON_EXECUTABLE='$(PYTHON_EXECUTABLE)'
endif
ifdef SHADOW_CHECK
PARAMS += --SHADOW_CHECK='$(SHADOW_CHECK)'
endif
ifdef STRIP_SYMBOLS
PARAMS += --STRIP_SYMBOLS='$(STRIP_SYMBOLS)'
endif
ifdef QT_HOME
PARAMS += --QT_HOME='$(QT_HOME)'
endif
ifdef SOURCES
PARAMS += --SOURCES='$(SOURCES)'
endif
ifdef FORCE_VERSION_COMPILE
PARAMS += --FORCE_VERSION_COMPILE='$(FORCE_VERSION_COMPILE)'
endif
ifdef PLATFORM
TARGET_PARAMS += --PLATFORM='$(PLATFORM)'
endif
2016-02-26 14:50:09 +01:00
ifdef USE_LIBUV
PARAMS += --USE_LIBUV='$(USE_LIBUV)'
endif
ifdef PRECOMPILE
PARAMS += --precompile='$(PRECOMPILE)'
endif
ifdef DEBUG_DIR
PARAMS += --DEBUG_DIR='$(DEBUG_DIR)'
endif
ifdef DEBUG_ARGS
PARAMS += --DEBUG_ARGS='$(DEBUG_ARGS)'
endif
#-------------------------------------------------
# All scripts
#-------------------------------------------------
SCRIPTS = scripts/genie.lua \
scripts/src/lib.lua \
scripts/src/emu.lua \
scripts/src/machine.lua \
scripts/src/main.lua \
scripts/src/3rdparty.lua \
scripts/src/cpu.lua \
scripts/src/osd/modules.lua \
$(wildcard scripts/src/osd/$(OSD)*.lua) \
scripts/src/sound.lua \
scripts/src/tools.lua \
scripts/src/tests.lua \
scripts/src/benchmarks.lua \
scripts/src/video.lua \
scripts/src/bus.lua \
scripts/src/netlist.lua \
scripts/toolchain.lua \
2015-04-04 16:42:58 +02:00
scripts/src/osd/modules.lua \
$(wildcard src/osd/$(OSD)/$(OSD).mak) \
$(wildcard src/$(TARGET)/$(SUBTARGET_FULL).mak)
ifeq ($(SUBTARGET_FULL),mame)
SCRIPTS += scripts/target/$(TARGET)/arcade.lua
SCRIPTS += scripts/target/$(TARGET)/mess.lua
endif
ifndef SOURCES
SCRIPTS += scripts/target/$(TARGET)/$(SUBTARGET_FULL).lua
endif
ifdef REGENIE
SCRIPTS+= regenie
endif
#-------------------------------------------------
# Dependent stuff
#-------------------------------------------------
2007-12-17 16:19:59 +01:00
# extension for executables
EXE :=
2007-12-17 16:19:59 +01:00
ifeq ($(OS),windows)
EXE := .exe
2007-12-17 16:19:59 +01:00
endif
SHELLTYPE := msdos
ifeq (,$(ComSpec)$(COMSPEC))
SHELLTYPE := posix
2007-12-17 16:19:59 +01:00
endif
ifeq (/bin,$(findstring /bin,$(SHELL)))
SHELLTYPE := posix
endif
2015-08-25 05:01:38 +02:00
ifeq (/bin,$(findstring /bin,$(MAKESHELL)))
SHELLTYPE := posix
endif
ifeq (posix,$(SHELLTYPE))
MKDIR = $(SILENT) mkdir -p "$(1)"
COPY = $(SILENT) cp -fR "$(1)" "$(2)"
2007-12-17 16:19:59 +01:00
else
MKDIR = $(SILENT) mkdir "$(subst /,\\,$(1))" 2> nul || exit 0
2016-02-28 15:18:50 +01:00
COPY = $(SILENT) copy /Y "$(subst /,\\,$(1))" "$(subst /,\\,$(2))" > nul || exit 0
2007-12-17 16:19:59 +01:00
endif
GENDIR = $(BUILDDIR)/generated
2007-12-17 16:19:59 +01:00
# all sources are under the src/ directory
SRC = src
# all 3rd party sources are under the 3rdparty/ directory
3RDPARTY = 3rdparty
ifeq ($(SUBTARGET_FULL),mame)
PROJECT_NAME := $(SUBTARGET_FULL)
else ifeq ($(SUBTARGET_FULL),mess)
PROJECT_NAME := $(SUBTARGET_FULL)
else
2016-05-19 10:03:59 +02:00
PROJECT_NAME := $(TARGET)$(SUBTARGET_FULL)
endif
ifeq ($(OS),windows)
ifeq (posix,$(SHELLTYPE))
GCC_VERSION := $(shell $(TOOLCHAIN)$(subst @,,$(CC)) -dumpversion 2> /dev/null)
CLANG_VERSION := $(shell $(TOOLCHAIN)$(subst @,,$(CC)) --version 2> /dev/null| head -n 1 | grep clang | sed "s/^.*[^0-9]\([0-9]*\.[0-9]*\.[0-9]*\).*$$/\1/" | head -n 1)
PYTHON_AVAILABLE := $(shell $(PYTHON) --version > /dev/null 2>&1 && echo python)
GIT_AVAILABLE := $(shell git --version > /dev/null 2>&1 && echo git)
else
GCC_VERSION := $(shell $(TOOLCHAIN)$(subst @,,$(CC)) -dumpversion 2> NUL)
CLANG_VERSION := $(shell $(TOOLCHAIN)$(subst @,,$(CC)) --version 2> NUL| head -n 1 | grep clang | sed "s/^.*[^0-9]\([0-9]*\.[0-9]*\.[0-9]*\).*$$/\1/" | head -n 1)
PYTHON_AVAILABLE := $(shell $(PYTHON) --version > NUL 2>&1 && echo python)
GIT_AVAILABLE := $(shell git --version > NUL 2>&1 && echo git)
endif
ifdef MSBUILD
2015-12-07 11:30:31 +01:00
MSBUILD_PARAMS := /v:minimal /m:$(NUMBER_OF_PROCESSORS)
ifeq ($(CONFIG),debug)
MSBUILD_PARAMS += /p:Configuration=Debug
else
MSBUILD_PARAMS += /p:Configuration=Release
endif
ifeq ($(ARCHITECTURE),_x64)
MSBUILD_PARAMS += /p:Platform=x64
else
MSBUILD_PARAMS += /p:Platform=win32
endif
ifeq (posix,$(SHELLTYPE))
MSBUILD_PARAMS := $(subst /,-,$(MSBUILD_PARAMS))
endif
endif
ifdef FASTBUILD
FASTBUILD_PARAMS := -j$(NUMBER_OF_PROCESSORS)
ifeq ($(CONFIG),debug)
FASTBUILD_TARGET := all-Debug
else
FASTBUILD_TARGET := all-Release
endif
ifeq ($(ARCHITECTURE),_x64)
FASTBUILD_PARAMS += $(FASTBUILD_TARGET)-x64
else
FASTBUILD_PARAMS += $(FASTBUILD_TARGET)-x32
endif
endif
else
GCC_VERSION := $(shell $(TOOLCHAIN)$(subst @,,$(CC)) -dumpversion 2> /dev/null)
ifneq ($(OS),solaris)
CLANG_VERSION := $(shell $(TOOLCHAIN)$(subst @,,$(CC)) --version 2> /dev/null | head -n 1 | grep -e 'version [0-9]\.[0-9]\(\.[0-9]\)\?' -o | grep -e '[0-9]\.[0-9]\(\.[0-9]\)\?' -o | tail -n 1)
endif
PYTHON_AVAILABLE := $(shell $(PYTHON) --version > /dev/null 2>&1 && echo python)
GIT_AVAILABLE := $(shell git --version > /dev/null 2>&1 && echo git)
2015-03-26 19:07:46 +01:00
endif
2015-12-07 11:30:31 +01:00
ifeq ($(CLANG_VERSION),)
$(info GCC $(GCC_VERSION) detected)
else
$(info Clang $(CLANG_VERSION) detected)
ifneq ($(TARGETOS),asmjs)
ifeq ($(ARCHITECTURE),_x64)
ARCHITECTURE := _x64_clang
2015-03-26 19:07:46 +01:00
else
ARCHITECTURE := _x86_clang
2015-03-26 19:07:46 +01:00
endif
endif
endif
ifneq ($(PYTHON_AVAILABLE),python)
$(error Python is not available in path)
endif
2007-12-17 16:19:59 +01:00
ifneq ($(GIT_AVAILABLE),git)
IGNORE_GIT := 1
endif
ifeq ($(wildcard .git/*),)
IGNORE_GIT := 1
endif
OLD_GIT_VERSION := $(file <$(GENDIR)/git_desc)
ifneq ($(IGNORE_GIT),1)
NEW_GIT_VERSION := $(shell git describe --dirty)
2016-04-16 17:24:57 +02:00
else
NEW_GIT_VERSION := unknown
endif
2016-06-09 17:08:12 +02:00
ifeq ($(NEW_GIT_VERSION),)
NEW_GIT_VERSION := unknown
endif
GENIE := 3rdparty/genie/bin/$(GENIEOS)/genie$(EXE)
2007-12-17 16:19:59 +01:00
ifeq ($(TARGET),$(SUBTARGET_FULL))
FULLTARGET := $(TARGET)
else
FULLTARGET := $(TARGET)$(SUBTARGET_FULL)
endif
PROJECTDIR := $(BUILDDIR)/projects/$(OSD)/$(FULLTARGET)
PROJECTDIR_SDL := $(BUILDDIR)/projects/sdl/$(FULLTARGET)
PROJECTDIR_WIN := $(BUILDDIR)/projects/windows/$(FULLTARGET)
.PHONY: all clean regenie generate
all: $(GENIE) $(TARGETOS)$(ARCHITECTURE)
regenie:
2007-12-17 16:19:59 +01:00
#-------------------------------------------------
# gmake-mingw64-gcc
#-------------------------------------------------
$(PROJECTDIR)/$(MAKETYPE)-mingw64-gcc/Makefile: makefile $(SCRIPTS) $(GENIE)
ifndef MINGW64
$(error MINGW64 is not set)
2007-12-17 16:19:59 +01:00
endif
$(SILENT) $(GENIE) $(PARAMS) $(TARGET_PARAMS) --gcc=mingw64-gcc --gcc_version=$(GCC_VERSION) $(MAKETYPE)
.PHONY: windows_x64
windows_x64: generate $(PROJECTDIR)/$(MAKETYPE)-mingw64-gcc/Makefile
2016-01-02 19:01:25 +01:00
ifndef MINGW64
$(error MINGW64 is not set)
endif
$(SILENT) $(MAKE) $(MAKEPARAMS) -C $(PROJECTDIR)/$(MAKETYPE)-mingw64-gcc config=$(CONFIG)64 WINDRES=$(WINDRES) precompile
$(SILENT) $(MAKE) $(MAKEPARAMS) -C $(PROJECTDIR)/$(MAKETYPE)-mingw64-gcc config=$(CONFIG)64 WINDRES=$(WINDRES)
2007-12-17 16:19:59 +01:00
#-------------------------------------------------
# gmake-mingw32-gcc
#-------------------------------------------------
.PHONY: windows
windows: windows_x86
$(PROJECTDIR)/$(MAKETYPE)-mingw32-gcc/Makefile: makefile $(SCRIPTS) $(GENIE)
ifndef MINGW32
$(error MINGW32 is not set)
2007-12-17 16:19:59 +01:00
endif
$(SILENT) $(GENIE) $(PARAMS) $(TARGET_PARAMS) --gcc=mingw32-gcc --gcc_version=$(GCC_VERSION) $(MAKETYPE)
.PHONY: windows_x86
windows_x86: generate $(PROJECTDIR)/$(MAKETYPE)-mingw32-gcc/Makefile
2016-01-02 19:01:25 +01:00
ifndef MINGW32
$(error MINGW32 is not set)
endif
$(SILENT) $(MAKE) $(MAKEPARAMS) -C $(PROJECTDIR)/$(MAKETYPE)-mingw32-gcc config=$(CONFIG)32 WINDRES=$(WINDRES) precompile
$(SILENT) $(MAKE) $(MAKEPARAMS) -C $(PROJECTDIR)/$(MAKETYPE)-mingw32-gcc config=$(CONFIG)32 WINDRES=$(WINDRES)
2007-12-17 16:19:59 +01:00
#-------------------------------------------------
# gmake-mingw-clang
#-------------------------------------------------
$(PROJECTDIR)/$(MAKETYPE)-mingw-clang/Makefile: makefile $(SCRIPTS) $(GENIE)
$(SILENT) $(GENIE) $(PARAMS) $(TARGET_PARAMS) --gcc=mingw-clang --gcc_version=$(CLANG_VERSION) $(MAKETYPE)
.PHONY: windows_x64_clang
windows_x64_clang: generate $(PROJECTDIR)/$(MAKETYPE)-mingw-clang/Makefile
$(SILENT) $(MAKE) $(MAKEPARAMS) -C $(PROJECTDIR)/$(MAKETYPE)-mingw-clang config=$(CONFIG)64 WINDRES=$(WINDRES) precompile
$(SILENT) $(MAKE) $(MAKEPARAMS) -C $(PROJECTDIR)/$(MAKETYPE)-mingw-clang config=$(CONFIG)64 WINDRES=$(WINDRES)
.PHONY: windows_x86_clang
windows_x86_clang: generate $(PROJECTDIR)/$(MAKETYPE)-mingw-clang/Makefile
$(SILENT) $(MAKE) $(MAKEPARAMS) -C $(PROJECTDIR)/$(MAKETYPE)-mingw-clang config=$(CONFIG)32 WINDRES=$(WINDRES) precompile
$(SILENT) $(MAKE) $(MAKEPARAMS) -C $(PROJECTDIR)/$(MAKETYPE)-mingw-clang config=$(CONFIG)32 WINDRES=$(WINDRES)
2016-02-26 14:16:50 +01:00
#-------------------------------------------------
# Visual Studio 2013
#-------------------------------------------------
2016-02-25 10:08:40 +01:00
.PHONY: vs2013
vs2013: generate
2016-02-27 14:51:24 +01:00
$(SILENT) $(GENIE) $(PARAMS) $(TARGET_PARAMS) vs2013
ifdef MSBUILD
$(SILENT) msbuild.exe $(PROJECTDIR_WIN)/vs2013/$(PROJECT_NAME).sln $(MSBUILD_PARAMS)
endif
2007-12-17 17:37:57 +01:00
2016-02-25 10:08:40 +01:00
.PHONY: vs2013_intel
vs2013_intel: generate
2016-02-27 14:51:24 +01:00
$(SILENT) $(GENIE) $(PARAMS) $(TARGET_PARAMS) --vs=intel-15 vs2013
ifdef MSBUILD
$(SILENT) msbuild.exe $(PROJECTDIR_WIN)/vs2013-intel/$(PROJECT_NAME).sln $(MSBUILD_PARAMS)
endif
2007-12-17 16:19:59 +01:00
2016-02-25 10:08:40 +01:00
.PHONY: vs2013_xp
vs2013_xp: generate
2016-02-27 14:51:24 +01:00
$(SILENT) $(GENIE) $(PARAMS) $(TARGET_PARAMS) --vs=vs2013-xp vs2013
ifdef MSBUILD
$(SILENT) msbuild.exe $(PROJECTDIR_WIN)/vs2013-xp/$(PROJECT_NAME).sln $(MSBUILD_PARAMS)
endif
2016-02-26 14:16:50 +01:00
#-------------------------------------------------
# Visual Studio 2015
#-------------------------------------------------
2016-02-25 10:08:40 +01:00
.PHONY: vs2015
vs2015: generate
2016-02-27 14:51:24 +01:00
$(SILENT) $(GENIE) $(PARAMS) $(TARGET_PARAMS) vs2015
ifdef MSBUILD
$(SILENT) msbuild.exe $(PROJECTDIR_WIN)/vs2015/$(PROJECT_NAME).sln $(MSBUILD_PARAMS)
endif
2016-02-25 10:08:40 +01:00
.PHONY: vs2015_intel
vs2015_intel: generate
2016-02-27 14:51:24 +01:00
$(SILENT) $(GENIE) $(PARAMS) $(TARGET_PARAMS) --vs=intel-15 vs2015
ifdef MSBUILD
$(SILENT) msbuild.exe $(PROJECTDIR_WIN)/vs2015-intel/$(PROJECT_NAME).sln $(MSBUILD_PARAMS)
endif
2016-02-25 10:08:40 +01:00
.PHONY: vs2015_xp
vs2015_xp: generate
2016-02-27 14:51:24 +01:00
$(SILENT) $(GENIE) $(PARAMS) $(TARGET_PARAMS) --vs=vs2015-xp vs2015
ifdef MSBUILD
$(SILENT) msbuild.exe $(PROJECTDIR_WIN)/vs2015-xp/$(PROJECT_NAME).sln $(MSBUILD_PARAMS)
endif
2016-03-22 23:46:08 +01:00
.PHONY: vs2015_uwp
vs2015_uwp: generate
$(SILENT) $(GENIE) $(PARAMS) $(TARGET_PARAMS) --vs=winstore82 --osd=windows --NO_USE_MIDI=1 --USE_LIBUV=0 --NO_OPENGL=1 --USE_QTDEBUG=0 --MODERN_WIN_API=1 vs2015
ifdef MSBUILD
$(SILENT) msbuild.exe $(PROJECTDIR_WIN)/vs2015-winstore82/$(PROJECT_NAME).sln $(MSBUILD_PARAMS)
endif
.PHONY: vs2015_fastbuild
vs2015_fastbuild: generate
$(SILENT) $(GENIE) $(PARAMS) $(TARGET_PARAMS) vs2015-fastbuild
ifdef FASTBUILD
$(SILENT) fbuild.exe -config $(PROJECTDIR_WIN)/vs2015-fastbuild/ftbuild.bff $(FASTBUILD_PARAMS)
2016-03-22 23:46:08 +01:00
endif
#-------------------------------------------------
# android-ndk
#-------------------------------------------------
.PHONY: android-ndk
android-ndk:
ifndef ANDROID_NDK_LLVM
$(error ANDROID_NDK_LLVM is not set)
endif
ifndef ANDROID_NDK_ROOT
$(error ANDROID_NDK_ROOT is not set)
endif
2016-02-26 14:16:50 +01:00
#-------------------------------------------------
# android-arm
#-------------------------------------------------
$(PROJECTDIR_SDL)/$(MAKETYPE)-android-arm/Makefile: makefile android-ndk $(SCRIPTS) $(GENIE)
ifndef ANDROID_NDK_ARM
$(error ANDROID_NDK_ARM is not set)
2007-12-17 16:19:59 +01:00
endif
$(SILENT) $(GENIE) $(PARAMS) --gcc=android-arm --gcc_version=3.8.0 --osd=sdl --targetos=android --PLATFORM=arm --NO_USE_MIDI=1 --NO_OPENGL=1 --USE_QTDEBUG=0 --NO_X11=1 --DONT_USE_NETWORK=1 --NOASM=1 $(MAKETYPE)
2016-02-26 14:16:50 +01:00
.PHONY: android-arm
android-arm: generate $(PROJECTDIR_SDL)/$(MAKETYPE)-android-arm/Makefile
$(SILENT) $(MAKE) $(MAKEPARAMS) -C $(PROJECTDIR_SDL)/$(MAKETYPE)-android-arm config=$(CONFIG) precompile
$(SILENT) $(MAKE) $(MAKEPARAMS) -C $(PROJECTDIR_SDL)/$(MAKETYPE)-android-arm config=$(CONFIG)
2016-02-26 15:59:38 +01:00
#-------------------------------------------------
# android-arm64
#-------------------------------------------------
$(PROJECTDIR_SDL)/$(MAKETYPE)-android-arm64/Makefile: makefile android-ndk $(SCRIPTS) $(GENIE)
2016-02-26 15:59:38 +01:00
ifndef ANDROID_NDK_ARM64
$(error ANDROID_NDK_ARM64 is not set)
endif
$(SILENT) $(GENIE) $(PARAMS) --gcc=android-arm64 --gcc_version=3.8.0 --osd=sdl --targetos=android --PLATFORM=arm64 --NO_USE_MIDI=1 --NO_OPENGL=1 --USE_QTDEBUG=0 --NO_X11=1 --DONT_USE_NETWORK=1 --NOASM=1 $(MAKETYPE)
2016-02-26 15:59:38 +01:00
.PHONY: android-arm64
android-arm64: generate $(PROJECTDIR_SDL)/$(MAKETYPE)-android-arm64/Makefile
$(SILENT) $(MAKE) $(MAKEPARAMS) -C $(PROJECTDIR_SDL)/$(MAKETYPE)-android-arm64 config=$(CONFIG) precompile
$(SILENT) $(MAKE) $(MAKEPARAMS) -C $(PROJECTDIR_SDL)/$(MAKETYPE)-android-arm64 config=$(CONFIG)
2016-02-26 15:59:38 +01:00
2016-02-26 14:16:50 +01:00
#-------------------------------------------------
# android-mips
#-------------------------------------------------
$(PROJECTDIR_SDL)/$(MAKETYPE)-android-mips/Makefile: makefile android-ndk $(SCRIPTS) $(GENIE)
ifndef ANDROID_NDK_MIPS
$(error ANDROID_NDK_MIPS is not set)
endif
$(SILENT) $(GENIE) $(PARAMS) --gcc=android-mips --gcc_version=3.8.0 --osd=sdl --targetos=android --PLATFORM=mips --NO_USE_MIDI=1 --NO_OPENGL=1 --USE_QTDEBUG=0 --NO_X11=1 --DONT_USE_NETWORK=1 --NOASM=1 $(MAKETYPE)
2016-02-26 14:16:50 +01:00
.PHONY: android-mips
android-mips: generate $(PROJECTDIR_SDL)/$(MAKETYPE)-android-mips/Makefile
$(SILENT) $(MAKE) $(MAKEPARAMS) -C $(PROJECTDIR_SDL)/$(MAKETYPE)-android-mips config=$(CONFIG) precompile
$(SILENT) $(MAKE) $(MAKEPARAMS) -C $(PROJECTDIR_SDL)/$(MAKETYPE)-android-mips config=$(CONFIG)
2016-02-26 15:59:38 +01:00
#-------------------------------------------------
# android-mips64
#-------------------------------------------------
$(PROJECTDIR_SDL)/$(MAKETYPE)-android-mips64/Makefile: makefile android-ndk $(SCRIPTS) $(GENIE)
2016-02-26 15:59:38 +01:00
ifndef ANDROID_NDK_MIPS64
$(error ANDROID_NDK_MIPS64 is not set)
endif
$(SILENT) $(GENIE) $(PARAMS) --gcc=android-mips64 --gcc_version=3.8.0 --osd=sdl --targetos=android --PLATFORM=mips64 --NO_USE_MIDI=1 --NO_OPENGL=1 --USE_QTDEBUG=0 --NO_X11=1 --DONT_USE_NETWORK=1 --NOASM=1 $(MAKETYPE)
2016-02-26 15:59:38 +01:00
.PHONY: android-mips64
android-mips64: generate $(PROJECTDIR_SDL)/$(MAKETYPE)-android-mips64/Makefile
$(SILENT) $(MAKE) $(MAKEPARAMS) -C $(PROJECTDIR_SDL)/$(MAKETYPE)-android-mips64 config=$(CONFIG) precompile
$(SILENT) $(MAKE) $(MAKEPARAMS) -C $(PROJECTDIR_SDL)/$(MAKETYPE)-android-mips64 config=$(CONFIG)
2016-02-26 15:59:38 +01:00
2016-02-26 14:16:50 +01:00
#-------------------------------------------------
# android-x86
#-------------------------------------------------
$(PROJECTDIR_SDL)/$(MAKETYPE)-android-x86/Makefile: makefile android-ndk $(SCRIPTS) $(GENIE)
ifndef ANDROID_NDK_X86
$(error ANDROID_NDK_X86 is not set)
endif
$(SILENT) $(GENIE) $(PARAMS) --gcc=android-x86 --gcc_version=3.8.0 --osd=sdl --targetos=android --PLATFORM=x86 --NO_USE_MIDI=1 --NO_OPENGL=1 --USE_QTDEBUG=0 --NO_X11=1 --DONT_USE_NETWORK=1 $(MAKETYPE)
2016-02-26 14:16:50 +01:00
.PHONY: android-x86
android-x86: generate $(PROJECTDIR_SDL)/$(MAKETYPE)-android-x86/Makefile
$(SILENT) $(MAKE) $(MAKEPARAMS) -C $(PROJECTDIR_SDL)/$(MAKETYPE)-android-x86 config=$(CONFIG) precompile
$(SILENT) $(MAKE) $(MAKEPARAMS) -C $(PROJECTDIR_SDL)/$(MAKETYPE)-android-x86 config=$(CONFIG)
2016-02-26 15:59:38 +01:00
#-------------------------------------------------
# android-x64
#-------------------------------------------------
$(PROJECTDIR_SDL)/$(MAKETYPE)-android-x64/Makefile: makefile android-ndk $(SCRIPTS) $(GENIE)
2016-02-26 15:59:38 +01:00
ifndef ANDROID_NDK_X64
$(error ANDROID_NDK_X64 is not set)
endif
$(SILENT) $(GENIE) $(PARAMS) --gcc=android-x64 --gcc_version=3.8.0 --osd=sdl --targetos=android --PLATFORM=x64 --NO_USE_MIDI=1 --NO_OPENGL=1 --USE_QTDEBUG=0 --NO_X11=1 --DONT_USE_NETWORK=1 $(MAKETYPE)
2016-02-26 15:59:38 +01:00
.PHONY: android-x64
android-x64: generate $(PROJECTDIR_SDL)/$(MAKETYPE)-android-x64/Makefile
$(SILENT) $(MAKE) $(MAKEPARAMS) -C $(PROJECTDIR_SDL)/$(MAKETYPE)-android-x64 config=$(CONFIG) precompile
$(SILENT) $(MAKE) $(MAKEPARAMS) -C $(PROJECTDIR_SDL)/$(MAKETYPE)-android-x64 config=$(CONFIG)
2016-02-26 15:59:38 +01:00
2016-02-26 14:16:50 +01:00
#-------------------------------------------------
# asmjs / Emscripten
#-------------------------------------------------
$(PROJECTDIR)/$(MAKETYPE)-asmjs/Makefile: makefile $(SCRIPTS) $(GENIE)
ifndef EMSCRIPTEN
$(error EMSCRIPTEN is not set)
endif
$(SILENT) $(GENIE) $(PARAMS) $(TARGET_PARAMS) --gcc=asmjs --gcc_version=3.7.0 $(MAKETYPE)
2016-02-26 14:16:50 +01:00
.PHONY: asmjs
asmjs: generate $(PROJECTDIR)/$(MAKETYPE)-asmjs/Makefile
2016-02-26 14:16:50 +01:00
ifndef EMSCRIPTEN
$(error EMSCRIPTEN is not set)
endif
$(SILENT) $(MAKE) $(MAKEPARAMS) -C $(PROJECTDIR)/$(MAKETYPE)-asmjs config=$(CONFIG) precompile
$(SILENT) $(MAKE) $(MAKEPARAMS) -C $(PROJECTDIR)/$(MAKETYPE)-asmjs config=$(CONFIG)
#-------------------------------------------------
# gmake-linux
#-------------------------------------------------
$(PROJECTDIR)/$(MAKETYPE)-linux/Makefile: makefile $(SCRIPTS) $(GENIE)
$(SILENT) $(GENIE) $(PARAMS) $(TARGET_PARAMS) --gcc=linux-gcc --gcc_version=$(GCC_VERSION) $(MAKETYPE)
.PHONY: linux_x64
linux_x64: generate $(PROJECTDIR)/$(MAKETYPE)-linux/Makefile
$(SILENT) $(MAKE) $(MAKEPARAMS) -C $(PROJECTDIR)/$(MAKETYPE)-linux config=$(CONFIG)64 precompile
$(SILENT) $(MAKE) $(MAKEPARAMS) -C $(PROJECTDIR)/$(MAKETYPE)-linux config=$(CONFIG)64
2007-12-17 16:19:59 +01:00
.PHONY: linux_x86
linux_x86: generate $(PROJECTDIR)/$(MAKETYPE)-linux/Makefile
$(SILENT) $(MAKE) $(MAKEPARAMS) -C $(PROJECTDIR)/$(MAKETYPE)-linux config=$(CONFIG)32 precompile
$(SILENT) $(MAKE) $(MAKEPARAMS) -C $(PROJECTDIR)/$(MAKETYPE)-linux config=$(CONFIG)32
2007-12-17 16:19:59 +01:00
2015-07-16 22:54:34 +02:00
.PHONY: linux
linux: generate $(PROJECTDIR)/$(MAKETYPE)-linux/Makefile
$(SILENT) $(MAKE) $(MAKEPARAMS) -C $(PROJECTDIR)/$(MAKETYPE)-linux config=$(CONFIG) precompile
$(SILENT) $(MAKE) $(MAKEPARAMS) -C $(PROJECTDIR)/$(MAKETYPE)-linux config=$(CONFIG)
2015-07-16 22:54:34 +02:00
#-------------------------------------------------
# gmake-linux-clang
#-------------------------------------------------
2007-12-17 16:19:59 +01:00
$(PROJECTDIR)/$(MAKETYPE)-linux-clang/Makefile: makefile $(SCRIPTS) $(GENIE)
$(SILENT) $(GENIE) $(PARAMS) $(TARGET_PARAMS) --gcc=linux-clang --gcc_version=$(CLANG_VERSION) $(MAKETYPE)
.PHONY: linux_x64_clang
linux_x64_clang: generate $(PROJECTDIR)/$(MAKETYPE)-linux-clang/Makefile
$(SILENT) $(MAKE) $(MAKEPARAMS) -C $(PROJECTDIR)/$(MAKETYPE)-linux-clang config=$(CONFIG)64 precompile
$(SILENT) $(MAKE) $(MAKEPARAMS) -C $(PROJECTDIR)/$(MAKETYPE)-linux-clang config=$(CONFIG)64
.PHONY: linux_x86_clang
linux_x86_clang: generate $(PROJECTDIR)/$(MAKETYPE)-linux-clang/Makefile
$(SILENT) $(MAKE) $(MAKEPARAMS) -C $(PROJECTDIR)/$(MAKETYPE)-linux-clang config=$(CONFIG)32 precompile
$(SILENT) $(MAKE) $(MAKEPARAMS) -C $(PROJECTDIR)/$(MAKETYPE)-linux-clang config=$(CONFIG)32
2007-12-17 16:19:59 +01:00
#-------------------------------------------------
# gmake-osx
#-------------------------------------------------
$(PROJECTDIR)/$(MAKETYPE)-osx/Makefile: makefile $(SCRIPTS) $(GENIE)
$(SILENT) $(GENIE) $(PARAMS) $(TARGET_PARAMS) --gcc=osx --gcc_version=$(GCC_VERSION) $(MAKETYPE)
.PHONY: macosx_x64
macosx_x64: generate $(PROJECTDIR)/$(MAKETYPE)-osx/Makefile
$(SILENT) $(MAKE) $(MAKEPARAMS) -C $(PROJECTDIR)/$(MAKETYPE)-osx config=$(CONFIG)64 precompile
$(SILENT) $(MAKE) $(MAKEPARAMS) -C $(PROJECTDIR)/$(MAKETYPE)-osx config=$(CONFIG)64
2007-12-17 16:19:59 +01:00
.PHONY: macosx
macosx: macosx_x86
.PHONY: macosx_x86
macosx_x86: generate $(PROJECTDIR)/$(MAKETYPE)-osx/Makefile
$(SILENT) $(MAKE) $(MAKEPARAMS) -C $(PROJECTDIR)/$(MAKETYPE)-osx config=$(CONFIG)32 precompile
$(SILENT) $(MAKE) $(MAKEPARAMS) -C $(PROJECTDIR)/$(MAKETYPE)-osx config=$(CONFIG)32
2007-12-17 16:19:59 +01:00
#-------------------------------------------------
# gmake-osx-clang
#-------------------------------------------------
2015-03-26 19:07:46 +01:00
$(PROJECTDIR)/$(MAKETYPE)-osx-clang/Makefile: makefile $(SCRIPTS) $(GENIE)
$(SILENT) $(GENIE) $(PARAMS) $(TARGET_PARAMS) --gcc=osx-clang --gcc_version=$(CLANG_VERSION) $(MAKETYPE)
.PHONY: macosx_x64_clang
macosx_x64_clang: generate $(PROJECTDIR)/$(MAKETYPE)-osx-clang/Makefile
$(SILENT) $(MAKE) $(MAKEPARAMS) -C $(PROJECTDIR)/$(MAKETYPE)-osx-clang config=$(CONFIG)64 precompile
$(SILENT) $(MAKE) $(MAKEPARAMS) -C $(PROJECTDIR)/$(MAKETYPE)-osx-clang config=$(CONFIG)64
.PHONY: macosx_x86_clang
macosx_x86_clang: generate $(PROJECTDIR)/$(MAKETYPE)-osx-clang/Makefile
$(SILENT) $(MAKE) $(MAKEPARAMS) -C $(PROJECTDIR)/$(MAKETYPE)-osx-clang config=$(CONFIG)32 precompile
$(SILENT) $(MAKE) $(MAKEPARAMS) -C $(PROJECTDIR)/$(MAKETYPE)-osx-clang config=$(CONFIG)32
2015-03-26 19:07:46 +01:00
2016-02-25 10:08:40 +01:00
.PHONY: xcode4
2015-04-02 18:16:20 +02:00
xcode4: generate
$(SILENT) $(GENIE) $(PARAMS) $(TARGET_PARAMS) --targetos=macosx --xcode=osx xcode4
2015-04-02 18:16:20 +02:00
2016-02-25 10:08:40 +01:00
.PHONY: xcode4-ios
2015-04-02 18:16:20 +02:00
xcode4-ios: generate
$(SILENT) $(GENIE) $(PARAMS) $(TARGET_PARAMS) --targetos=macosx --xcode=ios xcode4
2015-04-02 18:16:20 +02:00
#-------------------------------------------------
# gmake-solaris
#-------------------------------------------------
$(PROJECTDIR)/$(MAKETYPE)-solaris/Makefile: makefile $(SCRIPTS) $(GENIE)
$(SILENT) $(GENIE) $(PARAMS) $(TARGET_PARAMS) --gcc=solaris --gcc_version=$(GCC_VERSION) $(MAKETYPE)
.PHONY: solaris_x64
solaris_x64: generate $(PROJECTDIR)/$(MAKETYPE)-solaris/Makefile
$(SILENT) $(MAKE) -C $(PROJECTDIR)/$(MAKETYPE)-solaris config=$(CONFIG)64 precompile
$(SILENT) $(MAKE) -C $(PROJECTDIR)/$(MAKETYPE)-solaris config=$(CONFIG)64
.PHONY: solaris
solaris: solaris_x86
.PHONY: solaris_x86
solaris_x86: generate $(PROJECTDIR)/$(MAKETYPE)-solaris/Makefile
$(SILENT) $(MAKE) -C $(PROJECTDIR)/$(MAKETYPE)-solaris config=$(CONFIG)32 precompile
$(SILENT) $(MAKE) -C $(PROJECTDIR)/$(MAKETYPE)-solaris config=$(CONFIG)32
#-------------------------------------------------
# gmake-freebsd
#-------------------------------------------------
$(PROJECTDIR)/$(MAKETYPE)-freebsd/Makefile: makefile $(SCRIPTS) $(GENIE)
$(SILENT) $(GENIE) $(PARAMS) $(TARGET_PARAMS) --gcc=freebsd --gcc_version=$(GCC_VERSION) $(MAKETYPE)
.PHONY: freebsd_x64
freebsd_x64: generate $(PROJECTDIR)/$(MAKETYPE)-freebsd/Makefile
$(SILENT) $(MAKE) -C $(PROJECTDIR)/$(MAKETYPE)-freebsd config=$(CONFIG)64 precompile
$(SILENT) $(MAKE) -C $(PROJECTDIR)/$(MAKETYPE)-freebsd config=$(CONFIG)64
.PHONY: freebsd
freebsd: freebsd_x86
.PHONY: freebsd_x86
freebsd_x86: generate $(PROJECTDIR)/$(MAKETYPE)-freebsd/Makefile
$(SILENT) $(MAKE) -C $(PROJECTDIR)/$(MAKETYPE)-freebsd config=$(CONFIG)32 precompile
$(SILENT) $(MAKE) -C $(PROJECTDIR)/$(MAKETYPE)-freebsd config=$(CONFIG)32
#-------------------------------------------------
# gmake-netbsd
#-------------------------------------------------
$(PROJECTDIR)/$(MAKETYPE)-netbsd/Makefile: makefile $(SCRIPTS) $(GENIE)
$(SILENT) $(GENIE) $(PARAMS) $(TARGET_PARAMS) --gcc=netbsd --gcc_version=$(GCC_VERSION) $(MAKETYPE)
.PHONY: netbsd_x64
netbsd_x64: generate $(PROJECTDIR)/$(MAKETYPE)-netbsd/Makefile
$(SILENT) $(MAKE) -C $(PROJECTDIR)/$(MAKETYPE)-netbsd config=$(CONFIG)64 precompile
$(SILENT) $(MAKE) -C $(PROJECTDIR)/$(MAKETYPE)-netbsd config=$(CONFIG)64
.PHONY: netbsd
netbsd: netbsd_x86
.PHONY: netbsd_x86
netbsd_x86: generate $(PROJECTDIR)/$(MAKETYPE)-netbsd/Makefile
$(SILENT) $(MAKE) -C $(PROJECTDIR)/$(MAKETYPE)-netbsd config=$(CONFIG)32 precompile
$(SILENT) $(MAKE) -C $(PROJECTDIR)/$(MAKETYPE)-netbsd config=$(CONFIG)32
2016-05-19 23:11:43 +02:00
#-------------------------------------------------
# gmake-openbsd
#-------------------------------------------------
$(PROJECTDIR)/$(MAKETYPE)-openbsd/Makefile: makefile $(SCRIPTS) $(GENIE)
$(SILENT) $(GENIE) $(PARAMS) $(TARGET_PARAMS) --gcc=openbsd --gcc_version=$(GCC_VERSION) $(MAKETYPE)
2016-05-19 23:11:43 +02:00
.PHONY: openbsd_x64
openbsd_x64: generate $(PROJECTDIR)/$(MAKETYPE)-openbsd/Makefile
$(SILENT) $(MAKE) -C $(PROJECTDIR)/$(MAKETYPE)-openbsd config=$(CONFIG)64 precompile
$(SILENT) $(MAKE) -C $(PROJECTDIR)/$(MAKETYPE)-openbsd config=$(CONFIG)64
2016-05-19 23:11:43 +02:00
.PHONY: openbsd
openbsd: openbsd_x86
.PHONY: openbsd_x86
openbsd_x86: generate $(PROJECTDIR)/$(MAKETYPE)-openbsd/Makefile
$(SILENT) $(MAKE) -C $(PROJECTDIR)/$(MAKETYPE)-openbsd config=$(CONFIG)32 precompile
$(SILENT) $(MAKE) -C $(PROJECTDIR)/$(MAKETYPE)-openbsd config=$(CONFIG)32
2016-05-19 23:11:43 +02:00
#-------------------------------------------------
# gmake-steamlink
#-------------------------------------------------
$(PROJECTDIR)/$(MAKETYPE)-steamlink/Makefile: makefile $(SCRIPTS) $(GENIE)
ifndef MARVELL_SDK_PATH
$(error MARVELL_SDK_PATH is not set)
endif
ifndef MARVELL_ROOTFS
$(error MARVELL_ROOTFS is not set)
endif
$(SILENT) $(GENIE) $(PARAMS) $(TARGET_PARAMS) --gcc=steamlink --gcc_version=$(GCC_VERSION) --NO_OPENGL=1 --NO_USE_MIDI=1 --NO_X11=1 --NOASM=1 --SDL_INSTALL_ROOT=$(MARVELL_ROOTFS)/usr $(MAKETYPE)
.PHONY: steamlink
steamlink: generate $(PROJECTDIR)/$(MAKETYPE)-steamlink/Makefile
ifndef MARVELL_SDK_PATH
$(error MARVELL_SDK_PATH is not set)
endif
ifndef MARVELL_ROOTFS
$(error MARVELL_ROOTFS is not set)
endif
$(SILENT) $(MAKE) $(MAKEPARAMS) -C $(PROJECTDIR)/$(MAKETYPE)-steamlink config=$(CONFIG) precompile
$(SILENT) $(MAKE) $(MAKEPARAMS) -C $(PROJECTDIR)/$(MAKETYPE)-steamlink config=$(CONFIG)
#-------------------------------------------------
# gmake-rpi
#-------------------------------------------------
$(PROJECTDIR_SDL)/$(MAKETYPE)-rpi/Makefile: makefile $(SCRIPTS) $(GENIE)
ifndef RASPBERRY_SDK_PATH
$(error RASPBERRY_SDK_PATH is not set)
endif
ifndef RASPBERRY_SYSROOT
$(error RASPBERRY_SYSROOT is not set)
endif
$(SILENT) $(GENIE) $(PARAMS) --gcc=rpi --gcc_version=4.9.2 --osd=sdl --targetos=rpi --targetos=rpi --NO_USE_MIDI=1 --PLATFORM=arm --NOASM=1 --USE_QTDEBUG=0 --SDL_INSTALL_ROOT=$(RASPBERRY_SYSROOT)/usr $(MAKETYPE)
.PHONY: rpi
rpi: generate $(PROJECTDIR_SDL)/$(MAKETYPE)-rpi/Makefile
ifndef RASPBERRY_SDK_PATH
$(error RASPBERRY_SDK_PATH is not set)
endif
ifndef RASPBERRY_SYSROOT
$(error RASPBERRY_SYSROOT is not set)
endif
$(SILENT) $(MAKE) $(MAKEPARAMS) -C $(PROJECTDIR_SDL)/$(MAKETYPE)-rpi config=$(CONFIG) precompile
$(SILENT) $(MAKE) $(MAKEPARAMS) -C $(PROJECTDIR_SDL)/$(MAKETYPE)-rpi config=$(CONFIG)
2016-03-23 21:23:14 +01:00
#-------------------------------------------------
# gmake-ci20
#-------------------------------------------------
$(PROJECTDIR_SDL)/$(MAKETYPE)-ci20/Makefile: makefile $(SCRIPTS) $(GENIE)
2016-03-23 21:23:14 +01:00
ifndef MIPS_LINUXGNU_ROOT
$(error MIPS_LINUXGNU_ROOT is not set)
endif
ifndef CI20_SYSROOT
$(error CI20_SYSROOT is not set)
endif
$(SILENT) $(GENIE) $(PARAMS) --gcc=ci20 --gcc_version=4.9.2 --osd=sdl --targetos=ci20 --targetos=ci20 --NO_USE_MIDI=1 --PLATFORM=arm --NOASM=1 --USE_QTDEBUG=0 --SDL_INSTALL_ROOT=$(RASPBERRY_SYSROOT)/usr $(MAKETYPE)
2016-03-23 21:23:14 +01:00
.PHONY: ci20
ci20: generate $(PROJECTDIR_SDL)/$(MAKETYPE)-ci20/Makefile
2016-03-23 21:23:14 +01:00
ifndef MIPS_LINUXGNU_ROOT
$(error MIPS_LINUXGNU_ROOT is not set)
endif
ifndef CI20_SYSROOT
$(error CI20_SYSROOT is not set)
endif
$(SILENT) $(MAKE) $(MAKEPARAMS) -C $(PROJECTDIR_SDL)/$(MAKETYPE)-ci20 config=$(CONFIG) precompile
$(SILENT) $(MAKE) $(MAKEPARAMS) -C $(PROJECTDIR_SDL)/$(MAKETYPE)-ci20 config=$(CONFIG)
2016-03-23 21:23:14 +01:00
#-------------------------------------------------
# cmake
#-------------------------------------------------
2016-02-25 10:08:40 +01:00
.PHONY: cmake
cmake: generate
$(SILENT) $(GENIE) $(PARAMS) $(TARGET_PARAMS) cmake
2015-11-08 17:26:46 +01:00
ifeq ($(OS),windows)
2015-12-07 11:30:31 +01:00
$(SILENT)echo cmake_minimum_required(VERSION 2.8.4) > CMakeLists.txt
$(SILENT)echo add_subdirectory($(PROJECTDIR)/cmake) >> CMakeLists.txt
2015-11-08 17:26:46 +01:00
else
2015-12-07 11:30:31 +01:00
$(SILENT)echo "cmake_minimum_required(VERSION 2.8.4)" > CMakeLists.txt
$(SILENT)echo "add_subdirectory($(PROJECTDIR)/cmake)" >> CMakeLists.txt
2015-11-08 17:26:46 +01:00
endif
#-------------------------------------------------
# Clean/bootstrap
#-------------------------------------------------
GENIE_SRC=$(wildcard 3rdparty/genie/src/host/*.c)
$(GENIE): $(GENIE_SRC)
$(SILENT) $(MAKE) $(MAKEPARAMS) -C 3rdparty/genie/build/gmake.$(GENIEOS) -f genie.make
2007-12-17 16:19:59 +01:00
3rdparty/genie/src/hosts/%.c:
.PHONY: genieclean
genieclean:
$(SILENT) $(MAKE) $(MAKEPARAMS) -C 3rdparty/genie/build/gmake.$(GENIEOS) -f genie.make clean
clean: genieclean
@echo Cleaning...
-@rm -rf $(BUILDDIR)
$(SILENT) $(MAKE) -C $(SRC)/devices/cpu/m68000 clean
-@rm -rf 3rdparty/bgfx/.build
2007-12-17 16:19:59 +01:00
GEN_FOLDERS := $(GENDIR)/$(TARGET)/layout/ $(GENDIR)/$(TARGET)/$(SUBTARGET_FULL)/ $(GENDIR)/mame/drivers/
2007-12-17 16:19:59 +01:00
rwildcard=$(foreach d,$(wildcard $1*),$(call rwildcard,$d/,$2) $(filter $(subst *,%,$2),$d))
LAYOUTS=$(wildcard $(SRC)/$(TARGET)/layout/*.lay)
2007-12-17 16:19:59 +01:00
ifneq (,$(wildcard src/osd/$(OSD)/$(OSD).mak))
include src/osd/$(OSD)/$(OSD).mak
endif
2015-05-09 16:13:15 +02:00
ifneq (,$(wildcard src/$(TARGET)/$(TARGET).mak))
include src/$(TARGET)/$(TARGET).mak
endif
$(GEN_FOLDERS):
-$(call MKDIR,$@)
genie: $(GENIE)
generate: \
genie \
$(GEN_FOLDERS) \
$(GENDIR)/version.cpp \
$(patsubst %.po,%.mo,$(call rwildcard, language/, *.po)) \
$(patsubst $(SRC)/%.lay,$(GENDIR)/%.lh,$(LAYOUTS)) \
$(GENDIR)/mame/drivers/ymmu100.hxx \
$(SRC)/devices/cpu/m68000/m68kops.cpp \
$(GENDIR)/includes/SDL2
$(GENDIR)/includes/SDL2:
-$(call MKDIR,$@)
-$(call COPY,3rdparty/SDL2/include/,$(GENDIR)/includes/SDL2)
ifneq ($(NEW_GIT_VERSION),$(OLD_GIT_VERSION))
stale:
.PHONY: stale
$(GENDIR)/git_desc: stale | $(GEN_FOLDERS)
@echo $(NEW_GIT_VERSION) > $@
endif
ifeq (posix,$(SHELLTYPE))
$(GENDIR)/version.cpp: $(GENDIR)/git_desc | $(GEN_FOLDERS)
@echo '#define BARE_BUILD_VERSION "0.174"' > $@
@echo 'extern const char bare_build_version[];' >> $@
@echo 'extern const char build_version[];' >> $@
@echo 'const char bare_build_version[] = BARE_BUILD_VERSION;' >> $@
@echo 'const char build_version[] = BARE_BUILD_VERSION " ($(NEW_GIT_VERSION))";' >> $@
else
$(GENDIR)/version.cpp: $(GENDIR)/git_desc
@echo \#define BARE_BUILD_VERSION "0.174" > $@
@echo extern const char bare_build_version[]; >> $@
@echo extern const char build_version[]; >> $@
@echo const char bare_build_version[] = BARE_BUILD_VERSION; >> $@
@echo const char build_version[] = BARE_BUILD_VERSION " ($(NEW_GIT_VERSION))"; >> $@
endif
$(GENDIR)/%.lh: $(SRC)/%.lay scripts/build/complay.py | $(GEN_FOLDERS)
@echo Compressing $<...
$(SILENT)$(PYTHON) scripts/build/complay.py $< $@ layout_$(basename $(notdir $<))
2015-04-23 14:07:14 +02:00
$(GENDIR)/mame/drivers/ymmu100.hxx: $(SRC)/mame/drivers/ymmu100.ppm scripts/build/file2str.py
@echo Converting $<...
$(SILENT)$(PYTHON) scripts/build/file2str.py $< $@ ymmu100_bkg UINT8
$(SRC)/devices/cpu/m68000/m68kops.cpp: $(SRC)/devices/cpu/m68000/m68k_in.cpp $(SRC)/devices/cpu/m68000/m68kmake.cpp
2016-01-31 21:43:55 +01:00
ifeq ($(TARGETOS),asmjs)
$(SILENT) $(MAKE) -C $(SRC)/devices/cpu/m68000
else
$(SILENT) $(MAKE) -C $(SRC)/devices/cpu/m68000 CC="$(CC)" CXX="$(CXX)"
2016-01-31 21:43:55 +01:00
endif
2015-12-07 11:30:31 +01:00
%.mo: %.po
@echo Converting translation $<...
ifdef IGNORE_BAD_LOCALISATION
$(SILENT)$(PYTHON) scripts/build/msgfmt.py --output-file $@ $< || exit 0
else
$(SILENT)$(PYTHON) scripts/build/msgfmt.py --output-file $@ $<
endif
2015-04-23 14:07:14 +02:00
#-------------------------------------------------
# Regression tests
#-------------------------------------------------
include regtests/regtests.mak
2015-04-23 14:07:14 +02:00
2015-04-25 14:14:12 +02:00
.PHONY: tests
2015-04-23 14:07:14 +02:00
tests: $(REGTESTS)
2015-04-25 14:14:12 +02:00
#-------------------------------------------------
# Source cleanup
#-------------------------------------------------
.PHONY: cleansrc
cleansrc:
@echo Cleaning up tabs/spaces/end of lines....
ifeq ($(OS),windows)
$(shell for /r src %%i in (*.c) do srcclean %%i >&2 )
$(shell for /r src %%i in (*.h) do srcclean %%i >&2 )
$(shell for /r src %%i in (*.mak) do srcclean %%i >&2 )
$(shell for /r src %%i in (*.lst) do srcclean %%i >&2 )
$(shell for /r src %%i in (*.lay) do srcclean %%i >&2 )
$(shell for /r src %%i in (*.hxx) do srcclean %%i >&2 )
2015-04-25 14:14:12 +02:00
$(shell for /r hash %%i in (*.xml) do srcclean %%i >&2 )
else
$(shell find src/ -name *.c -exec ./srcclean {} >&2 ;)
$(shell find src/ -name *.h -exec ./srcclean {} >&2 ;)
$(shell find src/ -name *.mak -exec ./srcclean {} >&2 ;)
$(shell find src/ -name *.lst -exec ./srcclean {} >&2 ;)
$(shell find src/ -name *.lay -exec ./srcclean {} >&2 ;)
$(shell find src/ -name *.hxx -exec ./srcclean {} >&2 ;)
2015-04-25 14:14:12 +02:00
$(shell find hash/ -name *.xml -exec ./srcclean {} >&2 ;)
endif
#-------------------------------------------------
# Doxygen documentation
#-------------------------------------------------
.PHONY: doxygen
doxygen:
@echo Generate Doxygen documentation
doxygen doxygen/doxygen.config
#-------------------------------------------------
# CppCheck analysis
#-------------------------------------------------
.PHONY: cppcheck
CPPCHECK_PARAMS = -Isrc/osd
CPPCHECK_PARAMS += -Isrc/emu
CPPCHECK_PARAMS += -Isrc/lib
CPPCHECK_PARAMS += -Isrc/lib/util
CPPCHECK_PARAMS += -Isrc/mame
CPPCHECK_PARAMS += -Isrc/osd/modules/render
CPPCHECK_PARAMS += -Isrc/osd/windows
CPPCHECK_PARAMS += -Isrc/emu/cpu/m68000
CPPCHECK_PARAMS += -I3rdparty
ifndef USE_SYSTEM_LIB_LUA
CPPCHECK_PARAMS += -I3rdparty/lua/src
endif
ifndef USE_SYSTEM_LIB_ZLIB
CPPCHECK_PARAMS += -I3rdparty/zlib
endif
CPPCHECK_PARAMS += -I3rdparty/bgfx/include
CPPCHECK_PARAMS += -I3rdparty/bx/include
CPPCHECK_PARAMS += -I$(BUILDDIR)/generated/emu
CPPCHECK_PARAMS += -I$(BUILDDIR)/generated/emu/layout
CPPCHECK_PARAMS += -I$(BUILDDIR)/generated/mame/layout
CPPCHECK_PARAMS += -DX64_WINDOWS_ABI
CPPCHECK_PARAMS += -DPTR64=1
CPPCHECK_PARAMS += -DMAME_DEBUG
CPPCHECK_PARAMS += -DMAME_PROFILER
CPPCHECK_PARAMS += -DCRLF=3
CPPCHECK_PARAMS += -DLSB_FIRST
ifndef USE_SYSTEM_LIB_FLAC
CPPCHECK_PARAMS += -DFLAC__NO_DLL
endif
CPPCHECK_PARAMS += -DNATIVE_DRC=drcbe_x64
CPPCHECK_PARAMS += -DLUA_COMPAT_APIINTCASTS
CPPCHECK_PARAMS += -DWIN32
CPPCHECK_PARAMS += -D__GNUC__
CPPCHECK_PARAMS += -D__x86_64__
ifndef VERBOSE
CPPCHECK_PARAMS += --quiet
endif
cppcheck:
@echo Generate CppCheck analysis report
cppcheck --enable=all src/ $(CPPCHECK_PARAMS) -j9
2015-12-12 19:30:43 +01:00
2016-02-26 14:16:50 +01:00
#-------------------------------------------------
# BGFX shaders
#-------------------------------------------------
.PHONY: shaders bgfx-tools
bgfx-tools:
-@rm -rf 3rdparty/bgfx/.build/projects
$(SILENT) $(MAKE) -C 3rdparty/bgfx -f makefile dist-$(GENIEOS) CC="$(CC)" CXX="$(CXX)" MINGW="$(MINGW)"
shaders: bgfx-tools
2016-04-29 08:50:27 +02:00
-$(call MKDIR,build/shaders/dx11)
-$(call MKDIR,build/shaders/dx9)
-$(call MKDIR,build/shaders/gles)
-$(call MKDIR,build/shaders/glsl)
-$(call MKDIR,build/shaders/metal)
$(SILENT) $(MAKE) -C $(SRC)/osd/modules/render/bgfx/shaders rebuild CHAIN="$(CHAIN)"
2016-02-26 14:16:50 +01:00
#-------------------------------------------------
# Translation
#-------------------------------------------------
.PHONY: translation
translation:
$(SILENT) echo Generating mame.pot
$(SILENT) find src -iname "*.cpp" | xargs xgettext --from-code=UTF-8 -k_ -k__ -o mame.pot
$(SILENT) find language -iname "*.po" | xargs -n 1 -I %% msgmerge -U -N %% mame.pot
$(SILENT) find language -iname "*.po" | xargs -n 1 -I %% msgattrib --clear-fuzzy --empty %% -o %%
2016-02-21 20:22:17 +01:00