#  Makefile - Frontend for SAFT for X11
#  Copyright (c) 1998,9,2006  Joey Schulze <joey@infodrom.org>
#
#  This file is part of the Gerstensaft package.
#
#  This program is free software; you can redistribute it and/or modify
#  it under the terms of the GNU General Public License as published by
#  the Free Software Foundation; either version 2 of the License, or
#  (at your option) any later version.
#
#  This program is distributed in the hope that it will be useful,
#  but WITHOUT ANY WARRANTY; without even the implied warranty of
#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#  GNU General Public License for more details.
#
#  You should have received a copy of the GNU General Public License
#  along with this program; if not, write to the Free Software
#  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.

prefix = /usr/local

# You might need to adjust the PIXMAP_WM variables if these pixmaps go
# into a different directory than the general pixmap dir, in order to
# make them public for window managers.
#
#DEBUG=1
PIXMAP_DIR=$(prefix)/share/gerstensaft
PIXMAP_WM_DIR=$(PIXMAP_DIR)
LOCALE_DIR=$(prefix)/share/locale

# If you want to have Large File Support, set this
# CONFIG_LFS=1

config_h=src/config.h
all:
	echo "/* Do not edit, edit Makefile instead. */" > $(config_h)
	-test -n "$(DEBUG)" && echo "#define DEBUG" >> $(config_h)
	echo "#define PIXMAP_DIR \"$(PIXMAP_DIR)\"" >> $(config_h)
	echo "#define PIXMAP_WM_DIR \"$(PIXMAP_WM_DIR)\"" >> $(config_h)
	echo "#define LOCALE_DIR \"$(LOCALE_DIR)\"" >> $(config_h)
	cd src && $(MAKE) CONFIG_LFS=$(CONFIG_LFS) prefix=$(prefix)
	cd po && $(MAKE)

# Support i18n
pot:
	cd po && $(MAKE) pot

# Continue with the mandatory targets
clean:
	cd src && $(MAKE) clean
	cd po && $(MAKE) clean
	rm -f $(config_h)

install:
	cd src && $(MAKE) prefix=$(prefix) install
	cd pixmaps && $(MAKE) PIXMAP_DIR=$(PIXMAP_DIR) PIXMAP_WM_DIR=$(PIXMAP_WM_DIR) install
	cd man && $(MAKE) prefix=$(prefix) install
	cd po && $(MAKE) LOCALE_DIR=$(LOCALE_DIR) install

