# Generated automatically from Makefile.in by configure.
#  Makefile for CodeWar v0.4
# 
#  Copyright (C) 1995-96 Rhett D. Jacobs <rdj@cea.com.au>
# 
#  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 1, 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.
#
#  Last Modified: <rdj>
#
CC=		gcc
SHELL=		/bin/sh
SRCDIR=		/home/rhett/CodeWar/src
VPATH=		/home/rhett/CodeWar/src
CODE_LIB=	/home/rhett/CodeWar/lib
CODE_BIN=	/home/rhett/CodeWar/bin
CFLAGS=		-g -O -fPIC -Wall -pipe
LDLIB=		-lXpm -lX11 -lm

# On Xenix and the IBM RS6000, double-dot gets screwed up.
dot = 		.
LIBDIR=		$(CODE_LIB)
LIBINC=		-L/usr/X11R6/lib -L$(LIBDIR)
INCLUDE=	-I/usr/X11R6/include
OUTPUT=		$(CODE_BIN)/CodeWar
LIBOUT=		libCodeWar.so
LIBPATH=	$(LIBDIR)/
DEPEND=		gccmakedep
SRCS=		misc.c \
		resource.c	x11.c		simulate.c \
		sim_timers.c	x11_misc.c 	graphics.c \
		damage.c \
		player.c	server.c \
		messages.c	client.c	timers.c \
		srv_ops.c	clt_rqs.c	clt_ops.c \
		srv_rqs.c \
		scan.c		weapon.c	explosion.c
LIBOBJ=		$(SRCS:.c=.o)
HEADERS=	$(SRCS:.c=.h)	cw.h		config.h
OBJECTS=	CodeWar.o

all:		clean $(OUTPUT) progs
quick:          cleanish $(OUTPUT)
system:		clean depend all
lib:		$(LIBOUT)
$(LIBOUT):	$(LIBOBJ)
		$(CC) -shared -Wl,-soname,$(LIBPATH)$(LIBOUT).1 -o \
		$(LIBPATH)$(LIBOUT).1.0 $(LIBOBJ) 
		ln -s $(LIBOUT).1.0 $(LIBPATH)$(LIBOUT).1
		ln -s $(LIBOUT).1 $(LIBPATH)$(LIBOUT)
		cd $(LIBDIR)
		export LD_LIBRARY_PATH=`pwd`:$$LD_LIBRARY_PATH
		cd $(SRCDIR)
$(OUTPUT):	$(LIBOUT) $(OBJECTS)
		$(CC) -o $@ $(OBJECTS) $(LIBPATH)$(LIBOUT) $(LDLIB) $(LIBINC)
.SUFFIXES:	.c .h .o
.PHONY:		clean tar length depend progs backup
progs:
		cd $(dot)$(dot)/progs ; make all
.c.o:
		$(CC) $(CFLAGS) -c $*.c $(INCLUDE)
tar:
		cd ../.. ; \
		tar zcvf CodeWar.tgz \
		CodeWar/src/*.[ch] CodeWar/src/Makefile \
		CodeWar/src/pixmaps/* \
		CodeWar/progs/*.[ch] CodeWar/progs/Makefile \
		CodeWar/doc/* CodeWar/lib/* CodeWar/include/*.h \
		CodeWar/fight CodeWar/xfight \
		CodeWar/bin/* ; \
		cd CodeWar/src
archive:	tar
		mcopy -n ../../CodeWar.tgz a: ; \
		mcopy -n ../../CodeWar.tgz a:CodeWar.bak
length:
		cat $(SRCS) $(HEADERS) | wc -l
cleanish:
		-rm $(OUTPUT) $(LIBPATH)$(LIBOUT)*
clean:
		-rm *.o *~ *.flc $(OUTPUT) $(LIBPATH)$(LIBOUT)* ;\
		cd $(dot)$(dot)/progs ; make clean
depend:		$(SRCS) $(HEADERS)
		$(DEPEND) $(INCLUDE) $(SRCS)
