summaryrefslogtreecommitdiff
path: root/science/hdf/Makefile
blob: 761f28aefb08f0c846a50f394bc8be55ca84eb14 (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
# New ports collection makefile for:	HDF_lib
# Version required:	4.1r2
# Date created:		17 November 1996
# Whom:			mi
#
# $Id: Makefile,v 1.8 1998/09/15 11:45:52 asami Exp $
#

DISTNAME=	HDF4.1r2
PKGNAME=	hdf-4.1r2
CATEGORIES=	graphics
MASTER_SITES=	ftp://ftp.ncsa.uiuc.edu/HDF/HDF4.1r2/tar/

MAINTAINER=	mi@aldan.ziplink.net

LIB_DEPENDS=	jpeg.9:${PORTSDIR}/graphics/jpeg

MAN1=		hdf.1 hdfunpac.1 ncdump.1 ncgen.1

GNU_CONFIGURE=	yes
FC?=		f77 # Can also be g77 for the newer one
MAKE_FLAGS=	CC="$(CC)" FC="${FC}" -f
MAKE_ENV=	pwrkdir=${WRKDIR}
#"wrkdir" doesn't work for some reason in the above

# This will create dummy Makefiles and some links in the jpeg and libz
# subdirectories. This way, we do not need to hunt all the dependencies
# out. Shame on the lib's developers, though, this can not be done through
# `configure'.	-mi
pre-build:
	${AR} -r ${WRKDIR}/libz.a /dev/null
	${RANLIB} ${WRKDIR}/libz.a
	test -d ${WRKSRC}/hdf/jpeg.came-with-HDF || \
		${MV} -f ${WRKSRC}/hdf/jpeg ${WRKSRC}/hdf/jpeg.came-with-HDF
	-${MKDIR} ${WRKSRC}/hdf/jpeg
	${RM} -f ${WRKSRC}/hdf/jpeg/Makefile
	${ECHO} #Phony makefile > ${WRKSRC}/hdf/jpeg/Makefile
	${ECHO} >> ${WRKSRC}/hdf/jpeg/Makefile
	${ECHO} libjpeg.a: >> ${WRKSRC}/hdf/jpeg/Makefile
	printf '\t@echo Using the already installed JPEG library\n' \
		>> ${WRKSRC}/hdf/jpeg/Makefile
	printf '\nclean:\n\ttrue\n' >> ${WRKSRC}/hdf/jpeg/Makefile
	printf '\ninstall-lib:\n\ttrue\n' >> ${WRKSRC}/hdf/jpeg/Makefile
	printf '\ninstall:\n\ttrue\n' >> ${WRKSRC}/hdf/jpeg/Makefile
	-ln -s ${PREFIX}/lib/libjpeg* ${WRKSRC}/hdf/jpeg/
	-ln -s ${PREFIX}/include/j*.h ${WRKSRC}/hdf/jpeg/
	test -d ${WRKSRC}/hdf/zlib.came-with-HDF || \
		${MV} -f ${WRKSRC}/hdf/zlib ${WRKSRC}/hdf/zlib.came-with-HDF
	-${MKDIR} ${WRKSRC}/hdf/zlib
	${RM} -f ${WRKSRC}/hdf/zlib/Makefile
	${ECHO} #Phony makefile > ${WRKSRC}/hdf/zlib/Makefile
	${ECHO} >> ${WRKSRC}/hdf/zlib/Makefile
	${ECHO} libzlib.a: >> ${WRKSRC}/hdf/zlib/Makefile
	printf '\t@echo Using the already installed ZLIB library\n' \
		>> ${WRKSRC}/hdf/zlib/Makefile
	printf '\nclean:\n\ttrue\n' >> ${WRKSRC}/hdf/zlib/Makefile
	printf '\ninstall-lib:\n\ttrue\n' >> ${WRKSRC}/hdf/zlib/Makefile
	printf '\ninstall:\n\ttrue\n' >> ${WRKSRC}/hdf/zlib/Makefile
	-ln -s /usr/lib/${BINFORMAT}/libz* ${WRKSRC}/hdf/zlib/
	-ln -s /usr/include/zconf.h /usr/include/zlib.h ${WRKSRC}/hdf/zlib/

post-install:
	@for binary in `grep ^bin/ ${PLIST}` ; do strip ${PREFIX}/$$binary; done

test:
	cd ${WRKSRC}; make ${MAKE_FLAGS} ${MAKEFILE} test

.include <bsd.port.mk>