mame/makefile

775 lines
23 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 #####################
###########################################################################
2015-03-26 06:43:39 -07:00
ifdef TOOLS
PARAMS+= --with-tools
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
endif
ifndef SUBTARGET
SUBTARGET = $(TARGET)
endif
#-------------------------------------------------
# specify OSD layer: windows, sdl, etc.
# build rules will be included from
2007-12-17 07:19:59 -08:00
# src/osd/$(OSD)/$(OSD).mak
#-------------------------------------------------
ifndef OSD
ifeq ($(OS),Windows_NT)
2007-12-17 07:19:59 -08:00
OSD = windows
else
OSD = sdl
endif
2007-12-17 07:19:59 -08:00
endif
CONFIG = release
ifdef DEBUG
CONFIG = debug
endif
2007-12-17 07:19:59 -08:00
ifndef verbose
SILENT = @
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_NT)
2010-01-19 13:53:06 -08:00
TARGETOS = windows
OS=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
2010-01-19 13:53:06 -08:00
else
WINDRES=x86_64-w64-mingw32-windres
UNAME = $(shell uname -mps)
OS=linux
ifeq ($(firstword $(filter Linux,$(UNAME))),Linux)
TARGETOS = linux
2007-12-17 07:19:59 -08:00
endif
ifeq ($(firstword $(filter Solaris,$(UNAME))),Solaris)
TARGETOS = solaris
endif
ifeq ($(firstword $(filter FreeBSD,$(UNAME))),FreeBSD)
TARGETOS = freebsd
endif
ifeq ($(firstword $(filter GNU/kFreeBSD,$(UNAME))),GNU/kFreeBSD)
TARGETOS = freebsd
endif
ifeq ($(firstword $(filter NetBSD,$(UNAME))),NetBSD)
TARGETOS = netbsd
endif
ifeq ($(firstword $(filter OpenBSD,$(UNAME))),OpenBSD)
TARGETOS = openbsd
endif
ifeq ($(firstword $(filter Darwin,$(UNAME))),Darwin)
TARGETOS = macosx
OS=darwin
DARWIN_VERSION = $(shell sw_vers -productVersion)
2007-12-17 07:19:59 -08:00
endif
2012-05-28 11:16:17 -07:00
ifeq ($(firstword $(filter Haiku,$(UNAME))),Haiku)
TARGETOS = haiku
endif
2007-12-17 07:19:59 -08:00
ifndef TARGETOS
$(error Unable to detect TARGETOS from uname -a: $(UNAME))
endif
ARCHITECTURE = x86
ifeq ($(firstword $(filter x86_64,$(UNAME))),x86_64)
ARCHITECTURE = x64
endif
ifeq ($(firstword $(filter amd64,$(UNAME))),amd64)
ARCHITECTURE = x64
endif
2007-12-17 07:19:59 -08:00
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
endif
endif
2015-03-26 06:01:14 -07:00
PYTHON = @python
CC = @gcc
LD = @g++
2015-03-26 06:01:14 -07:00
#-------------------------------------------------
# distribution may change things
#-------------------------------------------------
ifeq ($(DISTRO),)
DISTRO = generic
else
ifeq ($(DISTRO),debian-stable)
else
ifeq ($(DISTRO),ubuntu-intrepid)
# Force gcc-4.2 on ubuntu-intrepid
CC = @gcc -V 4.2
LD = @g++-4.2
2015-03-26 06:01:14 -07:00
else
ifeq ($(DISTRO),gcc44-generic)
CC = @gcc-4.4
LD = @g++-4.4
2015-03-26 06:01:14 -07:00
else
ifeq ($(DISTRO),gcc45-generic)
CC = @gcc-4.5
LD = @g++-4.5
2015-03-26 06:01:14 -07:00
else
ifeq ($(DISTRO),gcc46-generic)
CC = @gcc-4.6
LD = @g++-4.6
2015-03-26 06:01:14 -07:00
else
ifeq ($(DISTRO),gcc47-generic)
CC = @gcc-4.7
LD = @g++-4.7
2015-03-26 06:01:14 -07:00
else
$(error DISTRO $(DISTRO) unknown)
endif
endif
endif
endif
endif
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
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 SYMBOLS
PARAMS+= --SYMBOLS=$(SYMBOLS)
endif
ifdef SYMLEVEL
PARAMS+= --SYMLEVEL=$(SYMLEVEL)
endif
ifdef PROFILER
PARAMS+= --PROFILER=$(PROFILER)
endif
ifdef PROFILE
PARAMS+= --PROFILE=$(PROFILE)
endif
ifdef OPTIMIZE
PARAMS+= --OPTIMIZE=$(OPTIMIZE)
endif
ifdef ARCHOPTS
PARAMS+= --ARCHOPTS='$(ARCHOPTS)'
2015-03-26 07:45:59 -07:00
endif
ifdef MAP
PARAMS+= --MAP=$(MAP)
endif
ifdef USE_BGFX
PARAMS+= --USE_BGFX=$(USE_BGFX)
endif
2015-03-27 23:03:44 -07:00
ifdef NOWERROR
PARAMS+= --NOWERROR=$(NOWERROR)
endif
2015-03-28 04:50:15 -07:00
ifdef TARGET
PARAMS+= --target=$(TARGET)
endif
ifdef SUBTARGET
PARAMS+= --subtarget=$(SUBTARGET)
endif
ifdef OSD
PARAMS+= --osd=$(OSD)
endif
ifdef TARGETOS
PARAMS+= --targetos=$(TARGETOS)
endif
2007-12-17 07:19:59 -08:00
# extension for executables
EXE =
2007-12-17 07:19:59 -08:00
ifeq ($(OS),windows)
2007-12-17 07:19:59 -08:00
EXE = .exe
endif
ifeq ($(OS),os2)
2007-12-17 07:19:59 -08:00
EXE = .exe
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)
2015-03-26 11:07:46 -07:00
CHECK_CLANG:=
else
2015-03-26 14:40:11 -07:00
GCC_VERSION:=$(shell $(subst @,,$(CC)) -dumpversion 2> /dev/null)
2015-03-26 11:07:46 -07:00
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)
2015-03-26 11:07:46 -07:00
CHECK_CLANG:=$(shell gcc --version 2> /dev/null | grep 'clang' | head -n 1)
endif
ifeq ($(TARGETOS),macosx)
ifneq (,$(findstring 3.,$(CLANG_VERSION)))
2015-03-26 11:07:46 -07:00
ifeq ($(ARCHITECTURE),x64)
ARCHITECTURE=x64_clang
else
ARCHITECTURE=x86_clang
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/$(OS)/genie
2007-12-17 07:19:59 -08:00
SILENT?=@
2007-12-17 07:19:59 -08:00
ifeq ($(TARGET),$(SUBTARGET))
SUBDIR = $(OSD)/$(TARGET)
else
SUBDIR = $(OSD)/$(TARGET)$(SUBTARGET)
endif
all: $(GENIE) $(TARGETOS)_$(ARCHITECTURE)
2007-12-17 07:19:59 -08:00
windows_x64: generate
ifndef MINGW64
$(error MINGW64 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=mingw64-gcc --gcc_version=$(GCC_VERSION) gmake
2007-12-17 07:19:59 -08:00
endif
$(SILENT) $(MAKE) --no-print-directory -R -C build/projects/$(SUBDIR)/gmake-mingw64-gcc config=$(CONFIG)64 WINDRES=$(WINDRES)
2007-12-17 07:19:59 -08:00
windows_x86: generate
ifndef MINGW32
$(error MINGW32 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=mingw32-gcc --gcc_version=$(GCC_VERSION) gmake
2007-12-17 07:19:59 -08:00
endif
$(SILENT) $(MAKE) --no-print-directory -R -C build/projects/$(SUBDIR)/gmake-mingw32-gcc config=$(CONFIG)32 WINDRES=$(WINDRES)
2007-12-17 07:19:59 -08:00
windows_x64_clang: generate
ifndef CLANG
$(error CLANG is not set)
endif
ifndef COMPILE
2015-03-28 04:50:15 -07:00
$(SILENT) $(GENIE) $(PARAMS) --gcc=mingw-clang --gcc_version=$(CLANG_VERSION) gmake
2007-12-17 07:19:59 -08:00
endif
$(SILENT) $(MAKE) --no-print-directory -R -C build/projects/$(SUBDIR)/gmake-mingw-clang config=$(CONFIG)64 WINDRES=$(WINDRES)
windows_x86_clang: generate
ifndef CLANG
$(error CLANG is not set)
endif
ifndef COMPILE
2015-03-28 04:50:15 -07:00
$(SILENT) $(GENIE) $(PARAMS) --gcc=mingw-clang --gcc_version=$(CLANG_VERSION) gmake
endif
$(SILENT) $(MAKE) --no-print-directory -R -C build/projects/$(SUBDIR)/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) --no-print-directory -R -C build/projects/$(SUBDIR)/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) --no-print-directory -R -C build/projects/$(SUBDIR)/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) --no-print-directory -R -C build/projects/$(SUBDIR)/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) --no-print-directory -R -C build/projects/$(SUBDIR)/gmake-asmjs config=$(CONFIG)
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) --no-print-directory -R -C build/projects/$(SUBDIR)/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) --no-print-directory -R -C build/projects/$(SUBDIR)/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) --no-print-directory -R -C build/projects/$(SUBDIR)/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) --no-print-directory -R -C build/projects/$(SUBDIR)/gmake-pnacl config=$(CONFIG)
linux_x64: generate
ifndef COMPILE
2015-03-28 04:50:15 -07:00
$(SILENT) $(GENIE) $(PARAMS) --gcc=linux-gcc --gcc_version=$(GCC_VERSION) gmake
2007-12-17 07:19:59 -08:00
endif
$(SILENT) $(MAKE) --no-print-directory -R -C build/projects/$(SUBDIR)/gmake-linux config=$(CONFIG)64
2007-12-17 07:19:59 -08:00
linux_x86: generate
ifndef COMPILE
2015-03-28 04:50:15 -07:00
$(SILENT) $(GENIE) $(PARAMS) --gcc=linux-gcc --gcc_version=$(GCC_VERSION) gmake
endif
$(SILENT) $(MAKE) --no-print-directory -R -C build/projects/$(SUBDIR)/gmake-linux config=$(CONFIG)32
2007-12-17 07:19:59 -08:00
linux_x64_clang: generate
ifndef COMPILE
2015-03-28 04:50:15 -07:00
$(SILENT) $(GENIE) $(PARAMS) --gcc=linux-clang --gcc_version=$(CLANG_VERSION) gmake
endif
$(SILENT) $(MAKE) --no-print-directory -R -C build/projects/$(SUBDIR)/gmake-linux-clang config=$(CONFIG)64
2007-12-17 07:19:59 -08:00
linux_x86_clang: generate
ifndef COMPILE
2015-03-28 04:50:15 -07:00
$(SILENT) $(GENIE) $(PARAMS) --gcc=linux-clang --gcc_version=$(CLANG_VERSION) gmake
endif
$(SILENT) $(MAKE) --no-print-directory -R -C build/projects/$(SUBDIR)/gmake-linux-clang config=$(CONFIG)32
2007-12-17 07:19:59 -08:00
macosx_x64: generate
ifndef COMPILE
2015-03-28 04:50:15 -07:00
$(SILENT) $(GENIE) $(PARAMS) --gcc=osx --gcc_version=$(GCC_VERSION) gmake
endif
$(SILENT) $(MAKE) --no-print-directory -R -C build/projects/$(SUBDIR)/gmake-osx config=$(CONFIG)64
2007-12-17 07:19:59 -08:00
macosx_x86: generate
ifndef COMPILE
2015-03-28 04:50:15 -07:00
$(SILENT) $(GENIE) $(PARAMS) --gcc=osx --os_version=$(DARWIN_VERSION) --gcc_version=$(GCC_VERSION) gmake
endif
$(SILENT) $(MAKE) --no-print-directory -R -C build/projects/$(SUBDIR)/gmake-osx config=$(CONFIG)32
2007-12-17 07:19:59 -08:00
2015-03-26 11:07:46 -07:00
macosx_x64_clang: generate
ifndef COMPILE
2015-03-28 04:50:15 -07:00
$(SILENT) $(GENIE) $(PARAMS) --gcc=osx-clang --gcc_version=$(CLANG_VERSION) gmake
2015-03-26 11:07:46 -07:00
endif
$(SILENT) $(MAKE) --no-print-directory -R -C build/projects/$(SUBDIR)/gmake-osx-clang config=$(CONFIG)64
2015-03-26 11:07:46 -07:00
macosx_x86_clang: generate
ifndef COMPILE
2015-03-28 04:50:15 -07:00
$(SILENT) $(GENIE) $(PARAMS) --gcc=osx-clang --os_version=$(DARWIN_VERSION) --gcc_version=$(CLANG_VERSION) gmake
2015-03-26 11:07:46 -07:00
endif
$(SILENT) $(MAKE) --no-print-directory -R -C build/projects/$(SUBDIR)/gmake-osx-clang config=$(CONFIG)32
2015-03-26 11:07:46 -07:00
$(GENIE):
$(SILENT) $(MAKE) --no-print-directory -R -C 3rdparty/genie/build/gmake.$(OS) -f genie.make
2007-12-17 07:19:59 -08:00
clean:
@echo Cleaning...
-@rm -rf build
$(SILENT) $(MAKE) --no-print-directory -R -C 3rdparty/genie/build/gmake.$(OS) -f genie.make clean
2007-12-17 07:19:59 -08:00
GEN_FOLDERS := \
$(GENDIR) \
$(GENDIR)/$(TARGET)/$(SUBTARGET) \
$(GENDIR)/emu/layout/ \
$(GENDIR)/mame/layout/ \
$(GENDIR)/mess/layout/ \
$(GENDIR)/mess/drivers/ \
2015-03-26 01:20:27 -07:00
$(GENDIR)/ldplayer/layout/ \
$(GENDIR)/emu/cpu/arcompact/ \
$(GENDIR)/emu/cpu/h8/ \
$(GENDIR)/emu/cpu/mcs96/ \
$(GENDIR)/emu/cpu/m6502/ \
$(GENDIR)/emu/cpu/m6809/ \
$(GENDIR)/emu/cpu/m68000/ \
$(GENDIR)/emu/cpu/tms57002/ \
$(GENDIR)/osd/modules/debugger/qt/ \
$(GENDIR)/resource/
2007-12-17 07:19:59 -08:00
2015-03-26 01:20:27 -07:00
LAYOUTS=$(wildcard $(SRC)/emu/layout/*.lay) $(wildcard $(SRC)/mame/layout/*.lay) $(wildcard $(SRC)/mess/layout/*.lay) $(wildcard $(SRC)/ldplayer/layout/*.lay)
2007-12-17 07:19:59 -08:00
ifeq ($(TARGETOS),macosx)
MOC_FILES=
2007-12-17 07:19:59 -08:00
else
MOC_FILES=$(wildcard $(SRC)/osd/modules/debugger/qt/*.h)
2007-12-17 07:19:59 -08:00
ifeq ($(TARGETOS),windows)
MOC = moc
ifneq ($(OSD),sdl)
MOC_FILES=
2007-12-17 07:19:59 -08:00
endif
else
MOCTST = $(shell which moc-qt4 2>/dev/null)
ifeq '$(MOCTST)' ''
MOCTST = $(shell which moc 2>/dev/null)
ifeq '$(MOCTST)' ''
$(error Qt's Meta Object Compiler (moc) wasn't found!)
else
MOC = $(MOCTST)
endif
else
MOC = $(MOCTST)
endif
endif
endif
ifneq (,$(wildcard src/osd/$(OSD)/$(OSD).mak))
include src/osd/$(OSD)/$(OSD).mak
endif
$(GEN_FOLDERS):
-$(call MKDIR,$@)
generate: \
$(GENIE) \
$(GEN_FOLDERS) \
$(patsubst $(SRC)/%.lay,$(GENDIR)/%.lh,$(LAYOUTS)) \
$(patsubst $(SRC)/%.h,$(GENDIR)/%.moc.c,$(MOC_FILES)) \
$(GENDIR)/emu/uismall.fh \
$(GENDIR)/resource/$(TARGET)vers.rc \
$(GENDIR)/resource/$(TARGET)-Info.plist \
$(GENDIR)/$(TARGET)/$(SUBTARGET)/drivlist.c \
2015-03-28 03:33:59 -07:00
$(GENDIR)/mess/drivers/ymmu100.inc \
$(GENDIR)/emu/cpu/arcompact/arcompact.inc \
$(GENDIR)/emu/cpu/h8/h8.inc $(GENDIR)/emu/cpu/h8/h8h.inc $(GENDIR)/emu/cpu/h8/h8s2000.inc $(GENDIR)/emu/cpu/h8/h8s2600.inc \
$(GENDIR)/emu/cpu/mcs96/mcs96.inc $(GENDIR)/emu/cpu/mcs96/i8x9x.inc $(GENDIR)/emu/cpu/mcs96/i8xc196.inc \
$(GENDIR)/emu/cpu/m6502/deco16.inc $(GENDIR)/emu/cpu/m6502/m4510.inc $(GENDIR)/emu/cpu/m6502/m6502.inc $(GENDIR)/emu/cpu/m6502/m65c02.inc $(GENDIR)/emu/cpu/m6502/m65ce02.inc $(GENDIR)/emu/cpu/m6502/m6509.inc $(GENDIR)/emu/cpu/m6502/m6510.inc $(GENDIR)/emu/cpu/m6502/n2a03.inc $(GENDIR)/emu/cpu/m6502/r65c02.inc $(GENDIR)/emu/cpu/m6502/m740.inc \
$(GENDIR)/emu/cpu/m6809/m6809.inc $(GENDIR)/emu/cpu/m6809/hd6309.inc $(GENDIR)/emu/cpu/m6809/konami.inc \
$(GENDIR)/emu/cpu/tms57002/tms57002.inc \
$(GENDIR)/m68kmake$(EXE) $(GENDIR)/emu/cpu/m68000/m68kops.c
$(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
$(GENDIR)/%.fh: $(SRC)/%.png $(SRC)/build/png2bdc.py $(SRC)/build/file2str.py
@echo Converting $<...
$(PYTHON) $(SRC)/build/png2bdc.py $< $(GENDIR)/temp.bdc
$(PYTHON) $(SRC)/build/file2str.py $(GENDIR)/temp.bdc $@ font_$(basename $(notdir $<)) UINT8
2007-12-17 07:19:59 -08:00
$(GENDIR)/resource/$(TARGET)vers.rc: $(SRC)/build/verinfo.py $(SRC)/version.c
@echo Emitting $@...
$(PYTHON) $(SRC)/build/verinfo.py -r -b $(TARGET) $(SRC)/version.c > $@
$(GENDIR)/resource/$(TARGET)-Info.plist: $(SRC)/build/verinfo.py $(SRC)/version.c
@echo Emitting $@...
$(PYTHON) $(SRC)/build/verinfo.py -p -b $(TARGET) $(SRC)/version.c > $@
2007-12-17 07:19:59 -08:00
$(GENDIR)/$(TARGET)/$(SUBTARGET)/drivlist.c: $(SRC)/$(TARGET)/$(SUBTARGET).lst $(SRC)/build/makelist.py
@echo Building driver list $<...
$(PYTHON) $(SRC)/build/makelist.py $< >$@
# rule to generate the C files
$(GENDIR)/emu/cpu/arcompact/arcompact.inc: $(SRC)/emu/cpu/arcompact/arcompact_make.py
@echo Generating arcompact source .inc files...
$(PYTHON) $(SRC)/emu/cpu/arcompact/arcompact_make.py $@
2007-12-17 07:19:59 -08:00
$(GENDIR)/emu/cpu/h8/h8.inc: $(SRC)/emu/cpu/h8/h8make.py $(SRC)/emu/cpu/h8/h8.lst
@echo Generating H8-300 source file...
$(PYTHON) $(SRC)/emu/cpu/h8/h8make.py $(SRC)/emu/cpu/h8/h8.lst o $@
2007-12-17 07:19:59 -08:00
$(GENDIR)/emu/cpu/h8/h8h.inc: $(SRC)/emu/cpu/h8/h8make.py $(SRC)/emu/cpu/h8/h8.lst
@echo Generating H8-300H source file...
$(PYTHON) $(SRC)/emu/cpu/h8/h8make.py $(SRC)/emu/cpu/h8/h8.lst h $@
2007-12-17 07:19:59 -08:00
$(GENDIR)/emu/cpu/h8/h8s2000.inc: $(SRC)/emu/cpu/h8/h8make.py $(SRC)/emu/cpu/h8/h8.lst
@echo Generating H8S/2000 source file...
$(PYTHON) $(SRC)/emu/cpu/h8/h8make.py $(SRC)/emu/cpu/h8/h8.lst s20 $@
2007-12-17 07:19:59 -08:00
$(GENDIR)/emu/cpu/h8/h8s2600.inc: $(SRC)/emu/cpu/h8/h8make.py $(SRC)/emu/cpu/h8/h8.lst
@echo Generating H8S/2600 source file...
$(PYTHON) $(SRC)/emu/cpu/h8/h8make.py $(SRC)/emu/cpu/h8/h8.lst s26 $@
2007-12-17 07:19:59 -08:00
$(GENDIR)/emu/cpu/mcs96/mcs96.inc: $(SRC)/emu/cpu/mcs96/mcs96make.py $(SRC)/emu/cpu/mcs96/mcs96ops.lst
@echo Generating mcs96 source file...
$(PYTHON) $(SRC)/emu/cpu/mcs96/mcs96make.py mcs96 $(SRC)/emu/cpu/mcs96/mcs96ops.lst $@
2007-12-17 07:19:59 -08:00
$(GENDIR)/emu/cpu/mcs96/i8x9x.inc: $(SRC)/emu/cpu/mcs96/mcs96make.py $(SRC)/emu/cpu/mcs96/mcs96ops.lst
@echo Generating i8x9x source file...
$(PYTHON) $(SRC)/emu/cpu/mcs96/mcs96make.py i8x9x $(SRC)/emu/cpu/mcs96/mcs96ops.lst $@
2007-12-17 08:41:39 -08:00
$(GENDIR)/emu/cpu/mcs96/i8xc196.inc: $(SRC)/emu/cpu/mcs96/mcs96make.py $(SRC)/emu/cpu/mcs96/mcs96ops.lst
@echo Generating i8xc196 source file...
$(PYTHON) $(SRC)/emu/cpu/mcs96/mcs96make.py i8xc196 $(SRC)/emu/cpu/mcs96/mcs96ops.lst $@
$(GENDIR)/emu/cpu/m6502/deco16.inc: $(SRC)/emu/cpu/m6502/m6502make.py $(SRC)/emu/cpu/m6502/odeco16.lst $(SRC)/emu/cpu/m6502/ddeco16.lst
@echo Generating deco16 source file...
$(PYTHON) $(SRC)/emu/cpu/m6502/m6502make.py deco16_device $(SRC)/emu/cpu/m6502/odeco16.lst $(SRC)/emu/cpu/m6502/ddeco16.lst $@
$(GENDIR)/emu/cpu/m6502/m4510.inc: $(SRC)/emu/cpu/m6502/m6502make.py $(SRC)/emu/cpu/m6502/om4510.lst $(SRC)/emu/cpu/m6502/dm4510.lst
@echo Generating m4510 source file...
$(PYTHON) $(SRC)/emu/cpu/m6502/m6502make.py m4510_device $(SRC)/emu/cpu/m6502/om4510.lst $(SRC)/emu/cpu/m6502/dm4510.lst $@
$(GENDIR)/emu/cpu/m6502/m6502.inc: $(SRC)/emu/cpu/m6502/m6502make.py $(SRC)/emu/cpu/m6502/om6502.lst $(SRC)/emu/cpu/m6502/dm6502.lst
@echo Generating m6502 source file...
$(PYTHON) $(SRC)/emu/cpu/m6502/m6502make.py m6502_device $(SRC)/emu/cpu/m6502/om6502.lst $(SRC)/emu/cpu/m6502/dm6502.lst $@
2007-12-17 07:19:59 -08:00
$(GENDIR)/emu/cpu/m6502/m65c02.inc: $(SRC)/emu/cpu/m6502/m6502make.py $(SRC)/emu/cpu/m6502/om65c02.lst $(SRC)/emu/cpu/m6502/dm65c02.lst
@echo Generating m65c02 source file...
$(PYTHON) $(SRC)/emu/cpu/m6502/m6502make.py m65c02_device $(SRC)/emu/cpu/m6502/om65c02.lst $(SRC)/emu/cpu/m6502/dm65c02.lst $@
2007-12-17 08:41:39 -08:00
$(GENDIR)/emu/cpu/m6502/m65ce02.inc: $(SRC)/emu/cpu/m6502/m6502make.py $(SRC)/emu/cpu/m6502/om65ce02.lst $(SRC)/emu/cpu/m6502/dm65ce02.lst
@echo Generating m65ce02 source file...
$(PYTHON) $(SRC)/emu/cpu/m6502/m6502make.py m65ce02_device $(SRC)/emu/cpu/m6502/om65ce02.lst $(SRC)/emu/cpu/m6502/dm65ce02.lst $@
2007-12-17 07:19:59 -08:00
$(GENDIR)/emu/cpu/m6502/m6509.inc: $(SRC)/emu/cpu/m6502/m6502make.py $(SRC)/emu/cpu/m6502/om6509.lst $(SRC)/emu/cpu/m6502/dm6509.lst
@echo Generating m6509 source file...
$(PYTHON) $(SRC)/emu/cpu/m6502/m6502make.py m6509_device $(SRC)/emu/cpu/m6502/om6509.lst $(SRC)/emu/cpu/m6502/dm6509.lst $@
2007-12-17 07:19:59 -08:00
$(GENDIR)/emu/cpu/m6502/m6510.inc: $(SRC)/emu/cpu/m6502/m6502make.py $(SRC)/emu/cpu/m6502/om6510.lst $(SRC)/emu/cpu/m6502/dm6510.lst
@echo Generating m6510 source file...
$(PYTHON) $(SRC)/emu/cpu/m6502/m6502make.py m6510_device $(SRC)/emu/cpu/m6502/om6510.lst $(SRC)/emu/cpu/m6502/dm6510.lst $@
2007-12-17 07:19:59 -08:00
$(GENDIR)/emu/cpu/m6502/n2a03.inc: $(SRC)/emu/cpu/m6502/m6502make.py $(SRC)/emu/cpu/m6502/on2a03.lst $(SRC)/emu/cpu/m6502/dn2a03.lst
@echo Generating n2a03 source file...
$(PYTHON) $(SRC)/emu/cpu/m6502/m6502make.py n2a03_device $(SRC)/emu/cpu/m6502/on2a03.lst $(SRC)/emu/cpu/m6502/dn2a03.lst $@
2007-12-17 07:19:59 -08:00
$(GENDIR)/emu/cpu/m6502/r65c02.inc: $(SRC)/emu/cpu/m6502/m6502make.py $(SRC)/emu/cpu/m6502/dr65c02.lst
@echo Generating r65c02 source file...
$(PYTHON) $(SRC)/emu/cpu/m6502/m6502make.py r65c02_device - $(SRC)/emu/cpu/m6502/dr65c02.lst $@
2012-12-26 06:15:59 -08:00
$(GENDIR)/emu/cpu/m6502/m740.inc: $(SRC)/emu/cpu/m6502/m6502make.py $(SRC)/emu/cpu/m6502/om740.lst $(SRC)/emu/cpu/m6502/dm740.lst
@echo Generating m740 source file...
$(PYTHON) $(SRC)/emu/cpu/m6502/m6502make.py m740_device $(SRC)/emu/cpu/m6502/om740.lst $(SRC)/emu/cpu/m6502/dm740.lst $@
2007-12-17 07:19:59 -08:00
$(GENDIR)/emu/cpu/m6809/m6809.inc: $(SRC)/emu/cpu/m6809/m6809make.py $(SRC)/emu/cpu/m6809/m6809.ops $(SRC)/emu/cpu/m6809/base6x09.ops
@echo Generating m6809 source file...
$(PYTHON) $(SRC)/emu/cpu/m6809/m6809make.py $(SRC)/emu/cpu/m6809/m6809.ops > $@
2007-12-17 07:19:59 -08:00
$(GENDIR)/emu/cpu/m6809/hd6309.inc: $(SRC)/emu/cpu/m6809/m6809make.py $(SRC)/emu/cpu/m6809/hd6309.ops $(SRC)/emu/cpu/m6809/base6x09.ops
@echo Generating hd6309 source file...
$(PYTHON) $(SRC)/emu/cpu/m6809/m6809make.py $(SRC)/emu/cpu/m6809/hd6309.ops > $@
2007-12-17 07:19:59 -08:00
$(GENDIR)/emu/cpu/m6809/konami.inc: $(SRC)/emu/cpu/m6809/m6809make.py $(SRC)/emu/cpu/m6809/konami.ops $(SRC)/emu/cpu/m6809/base6x09.ops
@echo Generating konami source file...
$(PYTHON) $(SRC)/emu/cpu/m6809/m6809make.py $(SRC)/emu/cpu/m6809/konami.ops > $@
2007-12-17 07:19:59 -08:00
$(GENDIR)/emu/cpu/tms57002/tms57002.inc: $(SRC)/emu/cpu/tms57002/tmsmake.py $(SRC)/emu/cpu/tms57002/tmsinstr.lst
@echo Generating TMS57002 source file...
$(PYTHON) $(SRC)/emu/cpu/tms57002/tmsmake.py $(SRC)/emu/cpu/tms57002/tmsinstr.lst $@
(Big tangle of changes that all happened as I was looking into the ROM loader rewrite, which is still in progress....) Replaced mamedriv.c with a new driver list mechanism that is generated by the build tools. The emulator core now expects the presence of a file called src/$(TARGET)/$(SUBTARGET).lst which is just a raw list of driver names, one per line. C and C++ comments are still permitted. This file is parsed by a new build tool makelist which extracts the driver names, sorts them, and generates a file called drivlist.c, which is consumed by the core. [Aaron Giles] Added new osdcore function osd_malloc_array() which is identical to osd_malloc() but obviously hints that the underlying allocation is for an array. Updated all callers to use the appropriate form. Modified the Windows allocator to only use guard pages for array-style allocations, allowing us to enable them once again in debug builds. [Aaron Giles] Created new static class driver_list to wrap accesses to the list of available drivers. Improved speed of driver lookups by relying on the presorting done by makelist. [Aaron Giles] Created helper class driver_enumerator as a helper for iterating through the list of drivers. This class supports basic filtering and iteration, and also serves as a temporary cache of machine_configs. [Aaron Giles] Created cli_frontend object to wrap all the CLI handling code in clifront.c. Updated/simplified all the code to take advantage of the driver_enumerator. [Aaron Giles] Created media_auditor object to wrap all the auditing functions in audit.c. Updated all users to the new interface. Note that the new auditing mechanism is slightly out of sync with the romload code in terms of finding ROMs owned by devices, so it may mis-report some issues until the new ROM loading code is in. [Aaron Giles] Added concept of a per-device searchpath. For most devices, their searchpath is just the short name of the device. For driver_devices, the searchpath is driver[;parent[;bios]]. This searchpath will eventually be used by the rom loader to find ROMs. For now it is used by the media auditor only. [Aaron Giles] Created info_xml_creator object to wrap all the info generation functions in info.c. Converted the file to C++ and cleaned up the input processing code. [Aaron Giles] (not for whatsnew ... Known issues: auditing of CHDs appears busted, and debug builds report unfreed memory if you use the built-in game picker)
2011-04-13 13:31:00 -07:00
$(GENDIR)/m68kmake.o: src/emu/cpu/m68000/m68kmake.c
@echo $(notdir $<)
$(SILENT) $(CC) -x c++ -std=gnu++98 -o "$@" -c "$<"
(Big tangle of changes that all happened as I was looking into the ROM loader rewrite, which is still in progress....) Replaced mamedriv.c with a new driver list mechanism that is generated by the build tools. The emulator core now expects the presence of a file called src/$(TARGET)/$(SUBTARGET).lst which is just a raw list of driver names, one per line. C and C++ comments are still permitted. This file is parsed by a new build tool makelist which extracts the driver names, sorts them, and generates a file called drivlist.c, which is consumed by the core. [Aaron Giles] Added new osdcore function osd_malloc_array() which is identical to osd_malloc() but obviously hints that the underlying allocation is for an array. Updated all callers to use the appropriate form. Modified the Windows allocator to only use guard pages for array-style allocations, allowing us to enable them once again in debug builds. [Aaron Giles] Created new static class driver_list to wrap accesses to the list of available drivers. Improved speed of driver lookups by relying on the presorting done by makelist. [Aaron Giles] Created helper class driver_enumerator as a helper for iterating through the list of drivers. This class supports basic filtering and iteration, and also serves as a temporary cache of machine_configs. [Aaron Giles] Created cli_frontend object to wrap all the CLI handling code in clifront.c. Updated/simplified all the code to take advantage of the driver_enumerator. [Aaron Giles] Created media_auditor object to wrap all the auditing functions in audit.c. Updated all users to the new interface. Note that the new auditing mechanism is slightly out of sync with the romload code in terms of finding ROMs owned by devices, so it may mis-report some issues until the new ROM loading code is in. [Aaron Giles] Added concept of a per-device searchpath. For most devices, their searchpath is just the short name of the device. For driver_devices, the searchpath is driver[;parent[;bios]]. This searchpath will eventually be used by the rom loader to find ROMs. For now it is used by the media auditor only. [Aaron Giles] Created info_xml_creator object to wrap all the info generation functions in info.c. Converted the file to C++ and cleaned up the input processing code. [Aaron Giles] (not for whatsnew ... Known issues: auditing of CHDs appears busted, and debug builds report unfreed memory if you use the built-in game picker)
2011-04-13 13:31:00 -07:00
$(GENDIR)/m68kmake$(EXE) : $(GENDIR)/m68kmake.o
@echo Linking $@...
$(LD) -lstdc++ $^ -o $@
$(GENDIR)/emu/cpu/m68000/m68kops.c: $(GENDIR)/m68kmake$(EXE) $(SRC)/emu/cpu/m68000/m68k_in.c
@echo Generating M68K source files...
$(SILENT) $(GENDIR)/m68kmake $(GENDIR)/emu/cpu/m68000 $(SRC)/emu/cpu/m68000/m68k_in.c
$(GENDIR)/mess/drivers/ymmu100.inc: $(SRC)/mess/drivers/ymmu100.ppm $(SRC)/build/file2str.py
@echo Converting $<...
@$(PYTHON) $(SRC)/build/file2str.py $(SRC)/mess/drivers/ymmu100.ppm $@ ymmu100_bkg UINT8
$(GENDIR)/%.moc.c: $(SRC)/%.h
$(SILENT) $(MOC) $(MOCINCPATH) $< -o $@
2015-03-26 14:40:11 -07:00