mame/makefile

860 lines
19 KiB
Makefile
Raw Normal View History

2007-12-17 07:19:59 -08:00
###########################################################################
#
# makefile
#
# Core makefile for building MAME and derivatives
#
# Copyright (c) Nicola Salmoria and the MAME Team.
2007-12-17 07:19:59 -08:00
# Visit http://mamedev.org for licensing and usage restrictions.
#
###########################################################################
###########################################################################
################# BEGIN USER-CONFIGURABLE OPTIONS #####################
###########################################################################
# REGENIE = 1
# VERBOSE = 1
# NOWERROR = 1
# TARGET = mame
# SUBTARGET = tiny
# TOOLS = 1
# OSD = sdl
# USE_BGFX = 1
# NO_OPENGL = 1
# USE_DISPATCH_GL = 0
# DIRECTINPUT = 7
# USE_SDL = 1
# 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 =
# LDOPTS =
# MESA_INSTALL_ROOT = /opt/mesa
# SDL_INSTALL_ROOT = /opt/sdl2
# SDL_FRAMEWORK_PATH = $(HOME)/Library/Frameworks
# SDL_LIBVER = sdl
# MACOSX_USE_LIBSDL = 1
# CYGWIN_BUILD = 1
# TARGETOS = windows
# CROSS_BUILD = 1
# OVERRIDE_CC = cc
# OVERRIDE_CXX = c++
# OVERRIDE_LD = ld
# DEPRECATED = 1
# LTO = 1
# SSE2 = 1
# OPENMP = 1
# CPP11 = 1
2015-04-06 07:33:21 -07:00
# FASTDEBUG = 1
###########################################################################
################## END USER-CONFIGURABLE OPTIONS ######################
###########################################################################
MAKEPARAMS := -R
#
# Determine running OS
#
ifeq ($(OS),Windows_NT)
OS := windows
GENIEOS := windows
else
UNAME := $(shell uname -mps)
GENIEOS := linux
ifeq ($(firstword $(filter Linux,$(UNAME))),Linux)
OS := linux
endif
ifeq ($(firstword $(filter Solaris,$(UNAME))),Solaris)
OS := solaris
endif
ifeq ($(firstword $(filter FreeBSD,$(UNAME))),FreeBSD)
OS := freebsd
endif
ifeq ($(firstword $(filter GNU/kFreeBSD,$(UNAME))),GNU/kFreeBSD)
OS := freebsd
endif
ifeq ($(firstword $(filter NetBSD,$(UNAME))),NetBSD)
OS := netbsd
endif
ifeq ($(firstword $(filter OpenBSD,$(UNAME))),OpenBSD)
OS := openbsd
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 06:43:39 -07:00
endif
2007-12-17 07:19:59 -08:00
#-------------------------------------------------
# specify core target: mame, mess, etc.
# specify subtarget: mame, mess, tiny, etc.
# build rules will be included from
2007-12-17 07:19:59 -08:00
# src/$(TARGET)/$(SUBTARGET).mak
#-------------------------------------------------
ifndef TARGET
TARGET := mame
2007-12-17 07:19:59 -08:00
endif
ifndef SUBTARGET
SUBTARGET := $(TARGET)
2007-12-17 07:19:59 -08:00
endif
CONFIG = release
ifdef DEBUG
CONFIG := debug
endif
2007-12-17 07:19:59 -08:00
ifdef VERBOSE
MAKEPARAMS += verbose=1
else
SILENT := @
MAKEPARAMS += --no-print-directory
endif
2007-12-17 07:19:59 -08:00
#-------------------------------------------------
# specify OS target, which further differentiates
# the underlying OS; supported values are:
# win32, unix, macosx, os2
#-------------------------------------------------
ifndef TARGETOS
2010-01-15 20:40:55 -08:00
ifeq ($(OS),windows)
TARGETOS := windows
WINDRES := windres
ifeq ($(PROCESSOR_ARCHITECTURE),AMD64)
ARCHITECTURE := _x64
endif
ifeq ($(PROCESSOR_ARCHITECTURE),x86)
ARCHITECTURE := _x64
ifeq ($(PROCESSOR_ARCHITEW6432),AMD64)
2010-01-19 13:53:06 -08:00
else
ARCHITECTURE := _x86
endif
endif
else
WINDRES := x86_64-w64-mingw32-windres
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-15 20:40:55 -08:00
else
CROSS_BUILD := 1
endif # TARGET_OS
2007-12-17 07:19:59 -08:00
ifdef PTR64
2015-03-27 00:16:44 -07:00
ifeq ($(PTR64),1)
ARCHITECTURE := _x64
2015-03-27 00:16:44 -07:00
else
ARCHITECTURE := _x86
2015-03-27 00:16:44 -07:00
endif
endif
2015-03-26 06:01:14 -07:00
2015-03-31 22:11:48 -07:00
ifeq ($(findstring arm,$(UNAME)),arm)
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
2015-03-31 22:11:48 -07:00
PYTHON := $(SILENT)python
CC := $(SILENT)gcc
LD := $(SILENT)g++
2015-03-26 06:01:14 -07:00
#-------------------------------------------------
# specify OSD layer: windows, sdl, etc.
# build rules will be included from
# src/osd/$(OSD)/$(OSD).mak
#-------------------------------------------------
ifndef OSD
OSD := osdmini
ifeq ($(TARGETOS),windows)
OSD := windows
endif
ifeq ($(TARGETOS),linux)
OSD := sdl
endif
ifeq ($(TARGETOS),macosx)
OSD := sdl
endif
endif
2015-03-26 06:01:14 -07:00
#-------------------------------------------------
# distribution may change things
#-------------------------------------------------
ifeq ($(DISTRO),)
DISTRO := generic
2015-03-26 06:01:14 -07:00
else
ifeq ($(DISTRO),debian-stable)
else
$(error DISTRO $(DISTRO) unknown)
endif
endif
2015-03-26 06:47:10 -07:00
PARAMS+= --distro=$(DISTRO)
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 07:45:59 -07: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
OPTIMIZE = 3
2015-03-26 07:45:59 -07:00
ifndef SYMLEVEL
SYMLEVEL = 1
endif
endif
# specify a default optimization level if none explicitly stated
ifndef OPTIMIZE
ifndef SYMBOLS
OPTIMIZE = 3
else
OPTIMIZE = 0
endif
endif
# set the symbols level
ifdef SYMBOLS
ifndef SYMLEVEL
SYMLEVEL = 2
endif
endif
ifdef TOOLS
PARAMS += --with-tools
endif
2015-03-26 07:45:59 -07:00
ifdef SYMBOLS
PARAMS += --SYMBOLS='$(SYMBOLS)'
2015-03-26 07:45:59 -07:00
endif
ifdef SYMLEVEL
PARAMS += --SYMLEVEL='$(SYMLEVEL)'
2015-03-26 07:45:59 -07:00
endif
ifdef PROFILER
PARAMS += --PROFILER='$(PROFILER)'
2015-03-26 07:45:59 -07:00
endif
ifdef PROFILE
PARAMS += --PROFILE='$(PROFILE)'
2015-03-26 07:45:59 -07:00
endif
ifdef OPTIMIZE
PARAMS += --OPTIMIZE=$(OPTIMIZE)
2015-03-26 07:45:59 -07:00
endif
ifdef ARCHOPTS
PARAMS += --ARCHOPTS='$(ARCHOPTS)'
2015-03-26 07:45:59 -07:00
endif
ifdef MAP
2015-03-31 22:11:48 -07:00
PARAMS += --MAP='$(MAP)'
2015-03-26 07:45:59 -07:00
endif
ifdef USE_BGFX
2015-03-31 22:11:48 -07:00
PARAMS += --USE_BGFX='$(USE_BGFX)'
endif
ifdef NOASM
PARAMS += --NOASM='$(NOASM)'
endif
ifdef BIGENDIAN
PARAMS += --BIGENDIAN='$(BIGENDIAN)'
endif
2015-03-31 22:11:48 -07:00
ifdef FORCE_DRC_C_BACKEND
PARAMS += --FORCE_DRC_C_BACKEND='$(FORCE_DRC_C_BACKEND)'
endif
2015-03-27 23:03:44 -07:00
ifdef NOWERROR
PARAMS += --NOWERROR='$(NOWERROR)'
2015-03-27 23:03:44 -07:00
endif
2015-03-28 04:50:15 -07:00
ifdef TARGET
PARAMS += --target='$(TARGET)'
2015-03-28 04:50:15 -07:00
endif
ifdef SUBTARGET
PARAMS += --subtarget='$(SUBTARGET)'
2015-03-28 04:50:15 -07:00
endif
ifdef OSD
PARAMS += --osd='$(OSD)'
2015-03-28 04:50:15 -07:00
endif
ifdef TARGETOS
PARAMS += --targetos='$(TARGETOS)'
2015-03-28 04:50:15 -07:00
endif
2015-03-31 09:44:38 -07:00
ifdef DONT_USE_NETWORK
PARAMS += --DONT_USE_NETWORK='$(DONT_USE_NETWORK)'
endif
2015-03-31 06:41:59 -07:00
ifdef NO_OPENGL
PARAMS += --NO_OPENGL='$(NO_OPENGL)'
endif
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
ifdef DIRECTINPUT
PARAMS += --DIRECTINPUT='$(DIRECTINPUT)'
endif
ifdef USE_SDL
PARAMS += --USE_SDL='$(USE_SDL)'
endif
ifdef CYGWIN_BUILD
PARAMS += --CYGWIN_BUILD='$(CYGWIN_BUILD)'
endif
2015-03-31 07:00:23 -07: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 09:02:58 -07: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 MACOSX_USE_LIBSDL
PARAMS += --MACOSX_USE_LIBSDL='$(MACOSX_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
ifdef CPP11
PARAMS += --CPP11='$(CPP11)'
endif
2015-04-06 07:33:21 -07:00
ifdef FASTDEBUG
PARAMS += --FASTDEBUG='$(FASTDEBUG)'
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/video.lua \
scripts/src/bus.lua \
scripts/src/netlist.lua \
scripts/toolchain.lua \
2015-04-04 07:42:58 -07:00
scripts/src/osd/modules.lua \
scripts/target/$(TARGET)/$(SUBTARGET).lua \
$(wildcard src/osd/$(OSD)/$(OSD).mak) \
$(wildcard src/$(TARGET)/$(SUBTARGET).mak)
ifdef REGENIE
SCRIPTS+= regenie
endif
#-------------------------------------------------
# Dependent stuff
#-------------------------------------------------
2007-12-17 07:19:59 -08:00
# extension for executables
EXE :=
2007-12-17 07:19:59 -08:00
ifeq ($(OS),windows)
EXE := .exe
2007-12-17 07:19:59 -08:00
endif
ifeq ($(OS),os2)
EXE := .exe
2007-12-17 07:19:59 -08:00
endif
SHELLTYPE := msdos
ifeq (,$(ComSpec)$(COMSPEC))
SHELLTYPE := posix
2007-12-17 07:19:59 -08:00
endif
ifeq (/bin,$(findstring /bin,$(SHELL)))
SHELLTYPE := posix
endif
ifeq (posix,$(SHELLTYPE))
MKDIR = $(SILENT) mkdir -p "$(1)"
COPY = $(SILENT) cp -fR "$(1)" "$(2)"
2007-12-17 07:19:59 -08:00
else
MKDIR = $(SILENT) mkdir "$(subst /,\\,$(1))" 2> nul || exit 0
COPY = $(SILENT) copy /Y "$(subst /,\\,$(1))" "$(subst /,\\,$(2))"
2007-12-17 07:19:59 -08:00
endif
GENDIR = build/generated
2007-12-17 07:19:59 -08:00
# all sources are under the src/ directory
SRC = src
# all 3rd party sources are under the 3rdparty/ directory
3RDPARTY = 3rdparty
ifeq ($(OS),windows)
GCC_VERSION := $(shell gcc -dumpversion 2> NUL)
CLANG_VERSION := $(shell %CLANG%\bin\clang --version 2> NUL| head -n 1 | sed "s/[^0-9,.]//g")
PYTHON_AVAILABLE := $(shell python --version > NUL 2>&1 && echo python)
CHECK_CLANG :=
else
GCC_VERSION := $(shell $(subst @,,$(CC)) -dumpversion 2> /dev/null)
CLANG_VERSION := $(shell clang --version 2> /dev/null | grep 'LLVM [0-9]\.[0-9]' -o | grep '[0-9]\.[0-9]' -o | head -n 1)
PYTHON_AVAILABLE := $(shell python --version > /dev/null 2>&1 && echo python)
CHECK_CLANG := $(shell gcc --version 2> /dev/null | grep 'clang' | head -n 1)
2015-03-26 11:07:46 -07:00
endif
ifeq ($(TARGETOS),macosx)
ifneq (,$(findstring 3.,$(CLANG_VERSION)))
ifeq ($(ARCHITECTURE),_x64)
ARCHITECTURE := _x64_clang
2015-03-26 11:07:46 -07:00
else
ARCHITECTURE := _x86_clang
2015-03-26 11:07:46 -07:00
endif
endif
endif
ifneq ($(PYTHON_AVAILABLE),python)
$(error Python is not available in path)
endif
2007-12-17 07:19:59 -08:00
GENIE := 3rdparty/genie/bin/$(GENIEOS)/genie$(EXE)
2007-12-17 07:19:59 -08:00
ifeq ($(TARGET),$(SUBTARGET))
SUBDIR := $(OSD)/$(TARGET)
else
SUBDIR := $(OSD)/$(TARGET)$(SUBTARGET)
endif
PROJECTDIR := build/projects/$(SUBDIR)
.PHONY: all clean regenie generate
all: $(GENIE) $(TARGETOS)$(ARCHITECTURE)
regenie:
2007-12-17 07:19:59 -08:00
#-------------------------------------------------
# gmake-mingw64-gcc
#-------------------------------------------------
$(PROJECTDIR)/gmake-mingw64-gcc/Makefile: makefile $(SCRIPTS) $(GENIE)
ifndef MINGW64
$(error MINGW64 is not set)
2007-12-17 07:19:59 -08:00
endif
2015-03-28 04:50:15 -07:00
$(SILENT) $(GENIE) $(PARAMS) --gcc=mingw64-gcc --gcc_version=$(GCC_VERSION) gmake
.PHONY: windows_x64
windows_x64: generate $(PROJECTDIR)/gmake-mingw64-gcc/Makefile
$(SILENT) $(MAKE) $(MAKEPARAMS) -C $(PROJECTDIR)/gmake-mingw64-gcc config=$(CONFIG)64 WINDRES=$(WINDRES)
2007-12-17 07:19:59 -08:00
#-------------------------------------------------
# gmake-mingw32-gcc
#-------------------------------------------------
.PHONY: windows
windows: windows_x86
$(PROJECTDIR)/gmake-mingw32-gcc/Makefile: makefile $(SCRIPTS) $(GENIE)
ifndef MINGW32
$(error MINGW32 is not set)
2007-12-17 07:19:59 -08:00
endif
2015-03-28 04:50:15 -07:00
$(SILENT) $(GENIE) $(PARAMS) --gcc=mingw32-gcc --gcc_version=$(GCC_VERSION) gmake
.PHONY: windows_x86
windows_x86: generate $(PROJECTDIR)/gmake-mingw32-gcc/Makefile
$(SILENT) $(MAKE) $(MAKEPARAMS) -C $(PROJECTDIR)/gmake-mingw32-gcc config=$(CONFIG)32 WINDRES=$(WINDRES)
2007-12-17 07:19:59 -08:00
#-------------------------------------------------
# gmake-mingw-clang
#-------------------------------------------------
$(PROJECTDIR)/gmake-mingw-clang/Makefile: makefile $(SCRIPTS) $(GENIE)
ifndef CLANG
$(error CLANG is not set)
endif
2015-03-28 04:50:15 -07:00
$(SILENT) $(GENIE) $(PARAMS) --gcc=mingw-clang --gcc_version=$(CLANG_VERSION) gmake
.PHONY: windows_x64_clang
windows_x64_clang: generate $(PROJECTDIR)/gmake-mingw-clang/Makefile
$(SILENT) $(MAKE) $(MAKEPARAMS) -C $(PROJECTDIR)/gmake-mingw-clang config=$(CONFIG)64 WINDRES=$(WINDRES)
.PHONY: windows_x86_clang
windows_x86_clang: generate $(PROJECTDIR)/gmake-mingw-clang/Makefile
$(SILENT) $(MAKE) $(MAKEPARAMS) -C $(PROJECTDIR)/gmake-mingw-clang config=$(CONFIG)32 WINDRES=$(WINDRES)
vs2010: generate
2015-03-28 04:50:15 -07:00
$(SILENT) $(GENIE) $(PARAMS) vs2010
Move devices into a proper hierarchy and handle naming and paths consistently for devices, I/O ports, memory regions, memory banks, and memory shares. [Aaron Giles] NOTE: there are likely regressions lurking here, mostly due to devices not being properly found. I have temporarily added more logging to -verbose to help understand what's going on. Please let me know ASAP if anything that is being actively worked on got broken. As before, the driver device is the root device and all other devices are owned by it. Previously all devices were kept in a single master list, and the hierarchy was purely logical. With this change, each device owns its own list of subdevices, and the hierarchy is explicitly manifest. This means when a device is removed, all of its subdevices are automatically removed as well. A side effect of this is that walking the device list is no longer simple. To address this, a new set of iterator classes is provided, which walks the device tree in a depth first manner. There is a general device_iterator class for walking all devices, plus templates for a device_type_iterator and a device_interface_iterator which are used to build iterators for identifying only devices of a given type or with a given interface. Typedefs for commonly-used cases (e.g., screen_device_iterator, memory_interface_iterator) are provided. Iterators can also provide counts, and can perform indexed lookups. All device name lookups are now done relative to another device. The maching_config and running_machine classes now have a root_device() method to get the root of the hierarchy. The existing machine->device("name") is now equivalent to machine->root_device().subdevice("name"). A proper and normalized device path structure is now supported. Device names that start with a colon are treated as absolute paths from the root device. Device names can also use a caret (^) to refer to the owning device. Querying the device's tag() returns the device's full path from the root. A new method basetag() returns just the final tag. The new pathing system is built on top of the device_t::subtag() method, so anyone using that will automatically support the new pathing rules. Each device has its own internal map to cache successful lookups so that subsequent lookups should be very fast. Updated every place I could find that referenced devices, memory regions, I/O ports, memory banks and memory shares to leverage subtag/subdevice (or siblingtag/siblingdevice which are built on top). Removed the device_list class, as it doesn't apply any more. Moved some of its methods into running_machine instead. Simplified the device callback system since the new pathing can describe all of the special-case devices that were previously handled manually. Changed the core output function callbacks to be delegates. Completely rewrote the validity checking mechanism. The validity checker is now a proper C++ class, and temporarily takes over the error and warning outputs. All errors and warnings are collected during a session, and then output in a consistent manner, with an explicit driver and source file listed for each one, as well as additional device and/or I/O port contexts where appropriate. Validity checkers should no longer explicitly output this information, just the error, assuming that the context is provided. Rewrote the software_list_device as a modern device, getting rid of the software_list_config abstraction and simplifying things. Changed the way FLAC compiles so that it works like other external libraries, and also compiles successfully for MSVC builds.
2012-01-24 12:18:55 -08:00
vs2012: generate
2015-03-28 04:50:15 -07:00
$(SILENT) $(GENIE) $(PARAMS) vs2012
2015-01-13 09:44:26 -08:00
vs2012_intel: generate
2015-03-28 04:50:15 -07:00
$(SILENT) $(GENIE) $(PARAMS) --vs=intel-15 vs2012
2007-12-17 07:19:59 -08:00
vs2012_xp: generate
2015-03-28 04:50:15 -07:00
$(SILENT) $(GENIE) $(PARAMS) --vs=vs2012-xp vs2012
2007-12-17 07:19:59 -08:00
vs2013: generate
2015-03-28 04:50:15 -07:00
$(SILENT) $(GENIE) $(PARAMS) vs2013
2007-12-17 08:37:57 -08:00
vs2013_intel: generate
2015-03-28 04:50:15 -07:00
$(SILENT) $(GENIE) $(PARAMS) --vs=intel-15 vs2013
2007-12-17 07:19:59 -08:00
vs2013_xp: generate
2015-03-28 04:50:15 -07:00
$(SILENT) $(GENIE) $(PARAMS) --vs=vs2013-xp vs2013
vs2015: generate
2015-03-28 04:50:15 -07:00
$(SILENT) $(GENIE) $(PARAMS) vs2015
android-arm: generate
ifndef ANDROID_NDK_ARM
$(error ANDROID_NDK_ARM is not set)
endif
ifndef ANDROID_NDK_ROOT
$(error ANDROID_NDK_ROOT is not set)
2007-12-17 07:19:59 -08:00
endif
ifndef COMPILE
2015-03-28 04:50:15 -07:00
$(SILENT) $(GENIE) $(PARAMS) --gcc=android-arm --gcc_version=4.8 gmake
endif
$(SILENT) $(MAKE) $(MAKEPARAMS) -C $(PROJECTDIR)/gmake-android-arm config=$(CONFIG)
android-mips: generate
ifndef ANDROID_NDK_MIPS
$(error ANDROID_NDK_MIPS is not set)
endif
ifndef ANDROID_NDK_ROOT
$(error ANDROID_NDK_ROOT is not set)
endif
ifndef COMPILE
2015-03-28 04:50:15 -07:00
$(SILENT) $(GENIE) $(PARAMS) --gcc=android-mips --gcc_version=4.8 gmake
endif
$(SILENT) $(MAKE) $(MAKEPARAMS) -C $(PROJECTDIR)/gmake-android-mips config=$(CONFIG)
android-x86: generate
ifndef ANDROID_NDK_X86
$(error ANDROID_NDK_X86 is not set)
endif
ifndef ANDROID_NDK_ROOT
$(error ANDROID_NDK_ROOT is not set)
endif
ifndef COMPILE
2015-03-28 04:50:15 -07:00
$(SILENT) $(GENIE) $(PARAMS) --gcc=android-x86 --gcc_version=4.8 gmake
endif
$(SILENT) $(MAKE) $(MAKEPARAMS) -C $(PROJECTDIR)/gmake-android-x86 config=$(CONFIG)
asmjs: generate
ifndef EMSCRIPTEN
$(error EMSCRIPTEN is not set)
endif
ifndef COMPILE
2015-03-28 04:50:15 -07:00
$(SILENT) $(GENIE) $(PARAMS) --gcc=asmjs --gcc_version=4.8 gmake
endif
$(SILENT) $(MAKE) $(MAKEPARAMS) -C $(PROJECTDIR)/gmake-asmjs config=$(CONFIG)
nacl: nacl_x86
nacl_x64: generate
ifndef NACL_SDK_ROOT
$(error NACL_SDK_ROOT is not set)
endif
ifndef COMPILE
2015-03-28 04:50:15 -07:00
$(SILENT) $(GENIE) $(PARAMS) --gcc=nacl --gcc_version=4.8 gmake
endif
$(SILENT) $(MAKE) $(MAKEPARAMS) -C $(PROJECTDIR)/gmake-nacl config=$(CONFIG)64
2007-12-17 07:19:59 -08:00
nacl_x86: generate
ifndef NACL_SDK_ROOT
$(error NACL_SDK_ROOT is not set)
2007-12-17 07:19:59 -08:00
endif
ifndef COMPILE
2015-03-28 04:50:15 -07:00
$(SILENT) $(GENIE) $(PARAMS) --gcc=nacl --gcc_version=4.8 gmake
endif
$(SILENT) $(MAKE) $(MAKEPARAMS) -C $(PROJECTDIR)/gmake-nacl config=$(CONFIG)32
2007-12-17 07:19:59 -08:00
nacl-arm: generate
ifndef NACL_SDK_ROOT
$(error NACL_SDK_ROOT is not set)
2007-12-17 07:19:59 -08:00
endif
ifndef COMPILE
2015-03-28 04:50:15 -07:00
$(SILENT) $(GENIE) $(PARAMS) --gcc=nacl-arm --gcc_version=4.8 gmake
2007-12-17 07:19:59 -08:00
endif
$(SILENT) $(MAKE) $(MAKEPARAMS) -C $(PROJECTDIR)/gmake-nacl-arm config=$(CONFIG)
2007-12-17 07:19:59 -08:00
pnacl: generate
ifndef NACL_SDK_ROOT
$(error NACL_SDK_ROOT is not set)
endif
ifndef COMPILE
2015-03-28 04:50:15 -07:00
$(SILENT) $(GENIE) $(PARAMS) --gcc=pnacl --gcc_version=4.8 gmake
endif
$(SILENT) $(MAKE) $(MAKEPARAMS) -C $(PROJECTDIR)/gmake-pnacl config=$(CONFIG)
#-------------------------------------------------
# gmake-linux
#-------------------------------------------------
$(PROJECTDIR)/gmake-linux/Makefile: makefile $(SCRIPTS) $(GENIE)
2015-03-28 04:50:15 -07:00
$(SILENT) $(GENIE) $(PARAMS) --gcc=linux-gcc --gcc_version=$(GCC_VERSION) gmake
.PHONY: linux_x64
linux_x64: generate $(PROJECTDIR)/gmake-linux/Makefile
$(SILENT) $(MAKE) $(MAKEPARAMS) -C $(PROJECTDIR)/gmake-linux config=$(CONFIG)64
2007-12-17 07:19:59 -08:00
.PHONY: linux
linux: linux_x86
.PHONY: linux_x86
linux_x86: generate $(PROJECTDIR)/gmake-linux/Makefile
$(SILENT) $(MAKE) $(MAKEPARAMS) -C $(PROJECTDIR)/gmake-linux config=$(CONFIG)32
2007-12-17 07:19:59 -08:00
#-------------------------------------------------
# gmake-linux-clang
#-------------------------------------------------
2007-12-17 07:19:59 -08:00
$(PROJECTDIR)/gmake-linux-clang/Makefile: makefile $(SCRIPTS) $(GENIE)
2015-03-28 04:50:15 -07:00
$(SILENT) $(GENIE) $(PARAMS) --gcc=linux-clang --gcc_version=$(CLANG_VERSION) gmake
.PHONY: linux_x64_clang
linux_x64_clang: generate $(PROJECTDIR)/gmake-linux-clang/Makefile
$(SILENT) $(MAKE) $(MAKEPARAMS) -C $(PROJECTDIR)/gmake-linux-clang config=$(CONFIG)64
.PHONY: linux_x86_clang
linux_x86_clang: generate $(PROJECTDIR)/gmake-linux-clang/Makefile
$(SILENT) $(MAKE) $(MAKEPARAMS) -C $(PROJECTDIR)/gmake-linux-clang config=$(CONFIG)32
2007-12-17 07:19:59 -08:00
#-------------------------------------------------
# gmake-osx
#-------------------------------------------------
$(PROJECTDIR)/gmake-osx/Makefile: makefile $(SCRIPTS) $(GENIE)
$(SILENT) $(GENIE) $(PARAMS) --gcc=osx --gcc_version=$(GCC_VERSION) gmake
.PHONY: macosx_x64
macosx_x64: generate $(PROJECTDIR)/gmake-osx/Makefile
$(SILENT) $(MAKE) $(MAKEPARAMS) -C $(PROJECTDIR)/gmake-osx config=$(CONFIG)64
2007-12-17 07:19:59 -08:00
.PHONY: macosx
macosx: macosx_x86
.PHONY: macosx_x86
macosx_x86: generate $(PROJECTDIR)/gmake-osx/Makefile
$(SILENT) $(MAKE) $(MAKEPARAMS) -C $(PROJECTDIR)/gmake-osx config=$(CONFIG)32
2007-12-17 07:19:59 -08:00
#-------------------------------------------------
# gmake-osx-clang
#-------------------------------------------------
2015-03-26 11:07:46 -07:00
$(PROJECTDIR)/gmake-osx-clang/Makefile: makefile $(SCRIPTS) $(GENIE)
$(SILENT) $(GENIE) $(PARAMS) --gcc=osx-clang --gcc_version=$(CLANG_VERSION) gmake
.PHONY: macosx_x64_clang
macosx_x64_clang: generate $(PROJECTDIR)/gmake-osx-clang/Makefile
$(SILENT) $(MAKE) $(MAKEPARAMS) -C $(PROJECTDIR)/gmake-osx-clang config=$(CONFIG)64
.PHONY: macosx_x86_clang
macosx_x86_clang: generate $(PROJECTDIR)/gmake-osx-clang/Makefile
$(SILENT) $(MAKE) $(MAKEPARAMS) -C $(PROJECTDIR)/gmake-osx-clang config=$(CONFIG)32
2015-03-26 11:07:46 -07:00
2015-04-02 09:16:20 -07:00
xcode4: generate
$(SILENT) $(GENIE) $(PARAMS) --targetos=macosx --xcode=osx xcode4
xcode4-ios: generate
$(SILENT) $(GENIE) $(PARAMS) --targetos=macosx --xcode=ios xcode4
#-------------------------------------------------
# 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 07:19:59 -08:00
3rdparty/genie/src/hosts/%.c:
clean:
@echo Cleaning...
-@rm -rf build
$(SILENT) $(MAKE) $(MAKEPARAMS) -C 3rdparty/genie/build/gmake.$(GENIEOS) -f genie.make clean
2007-12-17 07:19:59 -08:00
2015-04-04 07:42:58 -07:00
GEN_FOLDERS := $(GENDIR)/$(TARGET)/layout/
2007-12-17 07:19:59 -08:00
LAYOUTS=$(wildcard $(SRC)/$(TARGET)/layout/*.lay)
2007-12-17 07:19:59 -08:00
ifneq (,$(wildcard src/osd/$(OSD)/$(OSD).mak))
include src/osd/$(OSD)/$(OSD).mak
endif
ifneq (,$(wildcard src/$(TARGET)/$(SUBTARGET).mak))
include src/$(TARGET)/$(SUBTARGET).mak
endif
$(GEN_FOLDERS):
-$(call MKDIR,$@)
generate: \
$(GENIE) \
$(GEN_FOLDERS) \
2015-04-04 07:42:58 -07:00
$(patsubst $(SRC)/%.lay,$(GENDIR)/%.lh,$(LAYOUTS))
$(GENDIR)/%.lh: $(SRC)/%.lay $(SRC)/build/file2str.py
@echo Converting $<...
$(PYTHON) $(SRC)/build/file2str.py $< $@ layout_$(basename $(notdir $<))
2007-12-17 07:19:59 -08:00