summaryrefslogtreecommitdiff
path: root/devel/lcc/Makefile
blob: 75c2162d3d0b9dd367f6af7f681fedef87aba5d8 (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
# $NetBSD: Makefile,v 1.13 2008/03/03 17:45:35 jlam Exp $

DISTNAME=	lcc-4.1
CATEGORIES=	devel lang
MASTER_SITES=	ftp://ftp.cs.princeton.edu/pub/lcc/

MAINTAINER=	pkgsrc-users@NetBSD.org
HOMEPAGE=	http://www.cs.princeton.edu/software/lcc/
COMMENT=	Local ANSI C compiler for a variety of platforms

USE_TOOLS+=	yacc
MAKE_ENV+=	BUILDDIR=${WRKSRC}/bin HOSTFILE=etc/netbsd.c

# it builds and runs on others (like alpha) but still
# seems to emit i386 assembler
ONLY_FOR_PLATFORM=	*-*-i386

PKG_DESTDIR_SUPPORT=	user-destdir

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

BUILDDIR=	${WRKSRC}/src
MAKE_FILE=	makefile

INSTALLATION_DIRS=	bin libexec ${PKGMANDIR}/man1

post-extract:
	${CP} ${FILESDIR}/x86bsd.md ${WRKSRC}/src/
	${CP} ${FILESDIR}/netbsd.c ${WRKSRC}/etc/

pre-build:
	${MKDIR} ${WRKSRC}/bin
	cd ${WRKSRC}/etc ; \
		[ -f netbsd.c.bak ] || ${MV} netbsd.c netbsd.c.bak ; \
		${SED} \
		-e 's|@PREFIX@|${PREFIX}|g' < netbsd.c.bak > netbsd.c

do-install:
	${INSTALL_PROGRAM} ${WRKSRC}/bin/bprint ${DESTDIR}${PREFIX}/libexec
	${INSTALL_PROGRAM} ${WRKSRC}/bin/cpp ${DESTDIR}${PREFIX}/libexec
	${INSTALL_PROGRAM} ${WRKSRC}/bin/lburg ${DESTDIR}${PREFIX}/libexec
	${INSTALL_PROGRAM} ${WRKSRC}/bin/lcc ${DESTDIR}${PREFIX}/bin
	${INSTALL_PROGRAM} ${WRKSRC}/bin/rcc ${DESTDIR}${PREFIX}/libexec
	${INSTALL_DATA_DIR} ${DESTDIR}${PREFIX}/share/lcc/include
	${INSTALL_DATA_DIR} ${DESTDIR}${PREFIX}/share/lcc/include/sys
	${INSTALL_DATA} ${WRKSRC}/include/x86/linux/stdarg.h \
		${DESTDIR}${PREFIX}/share/lcc/include
	${INSTALL_DATA} ${FILESDIR}/cdefs.h \
		${DESTDIR}${PREFIX}/share/lcc/include/sys
	${INSTALL_MAN} ${WRKSRC}/doc/lcc.1 \
		${DESTDIR}${PREFIX}/${PKGMANDIR}/man1
	${INSTALL_MAN} ${WRKSRC}/doc/bprint.1 \
		${DESTDIR}${PREFIX}/${PKGMANDIR}/man1

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