#############################################################
# Master Makefile for MIRS-0802 progam package
# REWRITED
# Jan-23-2009, created for MIRS-0802-pack Ver.0.4
#############################################################
all: compiles

compiles:
	@echo "================= making iotest program"
	(cd iotest; make)
	@echo "================= making irs_ts_ws program"
	(cd irs_ts_ws; make)
	@echo "================= making uss program"
	(cd uss; make)
	@echo "================= making pwm_enc program"
	(cd pwm_enc; make;)
	@echo "================= making control program"
	(cd control; make)
	@echo "================= making test program"
	(cd testprogram; make)

ins_files:
	@echo "================= correct install files"
	chmod 755 ins_modules
	chmod 755 rm_modules
	chmod 755 start.sh
	(cd download; chmod 755 aritecdownload)

install:
	usr_mount
	make ins_files
	make
	./rm_modules
	./start.sh

link:
	(cd testprogram; ln -s ../irs_ts_ws/irs_ts_ws_test; ln -s ../pwm_enc/enc_test; ln -s ../pwm_enc/system_check; ln -s ../uss/uss_test)
	(cd modules; ln -s ../irs_ts_ws/irs_ts_ws.o; ln -s ../pwm_enc/pwm_enc_module2.o; ln -s ../uss/uss_module.o)

clean:
	(cd testprogram; make allclean)
	(cd control; make allclean)
	(cd iotest; make clean)
	(cd uss; make clean)
	(cd irs_ts_ws; make clean)
