#
# This Makefile is for installing, since the code doesn't have to
# be compiled.
#

# some directories to use
PREFIX = /usr
BINDIR = $(PREFIX)/games
MANDIR = $(PREFIX)/share/man/man6
ICONDIR = $(PREFIX)/share/pixmaps
LOCALEDIR = $(PREFIX)/share/locale

# location of helper programs
MSGFMT = /usr/bin/msgfmt
INSTALL = /usr/bin/install

# available languages
LANGUAGES = de pl es

# you should not have to change anything below this line.

all:
	@echo Nothing has to be done. Please run "make install" as root.

clean:
	@echo Nothing to clean up. Done.

install:
	$(INSTALL) -d $(BINDIR)
	$(INSTALL) -d $(MANDIR)
	$(INSTALL) -d $(ICONDIR)
	$(INSTALL) -o root -g root -m 0755 animals-game $(BINDIR)
	$(INSTALL) -o root -g root -m 0644 animals-game.6.gz $(MANDIR)
	$(INSTALL) -o root -g root -m 0644 animals-game_16x16.xpm $(ICONDIR)
	$(INSTALL) -o root -g root -m 0644 animals-game_32x32.xpm $(ICONDIR)
	@for lang in $(LANGUAGES); do \
	    dir=$(LOCALEDIR)/$$lang/LC_MESSAGES; \
	    $(INSTALL) -d $$dir; \
	    $(INSTALL) -o root -g root -m 0644 po/$$lang.mo $$dir/animals-game.mo; \
	done;

# This is mainly to use before a new release comes out

languages:
	@for lang in $(LANGUAGES); do \
	    echo Converting language: $$lang; \
	    $(MSGFMT) po/$$lang.po --output-file=po/$$lang.mo; \
	done
