INSTALLROOT = $(TMTOOLS_ROOT)
SCRIPTS = bautime make_extents make_modecdf \
          process_lzp_dir remake_ext treeconvert utco \
	  lzp_wrapper  vc_wrapper process_vc_file datesplit socmerge \
	  statev2_wrapper \
          link_highest_version fix_l1_times vc_sort ephem_definitive_wrapper process_definitive_ephem \
	  goes_import_raw goesl2_wrapper process_goes_raw statev3_wrapper process_statev3 \
	  find_fgm_overlaps make_spinmodel goes_v01_links copy_spinmodel_vars copy_state_cdfs \
	  make_products_hierarchy process_vc_batch process_lzp_batch check_l0_products check_l1_products \
	  onesecmark_spin_phases write_probe_timing_phases process_prelim_ephem split_ephem_ascii_24h \
	  ephem_prelim_wrapper ecl_sunpulse_wrapper ecl_fgm_corr_wrapper ecl_spin_corrections_wrapper

install:	$(SCRIPTS)
		install $(SCRIPTS) $(INSTALLROOT)/bin

process_vc_file:	process_vc_file.bash
	sed 's|xxxTMTOOLS_SETUP_BOURNE|${TMTOOLS_ROOT}/tmtools_setup.bourne|' < process_vc_file.bash > process_vc_file
	chmod 755 process_vc_file

process_lzp_dir:	process_lzp_dir.bash
	sed 's|xxxTMTOOLS_SETUP_BOURNE|${TMTOOLS_ROOT}/tmtools_setup.bourne|' < process_lzp_dir.bash > process_lzp_dir
	chmod 755 process_lzp_dir

lzp_wrapper:	lzp_wrapper.bash
	sed 's|xxxTMTOOLS_SETUP_BOURNE|${TMTOOLS_ROOT}/tmtools_setup.bourne|' < lzp_wrapper.bash > lzp_wrapper
	chmod 755 lzp_wrapper

make_spinmodel:	make_spinmodel.bash
	sed 's|xxxTMTOOLS_SETUP_BOURNE|${TMTOOLS_ROOT}/tmtools_setup.bourne|' < make_spinmodel.bash > make_spinmodel
	chmod 755 make_spinmodel

copy_spinmodel_vars:	copy_spinmodel_vars.bash
	sed 's|xxxTMTOOLS_SETUP_BOURNE|${TMTOOLS_ROOT}/tmtools_setup.bourne|' < copy_spinmodel_vars.bash > copy_spinmodel_vars
	chmod 755 copy_spinmodel_vars

vc_wrapper:	vc_wrapper.bash
	sed 's|xxxTMTOOLS_SETUP_BOURNE|${TMTOOLS_ROOT}/tmtools_setup.bourne|' < vc_wrapper.bash > vc_wrapper
	chmod 755 vc_wrapper

process_statev3:	process_statev3.bash
	sed 's|xxxTMTOOLS_SETUP_BOURNE|${TMTOOLS_ROOT}/tmtools_setup.bourne|' < process_statev3.bash > process_statev3
	chmod 755 process_statev3

statev2_wrapper:	statev2_wrapper.bash
	sed 's|xxxTMTOOLS_SETUP_BOURNE|${TMTOOLS_ROOT}/tmtools_setup.bourne|' < statev2_wrapper.bash > statev2_wrapper
	chmod 755 statev2_wrapper

statev3_wrapper:	statev3_wrapper.bash
	sed 's|xxxTMTOOLS_SETUP_BOURNE|${TMTOOLS_ROOT}/tmtools_setup.bourne|' < statev3_wrapper.bash > statev3_wrapper
	chmod 755 statev3_wrapper

ephem_definitive_wrapper:	ephem_definitive_wrapper.bash
	sed 's|xxxTMTOOLS_SETUP_BOURNE|${TMTOOLS_ROOT}/tmtools_setup.bourne|' < ephem_definitive_wrapper.bash > ephem_definitive_wrapper
	chmod 755 ephem_definitive_wrapper

process_definitive_ephem:	process_definitive_ephem.bash
	sed 's|xxxTMTOOLS_SETUP_BOURNE|${TMTOOLS_ROOT}/tmtools_setup.bourne|' < process_definitive_ephem.bash > process_definitive_ephem
	chmod 755 process_definitive_ephem

goes_import_raw:	goes_import_raw.bash
	sed 's|xxxTMTOOLS_SETUP_BOURNE|${TMTOOLS_ROOT}/tmtools_setup.bourne|' < goes_import_raw.bash > goes_import_raw 
	chmod 755 goes_import_raw

goesl2_wrapper:	goesl2_wrapper.bash
	sed 's|xxxTMTOOLS_SETUP_BOURNE|${TMTOOLS_ROOT}/tmtools_setup.bourne|' < goesl2_wrapper.bash > goesl2_wrapper 
	chmod 755 goesl2_wrapper

process_goes_raw:	process_goes_raw.bash
	sed 's|xxxTMTOOLS_SETUP_BOURNE|${TMTOOLS_ROOT}/tmtools_setup.bourne|' < process_goes_raw.bash > process_goes_raw 
	chmod 755 process_goes_raw

goes_v01_links:	goes_v01_links.bash
	sed 's|xxxTMTOOLS_SETUP_BOURNE|${TMTOOLS_ROOT}/tmtools_setup.bourne|' < goes_v01_links.bash > goes_v01_links
	chmod 755 goes_v01_links

find_fgm_overlaps:	find_fgm_overlaps.bash
	sed 's|xxxTMTOOLS_SETUP_BOURNE|${TMTOOLS_ROOT}/tmtools_setup.bourne|' < find_fgm_overlaps.bash > find_fgm_overlaps
	chmod 755 find_fgm_overlaps

copy_state_cdfs:	copy_state_cdfs.bash
	sed 's|xxxTMTOOLS_SETUP_BOURNE|${TMTOOLS_ROOT}/tmtools_setup.bourne|' < copy_state_cdfs.bash > copy_state_cdfs
	chmod 755 copy_state_cdfs

make_products_hierarchy:	make_products_hierarchy.bash
	sed 's|xxxTMTOOLS_SETUP_BOURNE|${TMTOOLS_ROOT}/tmtools_setup.bourne|' < make_products_hierarchy.bash > make_products_hierarchy
	chmod 755 make_products_hierarchy

process_vc_batch:	process_vc_batch.bash
	sed 's|xxxTMTOOLS_SETUP_BOURNE|${TMTOOLS_ROOT}/tmtools_setup.bourne|' < process_vc_batch.bash > process_vc_batch
	chmod 755 process_vc_batch

process_lzp_batch:	process_lzp_batch.bash
	sed 's|xxxTMTOOLS_SETUP_BOURNE|${TMTOOLS_ROOT}/tmtools_setup.bourne|' < process_lzp_batch.bash > process_lzp_batch
	chmod 755 process_lzp_batch

check_l0_products:	check_l0_products.bash
	sed 's|xxxTMTOOLS_SETUP_BOURNE|${TMTOOLS_ROOT}/tmtools_setup.bourne|' < check_l0_products.bash > check_l0_products
	chmod 755 check_l0_products

check_l1_products:	check_l1_products.bash
	sed 's|xxxTMTOOLS_SETUP_BOURNE|${TMTOOLS_ROOT}/tmtools_setup.bourne|' < check_l1_products.bash > check_l1_products
	chmod 755 check_l1_products
onesecmark_spin_phases:		onesecmark_spin_phases.bash
	sed 's|xxxTMTOOLS_SETUP_BOURNE|${TMTOOLS_ROOT}/tmtools_setup.bourne|' < onesecmark_spin_phases.bash > onesecmark_spin_phases
	chmod 755 onesecmark_spin_phases
write_probe_timing_phases:	write_probe_timing_phases.bash
	sed 's|xxxTMTOOLS_SETUP_BOURNE|${TMTOOLS_ROOT}/tmtools_setup.bourne|' < write_probe_timing_phases.bash > write_probe_timing_phases
	chmod 755 write_probe_timing_phases
process_prelim_ephem:		process_prelim_ephem.bash
	sed 's|xxxTMTOOLS_SETUP_BOURNE|${TMTOOLS_ROOT}/tmtools_setup.bourne|' < process_prelim_ephem.bash > process_prelim_ephem
	chmod 755 process_prelim_ephem
split_ephem_ascii_24h:		split_ephem_ascii_24h.bash
	sed 's|xxxTMTOOLS_SETUP_BOURNE|${TMTOOLS_ROOT}/tmtools_setup.bourne|' < split_ephem_ascii_24h.bash > split_ephem_ascii_24h
	chmod 755 split_ephem_ascii_24h
ephem_prelim_wrapper:		ephem_prelim_wrapper.bash
	sed 's|xxxTMTOOLS_SETUP_BOURNE|${TMTOOLS_ROOT}/tmtools_setup.bourne|' < ephem_prelim_wrapper.bash > ephem_prelim_wrapper
	chmod 755 ephem_prelim_wrapper
ecl_sunpulse_wrapper:		ecl_sunpulse_wrapper.bash
	sed 's|xxxTMTOOLS_SETUP_BOURNE|${TMTOOLS_ROOT}/tmtools_setup.bourne|' < ecl_sunpulse_wrapper.bash > ecl_sunpulse_wrapper
	chmod 755 ecl_sunpulse_wrapper
ecl_fgm_corr_wrapper:		ecl_fgm_corr_wrapper.bash
	sed 's|xxxTMTOOLS_SETUP_BOURNE|${TMTOOLS_ROOT}/tmtools_setup.bourne|' < ecl_fgm_corr_wrapper.bash > ecl_fgm_corr_wrapper
	chmod 755 ecl_fgm_corr_wrapper
ecl_spin_corrections_wrapper:		ecl_spin_corrections_wrapper.bash
	sed 's|xxxTMTOOLS_SETUP_BOURNE|${TMTOOLS_ROOT}/tmtools_setup.bourne|' < ecl_spin_corrections_wrapper.bash > ecl_spin_corrections_wrapper
	chmod 755 ecl_spin_corrections_wrapper
