all:
	cp -f /home/svoboda/Fuze/GOLEM/operation/parameters.pl .
	make -iB basicevaluations
	make -iBf makefile.gp all
	make -iBf makefile.www all


basicevaluations:
	echo "O" > Plasma
	make DataGeneration DATA=Btoroidal
	make DataGeneration DATA=Uloop
	make DataGeneration DATA=Irogowski
	make DataGeneration DATA=Iplasma
	make DataGeneration DATA=Photod
	perl TotalCharge.pl;
	perl  PlasmaDetect.pl;
	if [ -f PlasmaStart -a -f PlasmaEnd ]; then\
		perl  MeanBt.pl;\
		perl  PlasmaTotalCharge.pl;\
		perl  UloopPlasma.pl;\
		perl  OhmicHeatingPower.pl;\
		perl  Qedge.pl;\
		perl  ElectronTemperature.pl;\
		perl  BreakDownVoltage.pl;\
		perl  StateEqElectronDensity.pl;\
		perl  ElectronConfinementTimeFirstApprox.pl;\
	else \
	echo "O" > Plasma;\
	fi   
	perl  Failures.pl;


DataGeneration:
	perl  $(DATA).pl
	sed 's/\./,/g' $(DATA)_dp.csv > $(DATA)_cp.csv	

edit:
	emacs *.pl *.gp  makefile makefile.* &

test:
	make DataGeneration DATA=SummaryRow;cat SummaryRow_dp.csv


gp:
	make -i -f makefile.gp all

www:
	make -i -f makefile.www all

links:
	ln -fs /home/svoboda/Fuze/GOLEM/analyzy/0210DAS/makefile .
	ln -fs /home/svoboda/Fuze/GOLEM/analyzy/0210DAS/*.pl .
	ln -fs /home/svoboda/Fuze/GOLEM/analyzy/0210DAS/makefile.www .
	ln -fs /home/svoboda/Fuze/GOLEM/analyzy/0210DAS/makefile.gp .

clean:
	rm graph*.* *.csv PlasmaStart PlasmaEnd

bla:
	make all
	make -i test