summaryrefslogtreecommitdiff
path: root/emulators/snes9x/Makefile
blob: b960f5eeddd0472f4dcd30982bc0e9c31dfc6683 (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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
# $NetBSD: Makefile,v 1.38 2006/05/11 13:58:02 joerg Exp $

SNESVER=		1.43
DISTNAME=		snes9x-${SNESVER}-src
PKGNAME=		snes9x-${SNESVER}
CATEGORIES=		emulators
MASTER_SITES=		http://www.lysator.liu.se/snes9x/${SNESVER}/ \
			http://files.ipherswipsite.com/snes9x/ \
			http://vincent.grigorieff.free.fr/snes9x/

MAINTAINER=		ben@NetBSD.org
HOMEPAGE=		http://www.snes9x.com/
COMMENT=		Super Nintendo Entertainment System (SNES) emulator

WRKSRC=			${WRKDIR}/${DISTNAME}/snes9x
USE_LANGUAGES=		c c++
USE_TOOLS+=		gmake
PTHREAD_OPTS+=		require
INSTALLATION_DIRS=	bin
GNU_CONFIGURE=		YES

SUBST_CLASSES+=		nodos
SUBST_STAGE.nodos=	pre-patch
SUBST_FILES.nodos=	../language.h
SUBST_FILES.nodos+=	dsp1.h dsp3emu.cpp dsp4emu.cpp
SUBST_SED.nodos=	-e 's|
||g'

SUBST_CLASSES+=		paircpp
SUBST_STAGE.paircpp=	pre-patch
SUBST_FILES.paircpp=	65c816.h sa1.h
SUBST_SED.paircpp=	-e 's|pair|snes9x_pair|g'

do-install:
	${INSTALL_PROGRAM} ${WRKSRC}/snes9x ${PREFIX}/bin
	${INSTALL_PROGRAM} ${WRKSRC}/offsets ${PREFIX}/bin
	${INSTALL_DATA_DIR} ${PREFIX}/share/doc/snes9x
	${INSTALL_MAN} ${WRKSRC}/doc/porting.txt ${PREFIX}/share/doc/snes9x
	${INSTALL_MAN} ${WRKSRC}/changes.txt ${PREFIX}/share/doc/snes9x
	${INSTALL_MAN} ${WRKSRC}/hardware.txt ${PREFIX}/share/doc/snes9x
	${INSTALL_MAN} ${WRKSRC}/problems.txt ${PREFIX}/share/doc/snes9x
	${TR} -d '\r' <${WRKDIR}/${DISTNAME}/readme.txt >${WRKSRC}/readme.txt
	${INSTALL_MAN} ${WRKSRC}/readme.txt ${PREFIX}/share/doc/snes9x
	${INSTALL_MAN} ${WRKDIR}/${DISTNAME}/readme.unix \
		${PREFIX}/share/doc/snes9x

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

PKG_OPTIONS_VAR=	PKG_OPTIONS.snes9x
.if ${MACHINE_ARCH} == "i386"
BUILD_DEPENDS+=		nasm>=0.98:../../devel/nasm
PKG_SUPPORTED_OPTIONS=	mmx
.endif

.include "../../mk/bsd.options.mk"

.if ${MACHINE_ARCH} == "i386"
CONFIGURE_ARGS+=	--with-assembler
.if !empty(PKG_OPTIONS:Mmmx)
CONFIGURE_ARGS+=	--with-mmx
.endif
.if ${OBJECT_FMT} == "a.out"
MAKE_ENV+=	FILEFORMAT=aoutb
MAKE_ENV+=	_ASM_UNDERBARS=1
.else
MAKE_ENV+=	FILEFORMAT=elf
.endif
.endif

.if exists(${X11BASE}/lib/libXxf86dga.a)
CONFIGURE_ARGS+=	--with-extensions
.endif

.if exists(/usr/include/usb.h) || exists(/usr/include/usbhid.h)
MAKE_ENV+=	USBJOY=1
.if exists(/usr/include/usbhid.h)
MAKE_ENV+=	USBHID_H=1
.endif
.elif ${OPSYS} == "DragonFly" && exists(/usr/include/libusbhid.h)
MAKE_ENV+=	USBJOY=1
MAKE_ENV+=	USBHID_H=1
.endif

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