/*   CrossFire, A Multiplayer game for X-windows
 *
 *   $Id: Imakefile,v 1.10 1998/08/01 09:09:25 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.
 */


/* Try to put configurable options up here, and then further down,
 * we can do the right thing.
 */

/* Do you want to use color pixmaps (as of now, I believe you must).
 * Basically, set up the Xpm_LibDir and Xpm_Include for the directories
 * where the library and include file reside.  If the reside in the
 * default location for X11 files, those values do not need to be
 * set.
 */

#define XPM_PIX
/*
#define Xpm_LibDir /usr/local/lib/
*/
/* If your include files are someplace odd */
/*#define Xpm_Include   /usr/local/include*/


/* Force CC to use the specified options instead of the default
 * This needs to be defined to the actual options (see commented
 * out example.  If ForceCCOPTIONS is defined, it will not use
 * any of the default compiler options for your machine.
  */
/*define ForceCCOPTIONS -O -g -Wall */
#undef ForceCCOPTIONS

/* Extra_Flags are added onto the compilers default options.  Can be
 * quite useful if you just want to add another flag or two, and not
 * want to mess around with the crossfire.cf file, or have to re-do all
 * the options withe ForceCCOPTIONS.
 */
/* for use with gcc, it will use /usr/local/bin for the additional
 * programs, like the linker and assembler.
 */
/* If you don't like all the debugging output, remove -DDEBUG */

#define Extra_Flags -B/usr/local/bin/ -ggdb -Wall

/* Force CC to be a specific compilator? Define this to be the
 * actual compiler (see example).  If defined, the default
 * compiler, and possible additional options, for your machine
 * will not be used. */

/*#define ForceCC gcc.258*/

/*
 * define this if your sun has acc instead gcc and you plan to
 * use acc to compile.
 */
#undef SunHasAcc

/* This is the reverse of the StupidSunHeaders.  By default, image
 * can figure out if the system lacks good header files based on
 * the version of the OS and the compiler.  However, if you have
 * installed glibc (GNU's C Library), it provides smart headers.  IF this
 * is the case, then #define SmartSunHeaders.
 */

/*#define SmartSunHeaders*/

/* Define this if you want to use the debug malloc library.  If you don't
 * have dmalloc, comment this out.
 */

#define Use_Dmalloc

/******************************************************************************
 * You should not need to change anything below here.
 *****************************************************************************/

#include "Client.tmpl"

VERSION = crossfire-0.94.3.client

HDRS = cconfig.h client.h clientbmap.h includes.h item.h \
	newclient.h proto.h soundsdef.h
SRCS = client.c commands.c init.c item.c misc.c newsocket.c player.c sound.c \
	x11.c
OBJS = $(SRCS:.c=.o)

FILES = $(SRCS) $(HDRS) Imakefile Protocol README README.old def_keys  \
	Client.tmpl xutil.c def-keys.h deftoheader.pl sounds
	
PROGRAMS = cfclient

INCLUDES = -I.

LOCAL_LIBRARIES =  $(XPM_LIBS) $(XLIB) $(DLSYM) $(DMALLOC_LIB) -lm


AllTarget(cfclient)
DependTarget()
NormalProgramTarget(cfclient, $(OBJS),$(DEPLIBS), $(LOCAL_LIBRARIES), NullParameter)
/*InstallProgram(cfclient,$(C_BINDIR))*/

../common/libcross.a:
	(cd ../common; $(MAKE) $(MFLAGS) all)

proto:
	cextract +p -P -o proto.h.bak -I$(INCROOT) -DCFCLIENT \
	-cpp-program="gcc -E -C" $(INCLUDES) $(SRCS)
	sed -e "s/#if __STDC__/#ifdef __STDC__/" -e "/__inline/d" < \
	proto.h.bak > proto.h
	$(RM) -f proto.h.bak
	chmod 664 proto.h

def-keys.h: def_keys 
	deftoheader.pl def_keys def-keys.h def_keys

soundsdef.h: sounds
	deftoheader.pl sounds soundsdef.h def_sounds


sound: sound.c
	$(CC) -o sound $(CFLAGS) $(INCLUDES) -DSOUNDTEST sound.c -lm
 

PackArchive($(VERSION))
InsertArchive($(FILES),.)

subarchive::
	cp -r ./pixmaps $(ATOP)/pixmaps
