summaryrefslogtreecommitdiff
path: root/cross/i386-msdosdjgpp/Makefile
blob: 6eb25fe420bde09133eb704f3e2d358d4c36265c (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
# $NetBSD: Makefile,v 1.24 2006/03/04 21:29:07 jlam Exp $
#

DISTVERSION=		2.02.0
PKGREVISION=		2
DISTFILES=		${DJGPP_FILES}
EXTRACT_ONLY=		# none of the djgpp files
MASTER_SITES=		ftp://ftp.delorie.com/pub/djgpp/deleted/v2/ \
			http://ftp.delorie.com/pub/djgpp/deleted/v2/ \
			ftp://ftp.iij.ad.jp/pub/djgpp/deleted/v2/ \
			ftp://gd.tuwien.ac.at/pc/dos/djgpp/deleted/v2/ \
			http://gd.tuwien.ac.at/pc/dos/djgpp/deleted/v2/

MAINTAINER=		pkgsrc-users@NetBSD.org
HOMEPAGE=		http://www.delorie.com/djgpp/
COMMENT=		Cross-compile environment for MS-DOS on 386 and higher

BUILD_DEPENDS+=		unzip-[0-9]*:../../archivers/unzip

SITES_wmemu2b.zip=	http://ftp.delorie.com/pub/djgpp/beta/ \
			ftp://ftp.delorie.com/pub/djgpp/beta/ \
			ftp://ftp.iij.ad.jp/pub/djgpp/beta/ \
			ftp://gd.tuwien.ac.at/pc/dos/djgpp/beta/ \
			http://gd.tuwien.ac.at/pc/dos/djgpp/beta/

WRKSRC=			${WRKDIR}/djgpp
USE_CROSS_BINUTILS=	yes
BINUTILS_GNUTARGET=	coff-go32
BINUTILS_LDEMULATION=	i386go32
USE_CROSS_EGCS=		yes
USE_MAKEINFO=		yes

# Scripts in the build need to have a $CPP defined that works with the built
# compiler
NO_EXPORT_CPP=		yes

DJGPP_FILES=		djcrx202.zip wmemu2b.zip

TARGET_ARCH=		i386-msdosdjgpp
CROSS_SYS_INCLUDE=	${WRKSRC}/include
SYS_LIB=		${WRKSRC}/lib

post-extract:
	@${MKDIR} ${WRKSRC}
	@cd ${WRKSRC}; \
		for file in ${DJGPP_FILES}; do \
			unzip -Loq ${_DISTDIR}/$$file; \
		done; \
		for file in `${FIND} include -type f -print`; do \
			${CAT} $$file | col >$$file.new; \
			${MV} -f $$file.new $$file; \
		done
	@${LN} -f ${SYS_LIB}/crt0.o ${EGCS_WRKSRC}/gcc/
	@${RM} -f ${SYS_LIB}/djgpp.djl ${SYS_LIB}/specs

post-patch:
	@${RM} -f ${CROSS_SYS_INCLUDE}/sys/*.orig

do-build:
	cd ${WRKSRC}/src/stub && ${LINK.c} -o stubedit stubedit.c
	cd ${WRKSRC}/src/stub && ${LINK.c} -o stubify stubify.c

do-install:
	${INSTALL_PROGRAM} ${WRKSRC}/src/stub/stubedit ${TARGET_DIR}/bin/
	${LN} -f ${TARGET_DIR}/bin/stubedit ${PREFIX}/bin/${TARGET_ARCH}-stubedit
	${INSTALL_PROGRAM} ${WRKSRC}/src/stub/stubify ${TARGET_DIR}/bin/
	${LN} -f ${TARGET_DIR}/bin/stubedit ${PREFIX}/bin/${TARGET_ARCH}-stubify
	${INSTALL_DATA} ${WRKSRC}/bin/wmemu387.dxe ${TARGET_DIR}/lib/

.include "../../cross/COMMON/cross.mk"