2017-08-14 11:30:35 +02:00
|
|
|
###########################################################################
|
|
|
|
#
|
|
|
|
# dist.mak
|
|
|
|
#
|
|
|
|
# This is used during MAME release process, it's rather hacky
|
|
|
|
#
|
|
|
|
###########################################################################
|
|
|
|
|
|
|
|
ifeq ($(OS),Windows_NT)
|
|
|
|
OS := windows
|
|
|
|
else
|
|
|
|
UNAME := $(shell uname -mps)
|
|
|
|
ifeq ($(firstword $(filter Linux,$(UNAME))),Linux)
|
|
|
|
OS := linux
|
|
|
|
endif
|
|
|
|
ifeq ($(firstword $(filter Solaris,$(UNAME))),Solaris)
|
|
|
|
OS := solaris
|
|
|
|
endif
|
|
|
|
ifeq ($(firstword $(filter SunOS,$(UNAME))),SunOS)
|
|
|
|
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 := osx
|
|
|
|
endif
|
|
|
|
ifeq ($(firstword $(filter Haiku,$(UNAME))),Haiku)
|
|
|
|
OS := haiku
|
|
|
|
endif
|
|
|
|
ifndef OS
|
|
|
|
$(error Unable to detect OS from uname -a: $(UNAME))
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifndef TARGETOS
|
|
|
|
TARGETOS := $(OS)
|
|
|
|
endif
|
|
|
|
|
|
|
|
EXE :=
|
|
|
|
ifeq ($(OS),windows)
|
|
|
|
EXE := .exe
|
|
|
|
PROJECTTYPE := mingw-gcc
|
|
|
|
else
|
|
|
|
ifeq ($(OS),osx)
|
|
|
|
PROJECTTYPE := osx_clang
|
|
|
|
else
|
|
|
|
PROJECTTYPE := $(OS)_gcc
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifeq ($(DEBUG),1)
|
|
|
|
MAINBINVARIANT := d
|
|
|
|
BUILDVARIANT := Debug
|
|
|
|
else
|
|
|
|
MAINBINVARIANT :=
|
|
|
|
BUILDVARIANT := Release
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifeq ($(PTR64),1)
|
|
|
|
BUILDARCH := x64
|
|
|
|
else
|
|
|
|
BUILDARCH := x32
|
|
|
|
endif
|
|
|
|
|
|
|
|
SHELLTYPE := msdos
|
|
|
|
ifeq (,$(ComSpec)$(COMSPEC))
|
|
|
|
SHELLTYPE := posix
|
|
|
|
endif
|
|
|
|
ifeq (/bin,$(findstring /bin,$(SHELL)))
|
|
|
|
SHELLTYPE := posix
|
|
|
|
endif
|
|
|
|
ifeq (/bin,$(findstring /bin,$(MAKESHELL)))
|
|
|
|
SHELLTYPE := posix
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifeq (posix,$(SHELLTYPE))
|
|
|
|
MKDIR = $(SILENT) mkdir -p "$(1)"
|
|
|
|
COPY = $(SILENT) cp -fR "$(1)" "$(2)"
|
|
|
|
else
|
|
|
|
MKDIR = $(SILENT) mkdir "$(subst /,\\,$(1))" 2> nul || exit 0
|
|
|
|
COPY = $(SILENT) copy /Y "$(subst /,\\,$(1))" "$(subst /,\\,$(2))" > nul || exit 0
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifndef TARGET
|
|
|
|
TARGET := mame
|
|
|
|
endif
|
|
|
|
|
2021-01-26 05:37:11 +01:00
|
|
|
MAINBIN := $(TARGET)$(MAINBINVARIANT)
|
2017-08-14 11:30:35 +02:00
|
|
|
BINDIR := build/$(PROJECTTYPE)/bin/$(BUILDARCH)/$(BUILDVARIANT)
|
|
|
|
STAGEDIR := build/release/$(BUILDARCH)/$(BUILDVARIANT)/$(TARGET)
|
|
|
|
|
|
|
|
BINARIES = $(MAINBIN) castool chdman floptool imgtool jedutil ldresample ldverify nltool nlwav romcmp unidasm
|
2020-03-04 12:41:15 +01:00
|
|
|
SIMPLE_DIRS := ctrlr docs/legal docs/man docs/swlist hash ini/examples ini/presets
|
2017-08-14 11:30:35 +02:00
|
|
|
LOCALISATIONS := $(wildcard language/*/*.mo)
|
2020-03-04 12:41:15 +01:00
|
|
|
COPIED_FILES := COPYING uismall.bdf roms/dir.txt $(foreach DIR,$(SIMPLE_DIRS),$(wildcard $(DIR)/*)) language/LICENSE language/README.md $(LOCALISATIONS)
|
2017-08-14 11:30:35 +02:00
|
|
|
CREATED_DIRS := docs ini roms $(SIMPLE_DIRS) language $(dir $(LOCALISATIONS))
|
|
|
|
|
|
|
|
GEN_FOLDERS := $(addprefix $(STAGEDIR)/,$(CREATED_DIRS))
|
|
|
|
COPY_BINARIES := $(addprefix $(STAGEDIR)/,$(addsuffix $(EXE),$(BINARIES)))
|
|
|
|
COPY_FILES := $(addprefix $(STAGEDIR)/,$(COPIED_FILES))
|
|
|
|
|
2022-01-11 19:43:41 +01:00
|
|
|
all: $(COPY_BINARIES) $(COPY_FILES) $(STAGEDIR)/docs/MAME.pdf
|
2017-08-14 11:30:35 +02:00
|
|
|
|
2017-08-14 13:05:28 +02:00
|
|
|
clean:
|
|
|
|
$(SILENT) rm -rf $(STAGEDIR)
|
|
|
|
|
2017-08-14 11:30:35 +02:00
|
|
|
$(GEN_FOLDERS):
|
2017-08-14 13:05:28 +02:00
|
|
|
$(call MKDIR,$@)
|
2017-08-14 11:30:35 +02:00
|
|
|
|
|
|
|
$(STAGEDIR)/%: $(BINDIR)/% | $(GEN_FOLDERS)
|
2017-08-14 13:05:28 +02:00
|
|
|
$(call COPY,$<,$@)
|
|
|
|
$(SILENT) strip $@
|
2017-08-14 11:30:35 +02:00
|
|
|
|
|
|
|
$(STAGEDIR)/%: % | $(GEN_FOLDERS)
|
2017-08-14 13:05:28 +02:00
|
|
|
$(call COPY,$<,$@)
|
|
|
|
|
2022-01-11 19:43:41 +01:00
|
|
|
$(STAGEDIR)/docs/MAME.pdf: docs/build/latex/MAME.pdf | $(GEN_FOLDERS)
|
|
|
|
$(call COPY,$<,$@)
|
|
|
|
|
|
|
|
docs/build/latex/MAME.pdf:
|
|
|
|
$(MAKE) -C docs latexpdf
|
|
|
|
|
2017-08-14 13:05:28 +02:00
|
|
|
.PHONY: all clean
|