summaryrefslogtreecommitdiff
path: root/emulators/plex86/Makefile
blob: a09b922e566c59c098fb9d6d98f5cd936ead176d (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
# $NetBSD: Makefile,v 1.22 2003/05/03 12:14:56 dmcmahill Exp $

DISTNAME=	plex86-20010106
PKGNAME=	${DISTNAME:S/-/-0./}
WRKSRC=		${WRKDIR}/plex86
CATEGORIES=	emulators
MASTER_SITES=	${MASTER_SITE_LOCAL}
EXTRACT_SUFX=	.tar.bz2

MAINTAINER=	tron@netbsd.org
HOMEPAGE=	http://www.plex86.org/
COMMENT=	Extensible open source PC virtualization software (free VMware)

GNU_CONFIGURE=	yes
CONFIGURE_ARGS+=--with-NetBSD \
		--with-netbsd-source=${BSDSRCDIR}/sys
USE_GMAKE=	yes
USE_X11BASE=	yes	# for VGA font

ONLY_FOR_PLATFORM= NetBSD-*-i386

RESTRICTED=	CPU-specific binary code
NO_BIN_ON_CDROM=${RESTRICTED}
NO_BIN_ON_FTP=	${RESTRICTED}

# to override <bsd.own.mk>, MUST be set this way BEFORE bsd.prefs.mk
BSDSRCDIR?=	/nonexistent

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

pre-extract:
.if ${BSDSRCDIR} == "/nonexistent"
	@${ECHO_MSG} "Please set BSDSRCDIR in /etc/mk.conf, pointing it"
	@${ECHO_MSG} "to a directory that contains sources that match"
	@${ECHO_MSG} "your currently running system (esp. kernel), e.g."
	@${ECHO_MSG} "/usr/src."
	@${FALSE}
.endif
.if !exists(${BSDSRCDIR}/sys/sys/param.h)
	@${ECHO_MSG} "Need a kernel source tree in ${BSDSRCDIR}/sys."
	@${ECHO_MSG} "(Or set BSDSRCDIR correctly in /etc/mk.conf.)"
	@${FALSE}
.endif

post-build:
	${TEST} -f ${WRKSRC}/misc/vga.pcf.gz || \
	${GZIP_CMD} -9 ${WRKSRC}/misc/vga.pcf

do-install: do-install-dirs do-install-binaries do-install-bios \
		do-install-font do-install-conf

do-install-dirs:
	${INSTALL_DATA_DIR} ${PREFIX}/lkm \
		${PREFIX}/lib/plex86 \
		${PREFIX}/lib/plex86/bios \
		${PREFIX}/share/examples/plex86

do-install-binaries:
	${INSTALL_PROGRAM} ${WRKSRC}/user/plex86 ${PREFIX}/bin
	${INSTALL_PROGRAM} ${WRKSRC}/user/resetmod ${PREFIX}/bin/plex86_reset
	${INSTALL_DATA} ${WRKSRC}/user/plugins/bochs/plugin-bochs.so ${PREFIX}/lib/plex86
	${INSTALL_DATA} ${WRKSRC}/kernel/plex86.o ${PREFIX}/lkm
	${INSTALL_SCRIPT} ${WRKSRC}/misc/netbsd_post.sh ${PREFIX}/lib/plex86

do-install-bios:
	${INSTALL_DATA} ${WRKSRC}/bios/BIOS* \
		${WRKSRC}/bios/VGABIOS-elpin-2.40 \
		${PREFIX}/lib/plex86/bios

do-install-font:
	${INSTALL_DATA} ${WRKSRC}/misc/vga.pcf.gz ${PREFIX}/lib/X11/fonts/local
	${X11BASE}/bin/mkfontdir ${PREFIX}/lib/X11/fonts/local

do-install-conf:
	@cd ${WRKSRC}/conf && for f in freedos linuxhd msdos qnx win95 winnt; do \
		${SED}	-e 's,\.\./\.\./,/PATH/TO/,' \
			-e 's,\.\./bios/,${PREFIX}/lib/plex86/bios/,' \
			-e 's,\./plugins/bochs/,${PREFIX}/lib/plex86/,' \
			$$f >${WRKDIR}/$$f.conf; \
	done
	${INSTALL_DATA} ${WRKDIR}/*.conf ${PREFIX}/share/examples/plex86

.include "../../mk/bsd.pkg.mk"