summaryrefslogtreecommitdiff
path: root/cross/i386-msdosdjgpp/Makefile
blob: a0ca7dca2abad01b6cf42b8a8aa55cd9e96b456c (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
# $NetBSD: Makefile,v 1.5 1998/08/26 19:35:37 tv Exp $
#

DISTVERSION=		2.01.1
DISTFILES=		${DJGPP_FILES}
EXTRACT_ONLY=		# none of the djgpp files
MASTER_SITES=		ftp://ftp.simtel.net/pub/simtelnet/gnu/djgpp/v2/ \
			ftp://ftp.simtel.net/pub/simtelnet/gnu/djgpp/v2misc/

MAINTAINER=		packages@netbsd.org
HOMEPAGE=		http://www.delorie.com/djgpp/

BUILD_DEPENDS=		unzip:../../archivers/unzip

USE_CROSS_GNU=		yes

DJGPP_FILES=		djcrx201.zip wmemu2b.zip

TARGET_ARCH=		i386-msdosdjgpp
SYS_INCLUDE=		${WRKDIR}/djgpp/include
SYS_LIB=		${WRKDIR}/djgpp/lib

post-extract:
	@${MKDIR} ${WRKDIR}/djgpp
	@cd ${WRKDIR}/djgpp; \
		for file in ${DJGPP_FILES}; do \
			unzip -Loq ${_DISTDIR}/$$file; \
		done; \
		echo 'Stripping CR-LF in includes...'; \
		for file in `find include -type f`; do \
			${CAT} $$file | col >$$file.new; \
			${MV} -f $$file.new $$file; \
		done
	@${LN} -f ${SYS_LIB}/crt0.o ${WRKSRC}/gcc/
	@${RM} -f ${SYS_LIB}/djgpp.djl ${SYS_LIB}/specs

post-patch:
	@${RM} -f ${SYS_INCLUDE}/sys/djtypes.h.orig

post-build:
	cd ${WRKDIR}/djgpp/src/stub && ${LINK.c} -o stubedit stubedit.c
	cd ${WRKDIR}/djgpp/src/stub && ${LINK.c} -o stubify stubify.c

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

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