#-----------------------------------------------------------------------------
# Makefile
#
# Simple makefile for installing the scripts.
#-----------------------------------------------------------------------------
.PHONY: all install clean check

# Inherit from upper-level make.config
TOP = ../..
include $(TOP)/make.config

SCRIPTS = \
    st_determine_grid_points.py \
    st_build_modtran_input.py \
    st_build_rttov_input.py \
    st_cleanup_rttov_coefficients.py \
    st_extract_auxiliary_merra_data.py \
    st_extract_aster_ged_data.py \
    st_generate_elevation.py \
    st_generate_products.py \
    st_generate_qa.py \
    st_generate_split_window_products.py \
    st_split_window.py \
    st_split_window_tpw_pred.py \
    st_split_window_defines.py \
    st_run_modtran.py \
    st_run_rttov.py \
    estimate_landsat_emissivity.py \
    estimate_landsat_emissivity_stdev.py \
    st_convert_bands.py

SCRIPT_IMPORTS = \
    build_st_data.py \
    st_exceptions.py \
    st_grid_points.py \
    st_rttov_defines.py \
    st_utilities.py \
    camel_utilities.py \
    emissivity_utilities.py

#-----------------------------------------------------------------------------
all:

#-----------------------------------------------------------------------------
install:
	install -d $(link_path)
	install -d $(st_install_path)
	@for file in $(SCRIPTS); do \
            echo "  installing $$file"; \
            install -m 755 $$file $(st_install_path) || exit 1; \
            ln -sf $(st_link_source_path)/$$file $(link_path)/$$file; \
        done;
	@for file in $(SCRIPT_IMPORTS); do \
            echo "  installing $$file"; \
            install -m 644 $$file $(st_install_path) || exit 1; \
            ln -sf $(st_link_source_path)/$$file $(link_path)/$$file; \
        done;
	st_cleanup_rttov_coefficients.py

#-----------------------------------------------------------------------------
clean:

#-----------------------------------------------------------------------------
check:
	@cd unit-tests; python unit-tests.py

