# Copyright The HDF Group
# All rights reserved.
#
# This Makefile works on eosdap.hdfgroup.uiuc.edu.
#
.PHONY: clean all

# Put your HDF4 library path.
HDF4_DIR=/hdfdap/local

# Put your HDF-EOS2 library path.
HDFEOS2_DIR=/hdfdap/local

# Put your SZIP library path.
# Note:If you did not build HDF4 and HDF-EOS2 libraries with SZIP,
# comment out the following line. Otherwise, provide the SZIP library path
# SZIP source code at
#  http://www.hdfgroup.org/ftp/lib-external/szip/2.1/src/szip-2.1.tar.gz
#SZ_DIR=/usr/local/szip

# Put your JPEG library path.
# Note: JPEG is required by HDF4 and the current HDF4 only
# supports JPEG version 6b, you can find the JPEG source
# at http://www.hdfgroup.org/ftp/lib-external/jpeg/src/jpegsrc.v6b.tar.gz
JPEG_DIR=/mnt/scr1/hyoklee/i386

# Put your ZLIB library path.
# Note: ZLIB package normally comes with the system under /usr/lib, so you 
# probably don't provide the path. However, for some systems, you have to 
# install it by  yourself. So we leave the template here. Please comment out 
# the following line if you don't need it.
ZLIB_DIR=/usr


# Put your H4CF Conversion Toolkit Library path.
H4CF_DIR=/mnt/scr1/hyoklee/i386/h4cf


LIB_LIST=$(H4CF_DIR)/lib/libh4cf.a $(HDFEOS2_DIR)/lib/libhdfeos.a $(HDFEOS2_DIR)/lib/libGctp.a $(HDF4_DIR)/lib/libmfhdf.a $(HDF4_DIR)/lib/libdf.a $(JPEG_DIR)/lib/libjpeg.a  $(ZLIB_DIR)/lib/libz.a #  $(SZ_DIR)/lib/libsz.a 


CPPFLAGS+=-g -fstack-protector -w 
CPPFLAGS+= -I $(HDF4_DIR)/include
CPPFLAGS+= -I $(HDFEOS2_DIR)/include
CPPFLAGS+= -I $(H4CF_DIR)/include


all: read_subset read read_file_attrs read_var_attrs 

read_subset: read_subset.o  
	g++ -o $@ $^ $(LIB_LIST)

read: read.o
	g++ -o $@ $^ $(LIB_LIST)

read_file_attrs: read_file_attrs.o
	g++ -o $@ $^ $(LIB_LIST)

read_var_attrs: read_var_attrs.o
	g++ -o $@ $^ $(LIB_LIST)

read_subset.o: read_subset.cpp 
	g++ -g -c  $(CPPFLAGS)  $^

read.o: read.cpp
	g++ -g -c  $(CPPFLAGS)  $^

read_file_attrs.o: read_file_attrs.cpp
	g++ -g -c  $(CPPFLAGS)  $^

read_var_attrs.o: read_var_attrs.cpp
	g++ -g -c  $(CPPFLAGS)  $^

clean:
	rm -f *.o read read_subset read_file_attrs read_var_attrs

