#-----------------------------------------------------------------------------
# Makefile
#
# Simple makefile for building and installing espa-surface-temperature
# applications.
#-----------------------------------------------------------------------------
.PHONY: check-environment all install clean all-st install-st clean-st

include make.config

DIR_ST = provisional-st

all: all-st

install: check-environment install-st

clean: clean-st

#-----------------------------------------------------------------------------
all-st:
	echo "make all in scripts and provisional-st"; \
        (cd scripts; $(MAKE) all; cd ../$(DIR_ST); $(MAKE) all);

install-st: check-environment
	echo "make install in scripts and provisional-st"; \
        (cd scripts; $(MAKE) install; cd ../$(DIR_ST); $(MAKE) install);

clean-st:
	echo "make clean in scripts and provisional-st"; \
        (cd scripts; $(MAKE) clean; cd ../$(DIR_ST); $(MAKE) clean);

#-----------------------------------------------------------------------------
check-environment:
ifndef PREFIX
    $(error Environment variable PREFIX is not defined)
endif

