/*   CrossFire, A Multiplayer game for X-windows
 *
 *   $Id: Imakefile,v 1.5 1993/04/22 06:05:09 frankj Exp $
 *
 *   Copyright (C) 1992 Frank Tore Johansen
 *
 *   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., 675 Mass Ave, Cambridge, MA 02139, USA.
 *
 *   The author can be reached via e-mail to frankj@ifi.uio.no.
 */

#include "../config/crossfire.tmpl"

AllTarget(emptyrule)

DependTarget()

install:: install_scripts

install_scripts:
	MakeDir($(ADMDIR))
	MakeDir($(C_BINDIR))
	rm -f $(ADMDIR)/flushmaps $(ADMDIR)/flushlocks
	sed s%xxxx%$(C_LIBDIR)%g <flushmaps >$(ADMDIR)/flushmaps
	sed s%xxxx%$(C_LIBDIR)%g <flushlocks >$(ADMDIR)/flushlocks
	chmod 755 $(ADMDIR)/flushmaps $(ADMDIR)/flushlocks
	rm -f $(C_BINDIR)/crosserv.pl
	sed -e s%FONTDIR%$(FONTDIR)%g -e s%BINDIR%$(C_BINDIR)%g <crosserv.pl >$(C_BINDIR)/crosserv.pl
	chmod 755 $(C_BINDIR)/crosserv.pl
/*	rm -f $(C_BINDIR)/crossloop.pl */
/*	sed s%BINDIR%$(C_BINDIR)%g <crossloop.pl >$(C_BINDIR)/crossloop.pl */
/*	chmod 755 $(C_BINDIR)/crossloop.pl */
	rm -f $(C_BINDIR)/crossrem.pl
	sed s%BINDIR%$(C_BINDIR)%g <crossrem.pl >$(C_BINDIR)/crossrem.pl
	chmod 755 $(C_BINDIR)/crossrem.pl
	rm -f $(C_BINDIR)/tcpsockets.pl $(C_BINDIR)/gensym.pl
	cp tcpsockets.pl gensym.pl $(C_BINDIR)
	rm -f $(C_BINDIR)/crossloop
	cp crossrem.pl tcpsockets.pl gensym.pl $(C_BINDIR)
	sed s%BINDIR%$(C_BINDIR)%g <crossloop >$(C_BINDIR)/crossloop
	chmod 755 $(C_BINDIR)/crossloop

clean::

FILES = ad2c.script mapconv.pl crossloop \
	crosserv.pl crossloop.pl crossrem.pl flushlocks \
	flushmaps gensym.pl tcpsockets.pl

/* modified by Petri.Heinila@lut.fi */

/* InstallScript(ad2c,$(C_BINDIR)) */

InstallPerl(mapconv,$(C_BINDIR))

InsertArchieve(Imakefile $(FILES),utils)

/*** end of Imakefile ***/
