#
# New ultra-simple top-level Makefile for gentoo. Introduced with
# version 0.11.15, summer 2000.
#

all:
	@cd widgets && $(MAKE) && cd .. && cd src && $(MAKE)

# ----------------------------------------- Maintenance

clean:
	@cd widgets && $(MAKE) clean && cd .. && cd src && $(MAKE) clean
	rm -rf gentoo gentoo.po core

# ----------------------------------------- Installation (broken)

install:
	@echo "Installation of gentoo must currently be done manually. Sorry."
	@echo "First build it by typing 'make'. After compilation, the executable"
	@echo "file is \"src/gentoo\". Copy that to wherever you want it. Then"
	@echo "copy the icons/ subdirectory to e.g. \"/usr/local/gentoo/share\"."
	@echo "Copy \"gentoorc-example\" to \"~/.gentoorc\", for a reasonable config."
	@echo "Also copy \"gentoogtkrc-example\" to \"~/.gentoogtkrc\" if you want"
	@echo "to control how GTK+ widgets should look in gentoo."
	@echo "You will need to start gentoo and modify a Path setting for it"
	@echo "to be able to find the icons correctly."

# ----------------------------------------- Internationalization

# This extracts all marked-up strings for translation, and then merges the
# freshly created PO file with any existing translations. Each translation
# should live in the locale/ directory, within a language-specific subdir.
# In that subdir, there should be a LC_MESSAGES subdir, in which (finally)
# the language-specific PO-file should reside.
lang:
	xgettext -LC --force -dgentoo --keyword -k_ -kN_ $(SRC)/*.c &&\
	for l in locale/* ; do\
		cd $$l/LC_MESSAGES/ && msgmerge ./gentoo.po ../../../gentoo.po -ogentoo.po\
	;done

# This rebuilds the binary message catalogs for all translations.
# Handy when one or more locale-specific PO-files have changed.
langfmt:
	for l in locale/* ; do\
		cd $$l/LC_MESSAGES && msgfmt -ogentoo.mo gentoo.po\
	;done
