/*   CrossFire, A Multiplayer game for X-windows
 *
 *   $Id: Imakefile,v 1.15 1998/01/05 10:23:03 master Exp master $
 *
 *   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"

INCLUDES = -I. -I../include/ $(RPLAY_INCDIR)

#ifdef XPM_PIX
XPM_LIB = $(XPM_LIBDIR) -lXpm
#endif

LOCAL_LIBRARIES = $(XLIB) $(DLSYM) $(MALLOC_LIBS)

#ifdef OSFArchitecture
LOCAL_LIBRARIES = $(LOCAL_LIBRARIES) -lbsd
TARGET = -Dosf1
#endif

DEFINES = -DFONTDIR=\"${FONTDIR}\" -DFONTNAME=\"$(FONTNAME)\" $(TARGET) \
      -DLIBDIR=\"$(C_LIBDIR)\" $(COMPRESS_DEF)

SRCS = client.c
OBJS = client.o

PROGRAMS = crossclient

AllTarget(crossclient)
DependTarget()
NormalProgramTarget(crossclient, $(OBJS),$(DEPLIBS), $(LOCAL_LIBRARIES), )
InstallProgram(crossclient,$(C_BINDIR))

proto:
	cextract +Ap -P -o proto.h.bak -I$(INCROOT) $(INCLUDES) \
	-I/usr/local/lib/gcc-include -cpp-program="gcc -E -C" \
	$(SRCS)
	sed -e "s/#if __STDC__/#ifdef __STDC__/" -e "s/__signed/signed/g" -e "/__inline/d" < proto.h.bak > proto.h
	chmod 664 proto.h

InsertArchive(Imakefile client.c proto.h,client)

ifi: crossclient install
	$(RM) crossclient
	$(MV) $(C_BINDIR)/crossclient $(C_BINDIR)/../$(HOSTTYPE)
	chmod 755 $(C_BINDIR)/../$(HOSTTYPE)/crossclient

patchlist::
	@echo client.c proto.h Imakefile > .patchlist
