# Edit the following variables as needed
HDF_INSTALL = 
CC          = cc
CFLAGS      = 
LIB         = -lm

INCLUDE   = -I$(HDF_INSTALL)/include
LIBSHDF   = -L$(HDF_INSTALL)/lib -lmfhdf -ldf -ljpeg -lz

SD: create_sds \
	write_to_sds \
	write_slab \
	alter_sds_values \
	unlimited_sds \
	mv_sds_to_external \
	read_from_sds \
	read_subsets \
	get_info \
	find_sds_by_name \
	set_get_dim_info \
	dimscale_vs_sds \
	set_attr \
	get_attr \
	compress_sds \
	chunking_example
 

create_sds: create_sds.c
	$(CC) $(CFLAGS) -o $@ create_sds.c $(INCLUDE) $(LIBSHDF) $(LIB)

write_to_sds: write_to_sds.c
	$(CC) $(CFLAGS) -o $@ write_to_sds.c $(INCLUDE) $(LIBSHDF) $(LIB)

write_slab: write_slab.c
	$(CC) $(CFLAGS) -o $@ write_slab.c $(INCLUDE) $(LIBSHDF) $(LIB)

alter_sds_values: alter_sds_values.c
	$(CC) $(CFLAGS) -o $@ alter_sds_values.c $(INCLUDE) $(LIBSHDF) $(LIB)

unlimited_sds: unlimited_sds.c
	$(CC) $(CFLAGS) -o $@ unlimited_sds.c $(INCLUDE) $(LIBSHDF) $(LIB)

mv_sds_to_external: mv_sds_to_external.c
	$(CC) $(CFLAGS) -o $@ mv_sds_to_external.c $(INCLUDE) $(LIBSHDF) $(LIB)
 
read_from_sds: read_from_sds.c
	$(CC) $(CFLAGS) -o $@ read_from_sds.c $(INCLUDE) $(LIBSHDF) $(LIB)
 
read_subsets: read_subsets.c
	$(CC) $(CFLAGS) -o $@ read_subsets.c $(INCLUDE) $(LIBSHDF) $(LIB)

get_info: get_info.c
	$(CC) $(CFLAGS) -o $@ get_info.c $(INCLUDE) $(LIBSHDF) $(LIB)

find_sds_by_name: find_sds_by_name.c
	$(CC) $(CFLAGS) -o $@ find_sds_by_name.c $(INCLUDE) $(LIBSHDF) $(LIB)

set_get_dim_info: set_get_dim_info.c
	$(CC) $(CFLAGS) -o $@ set_get_dim_info.c $(INCLUDE) $(LIBSHDF) $(LIB)

dimscale_vs_sds: dimscale_vs_sds.c
	$(CC) $(CFLAGS) -o $@ dimscale_vs_sds.c $(INCLUDE) $(LIBSHDF) $(LIB)

set_attr: set_attr.c
	$(CC) $(CFLAGS) -o $@ set_attr.c $(INCLUDE) $(LIBSHDF) $(LIB)

get_attr: get_attr.c
	$(CC) $(CFLAGS) -o $@ get_attr.c $(INCLUDE) $(LIBSHDF) $(LIB)
 
compress_sds: compress_sds.c
	$(CC) $(CFLAGS) -o $@ compress_sds.c $(INCLUDE) $(LIBSHDF) $(LIB)
 
chunking_example: chunking_example.c
	$(CC) $(CFLAGS) -o $@ chunking_example.c $(INCLUDE) $(LIBSHDF) $(LIB)

clean: 
	rm -f *.o create_sds \
	write_to_sds \
	write_slab \
	alter_sds_values \
	unlimited_sds \
	mv_sds_to_external \
	read_from_sds \
	read_subsets \
	get_info \
	find_sds_by_name \
	set_get_dim_info \
	dimscale_vs_sds \
	set_attr \
	get_attr \
	compress_sds \
	chunking_example
.SUFFIXES:.o.c
