#!/usr/bin/env make
#
# $Id: Makefile,v 1.1.1.1 2004/08/09 20:40:34 bmeurer Exp $
#
# Copyright (c) 2004 os-cillation
# All rights reserved.
#
# Written by Benedikt Meurer <bm@os-cillation.de>.
#
# 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, 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-1307, USA.
#

prefix=/usr

INSTALL_DIR=	install -d -o root -m 0755
INSTALL_DATA=	install -c -o root -m 0644
INSTALL_SCRIPT=	install -c -o root -m 0755

all: xnetcardconfig xnetcardconfig.real

install: all
	$(INSTALL_DIR) $(DESTDIR)$(prefix)/bin
	$(INSTALL_DIR) $(DESTDIR)$(prefix)/share/applications
	$(INSTALL_DIR) $(DESTDIR)$(prefix)/share/apps/xnetcardconfig
	$(INSTALL_DIR) $(DESTDIR)$(prefix)/share/pixmaps

	$(INSTALL_SCRIPT) xnetcardconfig $(DESTDIR)$(prefix)/bin/xnetcardconfig
	$(INSTALL_SCRIPT) xnetcardconfig.real $(DESTDIR)$(prefix)/bin/xnetcardconfig.real
	$(INSTALL_DATA) card.png $(DESTDIR)$(prefix)/share/pixmaps/xnetcardconfig.png
	$(INSTALL_DATA) card.png $(DESTDIR)$(prefix)/share/apps/xnetcardconfig/card.png
	$(INSTALL_DATA) logo.png $(DESTDIR)$(prefix)/share/apps/xnetcardconfig/logo.png
	$(INSTALL_DATA) xnetcardconfig.desktop $(DESTDIR)$(prefix)/share/applications/xfld-xnetcardconfig.desktop

xnetcardconfig: xnetcardconfig.in
	sed -e s,@PREFIX@,$(prefix),g < xnetcardconfig.in > xnetcardconfig
	chmod 0755 xnetcardconfig

xnetcardconfig.real: xnetcardconfig.real.in
	sed -e s,@PREFIX@,$(prefix),g < xnetcardconfig.real.in > xnetcardconfig.real
	chmod 0755 xnetcardconfig.real

clean:
	@rm -f xnetcardconfig
	@rm -f xnetcardconfig.real
