summaryrefslogtreecommitdiff
path: root/emulators/fceux/Makefile
blob: 206eb3cebec6876674d804e8db6a9127681a968d (plain) (blame)
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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
# New ports collection makefile for:	fceu
# Date Created:		10 Mov 2002
# Whom:			HIYAMA Takeshi <gibbon@cocoa.freemail.ne.jp>
#
# $FreeBSD$
#

PORTNAME=	fceu
PORTVERSION=	0.96
PORTREVISION=	1
CATEGORIES=	emulators
MASTER_SITES=	http://fceultra.sourceforge.net/files/
DISTNAME=	fceu${PORTVERSION:S/.//}src

MAINTAINER=	gibbon@cocoa.freemail.ne.jp
COMMENT=	A portable NES/Famicom emulator based on Bero's original FCE

LIB_DEPENDS=	SDL-1.1:${PORTSDIR}/devel/sdl12

MAN6=		fceu.6
WRKSRC=		${WRKDIR}/fceu
USE_X_PREFIX=	yes
USE_GMAKE=	yes
MAKEFILE=	Makefile.unixsdl
USE_REINPLACE=	yes

DOCS=		AUTHORS COPYING ChangeLog FAQ README TODO \
		cheat.txt fcs.txt porting.txt rel/readme-linux.txt
TECHDOCS=	README.now README.sound UNIF_current.txt nsfspec.txt
TECHCPUDOC=	4017.txt 6502_cpu.txt NESSOUND-4th.txt NESSOUND.txt dmc.txt
TECHEXPDOCS=	mmc5-e.txt mmc5_bank_switch.txt
TECHPPUDOCS=	"2C02\technical\operation.TXT" loopy1.txt loopy2.txt

.if defined(WITH_OPTIMIZED_FLAGS)
CFLAGS+=	-O3 -ffast-math -finline-functions -fomit-frame-pointer -funroll-loops -fexpensive-optimizations -malign-double
.if (${MACHINE_ARCH} == "i386")
CFLAGS+=	-mfancy-math-387
.endif # i386
.endif

pre-everything::
.if !defined(WITH_OPTIMIZED_FLAGS)
	@${ECHO_MSG} "You can optimize by setting WITH_OPTIMIZED_FLAGS=yes."
.endif
.if !defined(NOPORTDOCS) && !defined(TECH_DOC_INSTALL)
	@${ECHO_MSG} "You can install technical documents"
	@${ECHO_MSG} "by defining TECH_DOC_INSTALL"
.endif

.if !defined(NOPORTDOCS) && defined(TECH_DOC_INSTALL)
PLIST_SUB=	TECHDOCS=""
.else
PLIST_SUB=	TECHDOCS="@comment "
.endif

.include <bsd.port.pre.mk>

post-patch:
	@${REINPLACE_CMD} -e 's+%%LOCALBASE%%+${LOCALBASE}+g;' ${WRKSRC}/Makefile.unixsdl
.if (${MACHINE_ARCH} != "i386")
# do I have to do this for ia64 and amd64 too?
	@${REINPLACE_CMD} -e 's|-DC80x86||g;' ${WRKSRC}/Makefile.unixsdl
.if (${MACHINE_ARCH} == "sparc64")
	@${REINPLACE_CMD} -e 's|-DLSB_FIRST||g;' ${WRKSRC}/Makefile.unixsdl
.endif
.endif

pre-build:
	@${CP} ${WRKSRC}/Documentation/fceu-sdl.6 ${WRKSRC}/Documentation/fceu.6

do-install:
	${INSTALL_PROGRAM} ${WRKSRC}/fceu ${PREFIX}/bin
.if !defined(NOPORTDOCS)
	@${MKDIR} ${DOCSDIR}
.if !defined(NOPORTDOCS)
.for docs in ${DOCS}
	${INSTALL_DATA} ${WRKSRC}/Documentation/${docs} ${DOCSDIR}
.endfor
.endif
.if !defined(NOPORTDOCS)
	${INSTALL_MAN} ${WRKSRC}/Documentation/fceu.6 ${PREFIX}/man/man6
.if defined(TECH_DOC_INSTALL)
	@${MKDIR} ${DOCSDIR}/tech
.for docs in ${TECHDOCS}
	${INSTALL_DATA} ${WRKSRC}/Documentation/tech/${docs} ${DOCSDIR}/tech
.endfor
	@${MKDIR} ${DOCSDIR}/tech/cpu
.for docs in ${TECHCPUDOC}
	${INSTALL_DATA} ${WRKSRC}/Documentation/tech/cpu/${docs} \
			${DOCSDIR}/tech/cpu
.endfor
	@${MKDIR} ${DOCSDIR}/tech/exp
.for docs in ${TECHEXPDOCS}
	${INSTALL_DATA} ${WRKSRC}/Documentation/tech/exp/${docs} \
			${DOCSDIR}/tech/exp
.endfor
	@${MKDIR} ${DOCSDIR}/tech/ppu
.for docs in ${TECHPPUDOCS}
	${INSTALL_DATA} ${WRKSRC}/Documentation/tech/ppu/${docs:S/\\/ /g} \
			${DOCSDIR}/tech/ppu
.endfor
.endif
.endif
.endif

.include <bsd.port.post.mk>