summaryrefslogtreecommitdiff
path: root/emulators/libretro-mame2010/Makefile
blob: 385b54cb6351d9ffca84270a6535e15a76efa0e6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
# $NetBSD: Makefile,v 1.2 2020/05/26 09:45:15 nia Exp $

DISTNAME=	libretro-mame2010-20180417
CATEGORIES=	emulators
MASTER_SITES=	${MASTER_SITE_GITHUB:=libretro/}
GITHUB_PROJECT=	mame2010-libretro
GITHUB_TAG=	70732f9137f6bb2bde4014746ea8bc613173dd1e

MAINTAINER=	pkgsrc-users@NetBSD.org
HOMEPAGE=	https://docs.libretro.com/library/mame_2010/
COMMENT=	Libretro core based on the MAME 0.139 arcade game emulator
LICENSE=	mame-license

USE_TOOLS+=	gmake
USE_LANGUAGES=	c c++

OPSYSVARS+=	SOEXT
SOEXT.Darwin=	dylib
SOEXT.*=	so
PLIST_SUBST+=	SOEXT=${SOEXT}

MAKE_FLAGS+=	platform=unix
MAKE_FLAGS+=	GIT_VERSION="-pkgsrc"
MAKE_FLAGS+=	BUILD_ZLIB=0

.include "../../mk/endian.mk"

.if ${MACHINE_ENDIAN} == "big"
CFLAGS+=	-DMSB_FIRST
.endif

.include "../../mk/bsd.prefs.mk"

.if !empty(OPSYS:M*BSD) || ${OPSYS} == "DragonFly" || ${OPSYS} == "Bitrig"
CFLAGS+=	-DSDLMAME_BSD
.endif

.if ${OPSYS} != "Linux"
CFLAGS+=	-DNO_AFFINITY_NP
.endif

.if ${MACHINE_ARCH} != "x86_64" && ${MACHINE_ARCH} != "i386"
MAKE_FLAGS+=	FORCE_DRC_C_BACKEND=1
.endif

.if !empty(USE_CROSS_COMPILE:M[yY][eE][sS])
MAKE_FLAGS+=	NATIVECC=${NATIVE_CXX:Q}
MAKE_FLAGS+=	NATIVELD=${NATIVE_CXX:Q}
.else
MAKE_FLAGS+=	NATIVECC=${CXX:Q}
MAKE_FLAGS+=	NATIVELD=${CXX:Q}
.endif

.for platform in ${LP64PLATFORMS}
.  if ${MACHINE_PLATFORM:M${platform}}
MAKE_FLAGS+=	PTR64=1
.  endif
.endfor

MAKE_FLAGS+=	CC=${CXX:Q}
MAKE_FLAGS+=	LD=${CXX:Q}

INSTALLATION_DIRS+=	${PREFIX}/lib/libretro

do-install:
	${INSTALL_LIB} ${WRKSRC}/mame2010_libretro.so \
	    ${DESTDIR}${PREFIX}/lib/libretro/mame2010_libretro.so

.include "../../devel/zlib/buildlink3.mk"
.include "../../mk/pthread.buildlink3.mk"
.include "../../mk/bsd.pkg.mk"