
export prefix=/usr/local
export milena_dir=$(prefix)/share/milena
export mbrola=$(shell which mbrola)
export mbrola_voice=$(shell ./find_mbrola_voice)
export speechd_dir=$(shell ./find_speechd)
export distro=$(shell uname -o)
export contrast=$(shell ./have_contrast)
all:
ifeq "$(mbrola_voice)" "none"
$(error Nie odnaleziono pl1/pl1)
endif
	make -C src all
	make -C data all
	make -C utils all
	make -C speechd all
	make -C milena_ws all
	make -C subplayer all

clean:
	rm found_voice
	make -C src clean
	make -C data clean
	make -C utils clean
	make -C speechd clean
	make -C milena_ws clean
	make -C subplayer clean
		
install:
	if [ -f pl_basewords.dat.gz ] ; then mkdir -p $(milena_dir)-words;zcat pl_basewords.dat.gz > $(milena_dir)-words/pl_basewords.dat; chmod 0755 $(milena_dir)-words;chmod 0644 $(milena_dir)-words/pl_basewords.dat;fi
	make -C src install
	ldconfig
	make -C data install
	make -C utils install
	make -C speechd install
	make -C milena_ws install
	make -C subplayer install
