void: fact_extract
	echo "To build data, type: make ascii, make tex, or make html"

fact_extract: fact_extract.c
	gcc fact_extract.c   -o fact_extract

ascii: fact_extract
	rm -rf data others
	mkdir -p data others
	./fact_extract -source factbook.txt
	cat others/gaza_strip.txt > data/ps.txt
	echo -n -e "\n-------------------------------------" >> data/ps.txt
	echo -e "----------------------------------------\n" >> data/ps.txt
	cat others/west_bank.txt >> data/ps.txt

tex: fact_extract
	rm -rf data others
	mkdir -p data others
	./fact_extract -tex -source factbook.txt
	grep --revert-match "\\end" others/gaza_strip.tex > data/ps.tex
	echo "\\vskip1cm" >> data/ps.tex
	tail +2 others/west_bank.tex >> data/ps.tex
	cd data ; ln -sf ../macros.tex macros.tex

html: fact_extract
	rm -rf data others
	mkdir -p data others
	./fact_extract -html -source factbook.txt
	cat others/gaza_strip.html > data/ps.html
	cat others/west_bank.html >> data/ps.html

clean:
	rm -f fact_extract *~ core
	rm -rf data others

