# HDF5 HL_REGION version 1.1.1 currently under development
# 
# Copyright by The HDF Group.
# All rights reserved.
#
# This file is part of the hl_region High-Level HDF5 APIs.  The full copyright 
# notice, including terms governing use, modification, and redistribution, 
# is contained in the file COPYING, which can be found at the root of the
# source code distribution tree and in the documentation directory (doc/html/).  
# If you do not have access to this file, you may request a copy of 
# "the hl_region High-Level HDF5 APIs copyright and license statement" from 
# help@hdfgroup.org.
# 
############################################################################
#
#  Program:         HL REGION
#
#  Module:          Makefile
#
#  Purpose:         Top-level Makefile to build C interfaces.
#
#  Creation date:   July 24, 2009
#
#  Notes: User must set the enviroment variable HDF5_INSTALL_DIR to 
#         the location hdf5 is installed. 
#
############################################################################

PREFIX = $(HDF5_INSTALL_DIR)

all: compile

compile:
	(cd src; $(MAKE))
	(cd examples; $(MAKE))
	(cd test; $(MAKE))

install:
	(mkdir -p $(PREFIX)/lib)
	(mkdir -p $(PREFIX)/include)
	(cp src/libhdf5_hl_region.a $(PREFIX)/lib )
	(cp src/hl_region_H5LRpublic.h $(PREFIX)/include )
	(cp src/hl_region_H5LTpublic.h $(PREFIX)/include )
	(cp src/h5hl_region.h $(PREFIX)/include )


tests:
	(cd test; $(MAKE) tests )
	(cd examples; $(MAKE) tests )

clean:
	(cd src; $(MAKE) clean )
	(cd examples; $(MAKE)  clean )
	(cd test; $(MAKE) clean )
	(cd fortran/src; $(MAKE) clean )
	(cd fortran/examples; $(MAKE)  clean )
	(cd fortran/test; $(MAKE) clean )

uninstall:
	(\rm -f $(PREFIX)/lib/libhdf5_hl_region.a)
	(\rm -f $(PREFIX)/include/hl_region_H5LRpublic.h)
	(\rm -f $(PREFIX)/include/hl_region_H5LTpublic.h)
	(\rm -f $(PREFIX)/include/h5hl_region.h)
	(\rm -f $(PREFIX)/lib/libhdf5_hl_region_fortran.a)
	(\rm -f $(PREFIX)/include/hl_region_*.mod)
