# file: $(NEDC_NFC)/src/util/shell/Makefile
#
# revision history:
#
# 20231009 (SM): prep for v2.0.0 release
# 20221216 (ML): initial version
#
# This Makefile builds all the bash script in this directory and place it
# in ./bin of the root directory
#

# get the current directory of Makefile
#
mkfile_path := $(abspath $(lastword $(MAKEFILE_LIST)))
mkfile_dir := $(dir $(mkfile_path))

# set the variable to the root of folder
#
NEDC_NFC=$(realpath $(mkfile_dir)/../..)

# define source and object files
#
DPATH_ENV = nedc_dpath_resnet_env.sh
DPATH_ENV_BFILE := $(basename $(DPATH_ENV))

DPATH_TRAIN = nedc_dpath_resnet_train.sh
DPATH_TRAIN_BFILE := $(basename $(DPATH_TRAIN))

DPATH_EXTRACT = nedc_dpath_resnet_extract_patch.sh
DPATH_EXTRACT_BFILE := $(basename $(DPATH_EXTRACT))

DPATH_DECODESLIDE = nedc_dpath_resnet_decode_slide.sh
DPATH_DECODESLIDE_BFILE := $(basename $(DPATH_DECODESLIDE))

# define an installation target
#
install:

	rm -f $(NEDC_NFC)/bin/$(DPATH_ENV_BFILE)
	cp -f $(DPATH_ENV) $(NEDC_NFC)/bin/$(DPATH_ENV_BFILE)
	cd $(NEDC_NFC)/bin; chmod u+rwx,g+rwx,o+rx $(DPATH_ENV_BFILE)

	rm -f $(NEDC_NFC)/bin/$(DPATH_TRAIN_BFILE)
	cp -f $(DPATH_TRAIN) $(NEDC_NFC)/bin/$(DPATH_TRAIN_BFILE)
	cd $(NEDC_NFC)/bin; chmod u+rwx,g+rwx,o+rx $(DPATH_TRAIN_BFILE)

	rm -f $(NEDC_NFC)/bin/$(DPATH_EXTRACT_BFILE)
	cp -f $(DPATH_EXTRACT) $(NEDC_NFC)/bin/$(DPATH_EXTRACT_BFILE)
	cd $(NEDC_NFC)/bin; chmod u+rwx,g+rwx,o+rx $(DPATH_EXTRACT_BFILE)

	rm -f $(NEDC_NFC)/bin/$(DPATH_DECODESLIDE_BFILE)
	cp -f $(DPATH_DECODESLIDE) $(NEDC_NFC)/bin/$(DPATH_DECODESLIDE_BFILE)
	cd $(NEDC_NFC)/bin; chmod u+rwx,g+rwx,o+rx $(DPATH_DECODESLIDE_BFILE)

#
# end of file
