# file: $(NEDC_NFC)/src/class/Makefile
#
# revision history:
#
# 20230422 (JP): reviewed for release
# 20221216 (ML): initial version
#
# This Makefile builds all the classes and parameter files in this directory
# and puts them in $NEDC_NFC/lib and adjusts the permissions
#

# 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
#
EEG_DECODE = ./nedc_decode/nedc_decoder.py
EEG_DECODE_FILE := nedc_decoder.py

EEG_POSTPROCESS = ./nedc_postprocess/nedc_postprocess.py
EEG_POSTPROCESS_FILE := nedc_postprocess.py

# define an installation target
#
install:
	rm -f $(NEDC_NFC)/lib/$(EEG_DECODE_FILE)
	cp -f $(EEG_DECODE) $(NEDC_NFC)/lib/$(EEG_DECODE_FILE)
	cd $(NEDC_NFC)/lib; chmod u+rwx,g+rwx,o+rx $(EEG_DECODE_FILE)

	rm -f $(NEDC_NFC)/lib/$(EEG_POSTPROCESS_FILE)
	cp -f $(EEG_POSTPROCESS) $(NEDC_NFC)/lib/$(EEG_POSTPROCESS_FILE)
	cd $(NEDC_NFC)/lib; chmod u+rwx,g+rwx,o+rx $(EEG_POSTPROCESS_FILE)

#
# end of file
