#-------------------------------------------------------------------------#
#                                                                         #
#  COPYRIGHT[copyright mark] 2000, Raytheon System Company, its vendors,  #
#  and suppliers.  ALL RIGHTS RESERVED.                                   #
#                                                                         #
#-------------------------------------------------------------------------#
#----------------------------------------------------------------------------
# file:		makefile for HDF-EOS testdrivers
# 	
# 
# author:  Abe Taaheri 
#
# history:
#	10-Jul-2014 AT Initial version
#---------------------------------------------------------------------------

# force make to use the 'sh' shell
SHELL = /bin/ksh

# name of remove utility
MAKE=$(MAKECMD)
RM= /bin/rm
RMFLAGS= -f 
CEXTRAL =
FEXTRAL = 
CFLAGS= -g
FFLAGS = -O2 -g -fno-second-underscore
INCDIR = -I$(HDFINC) -I$(HDF5INC) -I$(HDFEOS5_INC) -I$(SZIPINC) -I$(ZLIBINC) -I$(JPEGINC) 
LIBDIR = -L$(HDFLIB) -L$(HDF5LIB) -L$(HDFEOS5_LIB) -L$(SZIPLIB) -L$(ZLIBLIB)  -L$(JPEGLIB) -lhe5_hdfeos -lGctp $(HDF5LIB)/libhdf5_hl.a $(HDF5LIB)/libhdf5.a $(JPEGLIB)/libjpeg.a -lz $(SZIPLIB)/libsz.a -lm -ldl

all: TestProfile_c TestSwath_c  TestGrid_c TestPoint_c TestZa_c TestAliasgrid_c TestAliasswath_c TestAliasza_ctestswath64_f testgrid64_f testpoint64_f testza64_f  testswath32_f testgrid32_f testpoint32_f testza32_f 
default all: TestProfile_c TestSwath_c  TestGrid_c TestPoint_c TestZa_c TestAliasgrid_c TestAliasswath_c TestAliasza_ctestswath64_f testgrid64_f testpoint64_f testza64_f  testswath32_f testgrid32_f testpoint32_f testza32_f 

TestSwath_c:
	@echo " "; echo " "; \
	echo " ---- Making *.ctestdriver in swath directory ----"; \
	cd ../swath; \
	$(CC) $(CFLAGS) -o TestSwath.o $(INCDIR) -c TestSwath.c; \
	$(CC) $(CFLAGS) -o TestSwath_c TestSwath.o $(LIBDIR) $(CEXTRAL); \
	$(RM) $(RMFLAGS) *.o;  echo " "; echo " "; \
	cd .;
TestProfile_c:
	@echo " "; echo " "; \
	echo " ---- Making *.c testdriver in swath directory ----"; \
	cd ../swath; \
	$(CC) $(CFLAGS) -o TestProfile.o $(INCDIR) -c TestProfile.c; \
	$(CC) $(CFLAGS) -o TestProfile_c TestProfile.o $(LIBDIR) $(CEXTRAL); \
	$(RM) $(RMFLAGS) *.o;  echo " "; echo " "; \
	cd .;
testswath64_f:
	@echo " "; echo " "; \
	echo " ---- Making *.f testdriver in swath directory ----"; \
	cd ../swath; \
	$(F77) $(FFLAGS) -o testswath64.o $(INCDIR) -c testswath64.f; \
	$(F77) $(FFLAGS) -o testswath64_f testswath64.o $(LIBDIR) $(FEXTRAL); \
	$(RM) $(RMFLAGS) *.o; echo " "; echo " "; \
	cd .;
TestGrid_c:
	@echo " "; echo " "; \
	echo " ---- Making *.c  testdriver in grid directory ----"; \
	cd ../grid;  \
	$(CC) $(CFLAGS) -o TestGrid.o $(INCDIR) -c TestGrid.c; \
	$(CC) $(CFLAGS) -o TestGrid_c TestGrid.o $(LIBDIR) $(CEXTRAL); \
	$(RM) $(RMFLAGS) *.o;  echo " "; echo " "; \
	cd .;
testgrid64_f:
	@echo " "; echo " "; \
	echo " ---- Making *.f testdriver in grid directory ----"; \
	cd ../grid; \
	$(F77) $(FFLAGS) -o testgrid64.o $(INCDIR) -c testgrid64.f; \
	$(F77) $(FFLAGS) -o testgrid64_f testgrid64.o $(LIBDIR) $(FEXTRAL); \
	$(RM) $(RMFLAGS) *.o; echo " "; echo " "; \
	cd .;
TestPoint_c:
	@echo " "; echo " "; \
	echo " ---- Making *.c testdriver in point directory ----"; \
	cd ../point;  \
	$(CC) $(CFLAGS) -o TestPoint.o $(INCDIR) -c TestPoint.c; \
	$(CC) $(CFLAGS) -o TestPoint_c TestPoint.o $(LIBDIR) $(CEXTRAL); \
	$(RM) $(RMFLAGS) *.o;  echo " "; echo " "; \
	cd .;
testpoint64_f:
	@echo " "; echo " "; \
	echo " ---- Making *.f testdriver in point directory ----"; \
	cd ../point; \
	$(F77) $(FFLAGS) -o testpoint64.o $(INCDIR) -c testpoint64.f; \
	$(F77) $(FFLAGS) -o testpoint64_f testpoint64.o $(LIBDIR) $(FEXTRAL); \
	$(RM) $(RMFLAGS) *.o;echo " "; echo " "; \
	cd .;
TestZa_c:
	@echo " "; echo " "; \
	echo " ---- Making *.c testdriver in za directory ----"; \
	cd ../za;  \
	$(CC) $(CFLAGS) -o TestZa.o $(INCDIR) -c TestZa.c; \
	$(CC) $(CFLAGS) -o TestZa_c TestZa.o $(LIBDIR) $(CEXTRAL); \
	cd .;  \
	$(RM) $(RMFLAGS) *.o;  echo " "; echo " "; \
	cd .;
TestAliasswath_c:
	@echo " "; echo " "; \
	echo " ---- Making *.c  testdriver in swath directory ----"; \
	cd ../swath; \
	$(CC) $(CFLAGS) -o TestAlias.o $(INCDIR) -c TestAlias.c; \
	$(CC) $(CFLAGS) -o TestAliasswath_c TestAlias.o $(LIBDIR) $(CEXTRAL); \
	$(RM) $(RMFLAGS) *.o;  echo " "; echo " "; \
	cd .;
TestAliasgrid_c:
	@echo " "; echo " "; \
	echo " ---- Making *.c  testdriver in grid directory ----"; \
	cd ../grid; \
	$(CC) $(CFLAGS) -o TestAlias.o $(INCDIR) -c TestAlias.c; \
	$(CC) $(CFLAGS) -o TestAliasgrid_c TestAlias.o $(LIBDIR) $(CEXTRAL); \
	$(RM) $(RMFLAGS) *.o;  echo " "; echo " "; \
	cd .;
TestAliasza_c:
	@echo " "; echo " "; \
	echo " ---- Making *.c  testdriver in za directory ----"; \
	cd ../za; \
	$(CC) $(CFLAGS) -o TestAlias.o $(INCDIR) -c TestAlias.c; \
	$(CC) $(CFLAGS) -o TestAliasza_c TestAlias.o $(LIBDIR) $(CEXTRAL); \
	$(RM) $(RMFLAGS) *.o;  echo " "; echo " "; \
	cd .;
testza64_f:
	@echo " "; echo " "; \
	echo " ---- Making *.f testdriver in za directory ----"; \
	cd ../za; \
	$(F77) $(FFLAGS) -o testza64.o $(INCDIR) -c testza64.f; \
	$(F77) $(FFLAGS) -o testza64_f testza64.o $(LIBDIR) $(FEXTRAL); \
	$(RM) $(RMFLAGS) *.o;  echo " "; echo " "; \
	cd .;
testswath32_f:
	@echo " "; echo " "; \
	echo " ---- Making *.f testdriver in swath directory ----"; \
	cd ../swath; \
	$(F77) $(FFLAGS) -o testswath32.o $(INCDIR) -c testswath32.f; \
	$(F77) $(FFLAGS) -o testswath32_f testswath32.o $(LIBDIR) $(FEXTRAL); \
	$(RM) $(RMFLAGS) *.o; echo " "; echo " "; \
	cd .;
testgrid32_f:
	@echo " "; echo " "; \
	echo " ---- Making *.f testdriver in grid directory ----"; \
	cd ../grid; \
	$(F77) $(FFLAGS) -o testgrid32.o $(INCDIR) -c testgrid32.f; \
	$(F77) $(FFLAGS) -o testgrid32_f testgrid32.o $(LIBDIR) $(FEXTRAL); \
	$(RM) $(RMFLAGS) *.o; echo " "; echo " "; \
	cd .;
testpoint32_f:
	@echo " "; echo " "; \
	echo " ---- Making *.f testdriver in point directory ----"; \
	cd ../point; \
	$(F77) $(FFLAGS) -o testpoint32.o $(INCDIR) -c testpoint32.f; \
	$(F77) $(FFLAGS) -o testpoint32_f testpoint32.o $(LIBDIR) $(FEXTRAL); \
	$(RM) $(RMFLAGS) *.o;echo " "; echo " "; \
	cd .;
testza32_f:
	@echo " "; echo " "; \
	echo " ---- Making *.f testdriver in za directory ----"; \
	cd ../za; \
	$(F77) $(FFLAGS) -o testza32.o $(INCDIR) -c testza32.f; \
	$(F77) $(FFLAGS) -o testza32_f testza32.o $(LIBDIR) $(FEXTRAL); \
	$(RM) $(RMFLAGS) *.o;  echo " "; echo " "; \
	cd .;
testgrid_szip32_f:
	@echo " "; echo " "; \
	echo " ---- Making *.f testdriver in grid directory ----"; \
	cd ../grid; \
	$(F77) $(FFLAGS) -o testgrid_szip32.o $(INCDIR) -c testgrid_szip32.f; \
	$(F77) $(FFLAGS) -o testgrid_szip32_f testgrid_szip32.o $(LIBDIR) $(FEXTRAL); \
	$(RM) $(RMFLAGS) *.o; echo " "; echo " "; \
	cd .;
testgrid_szip64_f:
	@echo " "; echo " "; \
	echo " ---- Making *.f testdriver in grid directory ----"; \
	cd ../grid; \
	$(F77) $(FFLAGS) -o testgrid_szip64.o $(INCDIR) -c testgrid_szip64.f; \
	$(F77) $(FFLAGS) -o testgrid_szip64_f testgrid_szip64.o $(LIBDIR) $(FEXTRAL); \
	$(RM) $(RMFLAGS) *.o; echo " "; echo " "; \
	cd .;