prefix = /usr
exec_prefix = ${prefix}
bindir = ${exec_prefix}/bin
ibindir = $(DESTDIR)$(bindir)
sharedir = ${exec_prefix}/share/tuxrip
isharedir = $(DESTDIR)$(sharedir)
version = 0.99rc1
INSTALL = /usr/bin/install
INSTALL_PROGRAM = ${INSTALL} -m 755
INSTALL_OTHERS = ${INSTALL} -m 666

install:
	if [ ! -d $(ibindir) ]; then $(INSTALL) -d $(ibindir); fi
	$(INSTALL_PROGRAM) tuxrip $(ibindir)
	if [ ! -d $(isharedir) ]; then $(INSTALL) -d $(isharedir); fi
	if [ ! -d $(isharedir)/lang ]; then $(INSTALL) -d $(isharedir)/lang; fi
	$(INSTALL_OTHERS) lang/*.lang $(isharedir)/lang
	$(INSTALL_PROGRAM) transperl.pl $(isharedir)
	$(INSTALL_OTHERS) tuxrip_encode-$(version) $(isharedir)
	$(INSTALL_OTHERS) tuxrip_mix-$(version) $(isharedir)
	$(INSTALL_OTHERS) tuxrip_conf-$(version) $(isharedir)
	$(INSTALL_OTHERS) tuxrip_analyze-$(version) $(isharedir)
	$(INSTALL_OTHERS) tuxrip_project-$(version) $(isharedir)
	$(INSTALL_OTHERS) tuxrip_videosettings-$(version) $(isharedir)
	$(INSTALL_OTHERS) tuxrip_cmdline-$(version) $(isharedir)
	$(INSTALL_OTHERS) tuxrip_preset $(isharedir)
	$(INSTALL_OTHERS) tuxrip_auto $(isharedir)
	$(INSTALL_OTHERS) CHANGELOG $(isharedir)
	$(INSTALL_OTHERS) CHANGELOG.en $(isharedir)


uninstall:
	rm -f $(ibindir)/tuxrip
	rm -rf $(isharedir)
