summaryrefslogtreecommitdiff
path: root/lang/gnat/Makefile
blob: 90807ee5948faf50df9019a01d27393a17c57256 (plain) (blame)
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
88
89
90
91
92
93
94
95
96
97
98
99
# New ports collection makefile for:	GNU Ada gnat
# Version required:     3.09
# Date created:         Sat Mar 18 02:16:45 1995
# Porter (original):	nils@guru.ims.uni-stuttgart.de
# Porter (version 3):	maurice@serc.rmit.edu.au
#
# $Id: Makefile,v 1.11 1997/08/11 18:02:08 fenner Exp $

# Note: 
# - FreeBSD tasking libraries created by Dan Eischen have been incorportated
#   into this edition
# - The default names of a number of binaries have been altered to avoid
#   conflict with other gcc based products. Standard names can be provided using
#   symbolic links.

DISTNAME=       gnat-3.09-src
PKGNAME=        gnat-3.09
CATEGORIES=	lang
MASTER_SITES=   ftp://cs.nyu.edu/pub/gnat/ \
		${MASTER_SITE_GNU}
DISTFILES=      gnat-3.09-src.tar.gz gcc-2.7.2.1.tar.gz

MAINTAINER=	maurice@serc.rmit.edu.au

.if !exists(/usr/local/bin/gnatf)
BROKEN=		"requires existing gnat compiler"
.endif
.if !exists(/usr/local/bin/adagcc)
BROKEN=		"requires patched gcc compiler"
.endif
# You need a compiler who calls an existing gnat compiler (3.08 or greater):
# if you have one, if you have one put it here, otherwise,
# you will need to install from a package first

# Make sure we use the patched gcc compiler
CC = /usr/local/bin/adagcc

# Which version of gcc do we have? Must be 2.7.2.1
CCVERSION= 2.7.2.1

# which language set 
LANG = c ada

pre-patch:
	@echo "===>  Applying FreeBSD patches to gcc for ${DISTNAME}"
	-(  cd ${WRKDIR}/gcc-2.7.2.1; \
	   patch -s -f < ${PATCHDIR}/patch-freebsdgcc; )
	@echo "===>  Fixing ${DISTNAME} patches to gcc"
	-(  cd ${WRKSRC}/src; \
	   patch -s -f < ${PATCHDIR}/patch-gnat; )
	@echo "===>  Patching gcc for ${DISTNAME}"
	-(  cd ${WRKDIR}/gcc-2.7.2.1; \
	   patch -s -f < ${WRKSRC}/src/gcc-272.dif; )
	(cd ${WRKDIR}/gcc-2.7.2.1; \
	   cp -R ${WRKSRC}/src/ada ada; )

pre-configure:
	(cd ${WRKDIR}/gcc-2.7.2.1/ada; \
	   touch treeprs.ads a-[es]info.h nmake.ad[bs] )

do-build:
	(cd ${WRKDIR}/gcc-2.7.2.1; ${GMAKE} CC="${CC}" CFLAGS="-O2" LANGUAGES="${LANG}" )
	(cd ${WRKDIR}/gcc-2.7.2.1; ${GMAKE} CC="${CC}" CFLAGS="-O2" LANGUAGES="${LANG}" bootstrap )
	(cd ${WRKDIR}/gcc-2.7.2.1; ${GMAKE} CC="${CC}" CFLAGS="-O2" gnatlib_and_tools )

# patch the src that we are going to use and copy any additional files
# required into the correct locations
# use version specific patches where necessary
do-patch:
	(cd ${WRKDIR}; \
	   FILES="${PATCHDIR}/patch-[a-z][a-z]" ; \
	   SORTEDFILES=`echo $$FILES | tr " " "\n" | sort` ; \
	   for i in $$SORTEDFILES ; do \
	      echo Applying ---- $$i ;\
	      patch -s < $$i ;\
	   done )
	(cd ${FILESDIR}; \
	   for i in *.adb *.ads ; do \
	     cp $$i ${WRKDIR}/gcc-2.7.2.1/ada; \
	   done )

do-configure:
	(cd ${WRKDIR}/gcc-2.7.2.1; \
	   ./configure --prefix=${PREFIX} --program-prefix=ada )

do-install:
	(cd ${WRKDIR}/gcc-2.7.2.1; \
	   ${GMAKE} CC="${CC}" LANGUAGES="${LANG}" install )

post-install:
	@(echo "-----------------------------------------------------------" )
	@(echo "" )
	@(echo "For information about using the tasking library please read" )
	@(echo "the README.Tasking file" )
	@(echo "" )
	@(echo "-----------------------------------------------------------" )
	@(echo "" )

.include <bsd.port.mk>