#  Copyright (c) 2006  Joey Schulze <joey@infodrom.org>
#
#  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.
#
#  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

ifeq ($(shell whoami),root)
install=install -o root -g root
else
install=install
endif

all:
	$(MAKE) -C po
 
# Support i18n
pot:
	$(MAKE) -C po pot

# Continue with the mandatory targets
clean:
	$(MAKE) -C po clean
	find -name '*~' | xargs -r rm -f

install-bin:
	test -d $(prefix)/sbin || $(install) -d -g root -o root -m 755 $(prefix)/sbin
	$(install) -m 755 gak $(prefix)/sbin

install-pm:
	test -d $(prefix)/share/gui-apt-key || $(install) -d -g root -o root -m 755 $(prefix)/share/gui-apt-key/GAK
	$(install) -m 644 GAK/*.pm $(prefix)/share/gui-apt-key/GAK

install-po:
	$(MAKE) prefix=$(prefix) -C po install

install-man:
	test -d $(prefix)/share/man/man8 || $(install) -d -g root -o root -m 755 $(prefix)/share/man/man8
	$(install) -m 644 gak.8 $(prefix)/share/man/man8

install: install-bin install-pm install-po install-man

