aboutsummaryrefslogtreecommitdiff
path: root/emulators/m2000/Makefile
blob: 0c8196fcadd905c0f8472bd141b8c3c6d79d296d (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
#
# New ports collection makefile for:	m2000
# Date created:				2005-08-23
# Whom:					Edwin Groothuis <edwin@mavetju.org>
#
# $FreeBSD$
#

PORTNAME=	m2000
PORTVERSION=	0.6
PORTREVISION=	2
CATEGORIES=	emulators
MASTER_SITES=	\
		http://www.komkon.org/~dekogel/files/p2000/:code \
		http://www.mavetju.org/download/adopted/:tapes \
		ftp://ftp.komkon.org/pub/EMUL8/P2000/Tapes/:tapes \
		http://www.mavetju.org/download/adopted/:code
DISTFILES=	${PORTNAME:U}${EXTRACT_SUFX}:code \
		tapeconv.zip:code \
		${M2000TAPES:S/$/.gz:tapes/}
DIST_SUBDIR=	m2000
EXTRACT_ONLY=	${PORTNAME:U}${EXTRACT_SUFX}

MAINTAINER=	edwin@mavetju.org
COMMENT=	A portable emulator for the Philips P2000 home computer

EXTRACT_DEPENDS=unzip:${PORTSDIR}/archivers/unzip

M2000TAPES=	3DDoolhof2.cas		\
		BrickWall.cas		\
		Componist.cas		\
		ElevatorHumpie.cas	\
		ErrorSoft1.cas		\
		Fraxxon.cas		\
		KleurenDemo.cas		\
		LazyBug.cas		\
		MachoMan.cas		\
		MonkeyKong.cas		\
		Snakey.cas		\
		SpaceAttack.cas		\
		SpaceFight.cas		\
		SpaceMission.cas	\
		SpeelPalijs.cas		\
		StarTrek.cas		\
		VluchtSimulator.cas

WRKSRC=		${WRKDIR}/P2000
ALL_TARGET=	x
USE_XORG=	x11 xi

SUB_FILES=	m2000.sh
PORTDOCS=	M2000.txt

post-extract:
	${MKDIR} ${WRKDIR}/tapeconv
	${UNZIP_CMD} ${DISTDIR}/${DIST_SUBDIR}/tapeconv.zip -d ${WRKDIR}/tapeconv
	${MV} ${WRKDIR}/tapeconv/PCM2CAS.C ${WRKDIR}/tapeconv/PCM2CAS.c

post-build:
	${CC} -o ${WRKDIR}/tapeconv/PCM2CAS ${WRKDIR}/tapeconv/PCM2CAS.c

do-install:
	@${INSTALL_SCRIPT} ${WRKDIR}/m2000.sh ${PREFIX}/bin/m2000
	@${INSTALL_PROGRAM} ${WRKDIR}/tapeconv/PCM2CAS ${PREFIX}/bin/tapeconv
	@${MKDIR} ${PREFIX}/share/m2000/
	@${INSTALL_PROGRAM} ${WRKSRC}/m2000 ${DATADIR}
	@${INSTALL_DATA} ${WRKSRC}/P2000ROM.bin ${DATADIR}
	@${INSTALL_DATA} ${WRKSRC}/Default.fnt ${DATADIR}
	@${INSTALL_DATA} ${WRKSRC}/BASIC.bin ${DATADIR}
.if !defined(NOPORTDOCS)
	@${MKDIR} ${DOCSDIR}
	@${INSTALL_DATA} ${WRKSRC}/M2000.txt ${DOCSDIR}
.endif
.for f in ${M2000TAPES}
	@${GZCAT} ${DISTDIR}/${DIST_SUBDIR}/${f}.gz > ${WRKDIR}/${f}
	@${INSTALL_DATA} ${WRKDIR}/${f} ${DATADIR}
.endfor

post-install:
	@${ECHO_CMD} "Run 'make install-user' to install the tapes in your own directory"

install-user:
	@${ECHO_CMD} "Copying tapes to ${HOME}/.m2000..."
	@${MKDIR} ${HOME}/.m2000
.for f in ${M2000TAPES}
	@${INSTALL_DATA} ${WRKDIR}/${f} ${HOME}/.m2000
	@${CHMOD} u+w ${HOME}/.m2000/${f}
.endfor
	@${ECHO_CMD} "Done. Now start it with 'm2000 [tapename]' and execute the commands 'cload' and 'run'"

.include <bsd.port.mk>