summaryrefslogtreecommitdiff
path: root/emulators/simh/Makefile
blob: d69115181b7a7524af3a134046ea09a57f50470b (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
84
85
86
87
# $NetBSD: Makefile,v 1.55 2020/08/18 17:57:47 leot Exp $

DISTNAME=	simh-4.0.0
PKGNAME=	simh-4.0.0.20180919
PKGREVISION=	2
CATEGORIES=	emulators
MASTER_SITES=	${MASTER_SITE_GITHUB:=simh/}
GITHUB_PROJECT=	simh
GITHUB_TAG=	0fe4bf3281a4d1f9fd10bba07cf0f7e40da92fc3

MAINTAINER=	pkgsrc-users@NetBSD.org
HOMEPAGE=	http://simh.trailing-edge.com/
COMMENT=	Bob Supniks historical computer simulator
LICENSE=	mit

DEPENDS+=	dejavu-ttf-[0-9]*:../../fonts/dejavu-ttf

USE_TOOLS+=	gmake

BUILDLINK_API_DEPENDS.libpcap+=	libpcap>=0.9

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

BUILDLINK_TRANSFORM+=	rm:-flto
BUILDLINK_TRANSFORM+=	rm:-fwhole-program

.if (${MACHINE_ARCH} == "arm")
BUILDLINK_TRANSFORM+=	rm:-O2
.endif

# Needed for PDP11/pdp11_dc.c on gcc 4.1.3
.if (${MACHINE_ARCH} == "vax")
CFLAGS+=	-fforce-addr
.endif

CFLAGS.SunOS+=	-DBSD_COMP
LDFLAGS.SunOS+=	-lm

LDFLAGS.Linux+=	-lm -pthread -lrt

INSTALLATION_DIRS=	bin share/simh share/doc/simh

MAKE_FILE=		makefile
INCLUDES=		${PREFIX:Q}/include:\
			${BUILDLINK_PREFIX.SDL2:Q}/include/SDL2:\
			${BUILDLINK_PREFIX.libpcap:Q}/include/pcap:\
			${BUILDLINK_PREFIX.pcre:Q}/include/pcre:\
			${BUILDLINK_PREFIX.png:Q}/include:\
			/usr/include
LIBRARIES=		${PREFIX:Q}/lib:\
			${BUILDLINK_PREFIX.SDL2:Q}/lib${LIBABISUFFIX}:\
			${BUILDLINK_PREFIX.libpcap:Q}/lib${LIBABISUFFIX}:\
			${BUILDLINK_PREFIX.pcre:Q}/lib${LIBABISUFFIX}:\
			${BUILDLINK_PREFIX.png:Q}/lib${LIBABISUFFIX}:\
			/usr/lib${LIBABISUFFIX}
MAKE_ENV+=		INCLUDES=${INCLUDES:Q}
MAKE_ENV+=		LIBRARIES=${LIBRARIES:Q}
MAKE_ENV+=		GCC=${CC:Q}
MAKE_ENV+=		OS_LDFLAGS=${LDFLAGS:Q} CFLAGS_O=${CFLAGS:Q}
MAKE_ENV+=		FONTPATH=/usr/pkg/share/fonts/X11/TTF

BUILD_TARGET=		all besm6

post-extract:
	${MKDIR} ${WRKSRC}/BIN

do-install:
	(cd ${WRKSRC}/BIN && for BIN in *; do				\
		if [ -f $$BIN ] ; then					\
		${INSTALL_PROGRAM} $$BIN ${DESTDIR}${PREFIX}/bin/simh-$$BIN; \
		fi ;							\
	done)

	${INSTALL_DATA} ${WRKSRC}/VAX/ka655x.bin ${DESTDIR}${PREFIX}/share/simh
	${INSTALL_DATA} ${WRKSRC}/VAX/vmb.exe ${DESTDIR}${PREFIX}/share/simh
	(cd ${WRKSRC} && for TXT in *.txt */*.txt; do			\
		${INSTALL_DATA} "$$TXT" ${DESTDIR}${PREFIX}/share/doc/simh;		\
	done)

.include "../../devel/SDL2/buildlink3.mk"
.include "../../fonts/SDL2_ttf/buildlink3.mk"
.include "../../devel/pcre/buildlink3.mk"
.include "../../graphics/png/buildlink3.mk"
.include "../../net/libpcap/buildlink3.mk"
.include "../../mk/dlopen.buildlink3.mk"
.include "../../mk/pthread.buildlink3.mk"
.include "../../mk/bsd.pkg.mk"