# $Id: Makefile.std,v 3.74 1998/01/27 11:38:22 bert Exp $
#
# XPilot, a multiplayer gravity war game.  Copyright (C) 1993-95 by
#
#      Bj�rn Stabell        <bjoern@xpilot.org>
#      Ken Ronny Schouten   <ken@xpilot.org>
#      Bert Gijsbers        <bert@xpilot.org>
#      Dick Balaska         <dick@xpilot.org>
#
# 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.

#
# Set the version number here so that we can we use it when installing
# the binaries in the destination directory.
#
VERSION=3.7.0

# Change these for your site
INSTALLDIR=/usr/local/games
LIBDIR=$(INSTALLDIR)/lib/xpilot
SOUNDDIR=/usr/local/lib/sounds
LOCALGURU=xpilot@xpilot.org
MANDIR=/usr/local/man/man6

#
# Generic flags.  Probably won't work.  Use one of the specifics below.
#
CC = gcc
CFLAGS = $(DEFS) $(INCS) -O -I/usr/local/X11/include
MLIB = -lm
XLIB = -L/usr/local/X11/lib -lX11

#
# Flags for Apollo's running Domain/OS 10.4 and using Apollo's C compiler 6.9.
# Note that you MUST specify `-W0,-natural' to the Apollo C compiler.
# Boy, how that cost me a LOT of trouble to discover (Bert Gijsbers).
# Apollo's don't need any of the normal system libraries as they are shared :)
#
APOLLO_CC = cc
APOLLO_CFLAGS = $(DEFS) $(INCS) -D_APOLLO_SOURCE -D_MATH_BUILTINS -W0,-natural -A cpu,mathlib
APOLLO_OPT = -O
APOLLO_DEBUG = -g
APOLLO_MLIB =
APOLLO_XLIB =

#
# Flags for the HP Precision Architecture using the native HP compiler.
#
HPPA_CC = cc
HPPA_CPLUS = g++
HPPA_CFLAGS = $(DEFS) $(INCS) -Aa -D_HPUX_SOURCE +w2 -z +FPD -I/usr/include/X11R5
HPPA_OPT = +O3 # +Oaggressive +Olimit +Olibcalls +Oregionsched +Onofltacc
HPPA_DEBUG = -g
HPPA_PROF = -G
HPPA_PLUS = $(DEFS) $(INCS) -x c++ -O2 -g -I/usr/include/X11R5
HPPA_LPLUS = $(DEFS) $(INCS) -O2 -g
HPPA_XLIB = -L/usr/lib/X11R5 -lX11
HPPA_MLIB = -lM

#
# Flags for Sun with GCC.
#
# For Solaris 2.1 the following flags were used instead:
#   SUN_CFLAGS = $(DEFS) $(INCS) -DSVR4 -I/usr/openwin/include
#   SUN_MLIB = -lm -lsocket -lnsl -lkrb
#

SUN_CC = gcc
SUN_CFLAGS = $(DEFS) $(INCS)
SUN_OPT = -O
SUN_DEBUG = -g
SUN_MLIB = -lm
SUN_XLIB = -lX11

#
# Flags for Sun CMW with GCC.
#
SUNCMW_CC = gcc
SUNCMW_CFLAGS = $(DEFS) -DSUNCMW $(INCS) -I/usr/openwin/include -I/apps/include
SUNCMW_OPT = -O2
SUNCMW_DEBUG = -g
SUNCMW_MLIB = -lm -lcmw
SUNCMW_XLIB = -L/usr/openwin/lib -lX11

SOLARIS_CC = gcc
#SOLARIS_CFLAGS = $(DEFS) $(INCS)
SOLARIS_CFLAGS = $(DEFS) $(INCS) -I/usr/openwin/include
SOLARIS_OPT = -O
SOLARIS_DEBUG = -g
SOLARIS_MLIB = -lm -lsocket -lnsl -lc /usr/ucblib/libucb.a
SOLARIS_XLIB = -L/usr/openwin/lib -lX11

#
# Flags to use with SGI boxes.
# 
SGI_CC = cc
SGI_CFLAGS = $(DEFS) $(INCS) -xansi
SGI_OPT = -O2
SGI_PROF = 
SGI_XLIB = -lX11
SGI_MLIB = -lm -lsun

#
# Flags for AIX on a 3090 Mainframe
#
AIX_CC = cc
AIX_CFLAGS = -DAIX $(DEFS) $(INCS)
AIX_OPT = -O -w
AIX_DEBUG = -g
AIX_MLIB = -lm
AIX_XLIB = -lX11

#
# Flags for Linux on a 486.
# Linux versions up to 0.99pl9 should define LINUX0 when compiling
# as there are some network deficiences which are reportedly solved
# in 0.99pl10.  Defining LINUX0 makes it impossible for a Linux client
# to join a non-LINUX0 server due to different (smaller) packet sizes.
# Flags for compiling by GNU C++ are provided also.
#
LINUX_CC = gcc
LINUX_CPLUSPLUS = g++
LINUX_CFLAGS = $(DEFS) $(INCS) -m486 -Wall -fstrict-prototype
LINUX_OPT = -O2
LINUX_DEBUG = -g -O2
LINUX_PROF = -pg -O2
LINUX_CHECKER = -checker
LINUX_PLUS = -g -O2 -x c++
LINUX_MLIB = -lm
LINUX_XLIB = -lX11
LINUX_LPLUS = $(LINUX_CFLAGS)

#
# Flags for Sony NEWS.
# 
SONYNEWS_CC = gcc
SONYNEWS_CFLAGS = $(DEFS) -D_SONYNEWS_SOURCE
SONYNEWS_OPT = -O
SONYNEWS_DEBUG = -g
SONYNEWS_MLIB = -lm
SONYNEWS_XLIB = -lX11

#
# Flags for DEC Ultrix 4.2
#
ULTRIX_CC = gcc
ULTRIX_CFLAGS = $(DEFS) $(INCS) -I/usr/include/mit
ULTRIX_OPT = -O
ULTRIX_DEBUG = -g
ULTRIX_MLIB = -lm
ULTRIX_XLIB = -lX11-mit


#
# DEFS should be used for program specific defines.
# Currently supported flags are:
#
#  LIMIT_ACCESS    - extremely local, cannot be used without modification.
#  LOG             - try to log every server start
#  TURN_THRUST     - makes turning drain fuel and gives you a nice spark...
#  SILENT          - makes the server real silent.
#  SOUND           - for sound support (requires rplay 3.0 or NCDaudio)
#  SERVER_SOUND    - for sound support in the server only, not in the client.
#  ERASE=1         - use a different, possible faster, frame
#                    drawing technique which is not perfect yet.
#                    It needs more work by a volunteer.
#  SPARC_CMAP_HACK - try the alternate colormap swapping code
#                    that talks directly to the sparc hardware.
#                    Only makes sense together with -DERASE=1.
#                    WARNING: WILL NOT WORK ON ANY OTHER HARDWARE
#                    CAUTION: dangerous if you don't know
#                    what it does and how it works.
#                    It needs more work by a volunteer.
#  JOYSTICK        - joystick support for Linux 1.0, needs joystick-0.7.
#  PLOCKSERVER     - Use the plock(2) system call to lock the xpilots
#                    server into memory, i.e. to inhibit paging/swapping.
#                    This probably only makes sense in conjunction with
#                    raising the priority of the server a little, which is
#                    equivalent to reducing the nice value a few points.
#                    Note that both require special system privileges.
#                    Sofar this feature has only been tested on HP-UX.
#  DBE             - To enable support for the X doublebuffer extension.
#                    This needs an extra -lXext somewhere.
#  MBX             - To enable support for the X multibuffer extension.
#                    This needs an extra -lXext somewhere.
#
# You should also set these appropriately (see config.h):
#
#  LOCALGURU           - define to the person in charge of xpilot on this site.
#  LIBDIR              - define to where you want the help-files etc.
#                        (HELPFILE, MOTDFILE, LOGFILE, MAPDIR and TEXTUREDIR)
#  UPDATES_PR_FRAME=1  - number of 'ticks' per drawing (1 is default).
#
DEFS = -DLOCALGURU=\\\"$(LOCALGURU)\\\" -DLIBDIR=\\\"$(LIBDIR)\\\"

INCS = $(AUDIOINC)

#
# For NCDaudio support, uncomment the following lines in addition to adding
# -DSOUND to the DEFS line above
#
#AUDIOINC = -I/usr/local/include
#AUDIOLIB = -L/usr/local/lib -laudio
#AUDIOSRC = ncdaudio.c
#AUDIOOBJ = ncdaudio.o

#
# For rplay support, uncomment the following lines in addition to adding
# -DSOUND to the DEFS line above
#
#AUDIOINC = -I/usr/local/include
#AUDIOLIB = -L/usr/local/lib -lrplay
#AUDIOSRC = rplayaudio.c
#AUDIOOBJ = rplayaudio.o

#
# For HP audio support, uncomment the following lines in addition to adding
# -DSOUND to the DEFS line above.
# NOTE that this doesn't really work well.  Dunno why.  Blame Alib & Aserver.
#
#AUDIOINC = 
#AUDIOLIB = -lAlib
#AUDIOSRC = hpaudio.c
#AUDIOOBJ = hpaudio.o

#
# Uncomment this line if you don't have strcasecmp() (case insensitive compare)
#
#STRCASECMP_OBJ = strcasecmp.o

#
# Uncomment this line if your system doesn't have strdup().
# Ultrix, AIX and Sequent need it.
#
#STRDUP_OBJ = strdup.o

#
# Uncomment this line if your system is Trusted Solaris CMW 1.0
# You also need to #define SUNCMW
#
#SUNCMW_OBJ = cmw.o

#
# Server program, xpilots...
#
OBJS1 = server.o metaserver.o netserver.o contact.o event.o map.o math.o cmdline.o \
	net.o play.o player.o rules.o update.o collision.o walls.o objpos.o error.o \
        id.o frame.o portability.o robot.o robotdef.o option.o socklib.o sched.o saudio.o \
        $(STRCASECMP_OBJ) $(STRDUP_OBJ)
SRCS1 = server.c metaserver.c netserver.c contact.c event.c map.c math.c cmdline.c \
	net.c play.c portability.c player.c rules.c update.c collision.c walls.c objpos.c error.c \
        id.c frame.c robot.c robotdef.c option.c socklib.c sched.c saudio.c

#
# Client program, xpilot...
#
OBJS2 = \
	xpilot.o client.o join.o net.o netclient.o \
	xinit.o colors.o dbuff.o default.o xevent.o \
	paint.o paintdata.o painthud.o paintmap.o \
	paintobjects.o paintradar.o portability.o \
	record.o talk.o about.o configure.o widget.o \
	math.o syslimit.o error.o socklib.o query.o \
	caudio.o usleep.o texture.o xpmread.o \
	$(AUDIOOBJ) $(STRDUP_OBJ)
SRCS2 = \
	xpilot.c client.c join.c net.c netclient.c \
	xinit.c colors.c dbuff.c default.c xevent.c \
	paint.c paintdata.c painthud.c paintmap.c \
	paintobjects.c paintradar.c portability.c \
	record.c talk.c about.c configure.c widget.c \
	math.c syslimit.c error.c socklib.c query.c \
	caudio.c usleep.c texture.c xpmread.c \
	$(AUDIOSRC)

#
# Playback program, xp-replay...
#
OBJS3 = xp-replay.o buttons.o
SRCS3 = xp-replay.c buttons.c

#
# If you have two CPUs available for compilation then
# you can startup two makes in parallel, one for
# the server and one for the client, by issueing
# on the first CPU:
#    make architecture TARGETS=xpilots
# and on the second CPU:
#    make architecture TARGETS=xpilot
# By default both are made on the same CPU.
#
TARGETS= xpilot xpilots xp-replay

all:
	@echo "Please specify your system.  Choose one of:"
	@echo "    apollo/hppa/solaris/sun/suncmw/aix/linux/sonynews/sgi/ultrix"

targets: $(TARGETS)

apollo:
	@$(MAKE) $(TARGETS) "CC=$(APOLLO_CC)" "CFLAGS=$(APOLLO_CFLAGS) $(APOLLO_OPT)" "MLIB=$(APOLLO_MLIB)" "XLIB=$(APOLLO_XLIB)"

apollo-debug:
	@$(MAKE) $(TARGETS) "CC=$(APOLLO_CC)" "CFLAGS=$(APOLLO_CFLAGS) $(APOLLO_DEBUG)" "MLIB=$(APOLLO_MLIB)" "XLIB=$(APOLLO_XLIB)"

hppa:
	@$(MAKE) $(TARGETS) "CC=$(HPPA_CC)" "CFLAGS=$(HPPA_CFLAGS) $(HPPA_OPT)" "MLIB=$(HPPA_MLIB)" "XLIB=$(HPPA_XLIB)"

hppa-gcc:
	@$(MAKE) $(TARGETS) "CC=gcc" "CFLAGS=-D_HPUX_SOURCE -I/usr/include/X11R5 -O2 $(DEFS) $(INCS)" "MLIB=$(HPPA_MLIB)" "XLIB=$(HPPA_XLIB)"

hppa-gcc-debug:
	@$(MAKE) $(TARGETS) "CC=gcc" "CFLAGS=-D_HPUX_SOURCE -I/usr/include/X11R5 -O2 -g $(DEFS) $(INCS)" "MLIB=$(HPPA_MLIB)" "XLIB=$(HPPA_XLIB)"

hppa-debug:
	@$(MAKE) $(TARGETS) "CC=$(HPPA_CC)" "CFLAGS=$(HPPA_DEBUG) $(HPPA_CFLAGS)" "MLIB=$(HPPA_MLIB)" "XLIB=$(HPPA_XLIB)"

hppa-prof:
	@$(MAKE) $(TARGETS) "CC=$(HPPA_CC)" "CFLAGS=$(HPPA_CFLAGS) $(HPPA_OPT) $(HPPA_PROF)" "MLIB=$(HPPA_MLIB)" "XLIB=$(HPPA_XLIB)"

hppa-plus:
	@$(MAKE) $(TARGETS) "CC=$(HPPA_CPLUS)" "CFLAGS=$(HPPA_PLUS)" "LFLAGS=$(HPPA_LPLUS)" "MLIB=$(HPPA_MLIB)" "XLIB=$(HPPA_XLIB)"

hppa-CC:
	@$(MAKE) $(TARGETS) "CC=CC" "CFLAGS=+a1 +O3 -I/usr/include/X11R5 $(DEFS)" "LFLAGS=+a1 +O3" "MLIB=$(HPPA_MLIB)" "XLIB=$(HPPA_XLIB)"

sun:
	@$(MAKE) $(TARGETS) "CC=$(SUN_CC)" "CFLAGS=$(SUN_CFLAGS) $(SUN_OPT)" "MLIB=$(SUN_MLIB)" "XLIB=$(SUN_XLIB)"

sun-debug:
	@$(MAKE) $(TARGETS) "CC=$(SUN_CC)" "CFLAGS=$(SUN_CFLAGS) $(SUN_DEBUG)" "MLIB=$(SUN_MLIB)" "XLIB=$(SUN_XLIB)"

solaris:
	@$(MAKE) $(TARGETS) "CC=$(SOLARIS_CC)" "CFLAGS=$(SOLARIS_CFLAGS) $(SOLARIS_OPT)" "MLIB=$(SOLARIS_MLIB)" "XLIB=$(SOLARIS_XLIB)"

solaris-debug:
	@$(MAKE) $(TARGETS) "CC=$(SOLARIS_CC)" "CFLAGS=$(SOLARIS_CFLAGS) $(SOLARIS_DEBUG)" "MLIB=$(SOLARIS_MLIB)" "XLIB=$(SOLARIS_XLIB)"

suncmw:
	@$(MAKE) $(TARGETS) "CC=$(SUNCMW_CC)" "CFLAGS=$(SUNCMW_CFLAGS) $(SUNCMW_OPT)" "MLIB=$(SUNCMW_MLIB)" "XLIB=$(SUNCMW_XLIB)"

suncmw-debug:
	@$(MAKE) $(TARGETS) "CC=$(SUNCMW_CC)" "CFLAGS=$(SUNCMW_CFLAGS) $(SUNCMW_DEBUG)" "MLIB=$(SUNCMW_MLIB)" "XLIB=$(SUNCMW_XLIB)"

aix:
	@$(MAKE) $(TARGETS) "CC=$(AIX_CC)" "CFLAGS=$(AIX_CFLAGS) $(AIX_OPT)" "MLIB=$(AIX_MLIB)" "XLIB=$(AIX_XLIB)"

linux:
	@$(MAKE) $(TARGETS) "CC=$(LINUX_CC)" "CFLAGS=$(LINUX_CFLAGS) $(LINUX_OPT)" "MLIB=$(LINUX_MLIB)" "XLIB=$(LINUX_XLIB)"

linux-debug:
	@$(MAKE) $(TARGETS) "CC=$(LINUX_CC)" "CFLAGS=$(LINUX_CFLAGS) $(LINUX_DEBUG)" "MLIB=$(LINUX_MLIB)" "XLIB=$(LINUX_XLIB)"

linux-prof:
	@$(MAKE) $(TARGETS) "CC=$(LINUX_CC)" "CFLAGS=$(LINUX_CFLAGS) $(LINUX_PROF)" "MLIB=$(LINUX_MLIB)" "XLIB=$(LINUX_XLIB)"

linux-bprof: linux-debug
	rm -f xpilot xpilots
	@$(MAKE) $(TARGETS) "CC=$(LINUX_CC)" "CFLAGS=$(LINUX_CFLAGS) $(LINUX_PROF)" "BMON=-lbmon" "MLIB=$(LINUX_MLIB)" "XLIB=$(LINUX_XLIB)"

linux-checker:
	@$(MAKE) $(TARGETS) "CC=$(LINUX_CC)" "CFLAGS=$(LINUX_CFLAGS) $(LINUX_CHECKER)" "MLIB=$(LINUX_MLIB)" "XLIB=$(LINUX_XLIB)"

linux-plus:
	@$(MAKE) $(TARGETS) "CC=$(LINUX_CPLUSPLUS)" "CFLAGS=$(LINUX_CFLAGS) $(LINUX_PLUS)" "LFLAGS=$(LINUX_LPLUS)" "MLIB=$(LINUX_MLIB)" "XLIB=$(LINUX_XLIB)"

sonynews:
	@$(MAKE) $(TARGETS) "CC=$(SONYNEWS_CC)" "CFLAGS=$(SONYNEWS_CFLAGS) $(SONYNEWS_OPT)" "MLIB=$(SONYNEWS_MLIB)" "XLIB=$(SONYNEWS_XLIB)"

sonynews-debug:
	@$(MAKE) $(TARGETS) "CC=$(SONYNEWS_CC)" "CFLAGS=$(SONYNEWS_CFLAGS) $(SONYNEWS_DEBUG)" "MLIB=$(SONYNEWS_MLIB)" "XLIB=$(SONYNEWS_XLIB)"

sgi:
	@$(MAKE) $(TARGETS) "CC=$(SGI_CC)" "CFLAGS=$(SGI_CFLAGS) $(SGI_OPT)" "MLIB=$(SGI_MLIB)" "XLIB=$(SGI_XLIB)"

sgi-debug:
	@$(MAKE) $(TARGETS) "CC=$(SGI_CC)" "CFLAGS=$(SGI_CFLAGS) $(SGI_DEBUG)" "MLIB=$(SGI_MLIB)" "XLIB=$(SGI_XLIB)"

ultrix:
	@$(MAKE) $(TARGETS) "CC=$(ULTRIX_CC)" "CFLAGS=$(ULTRIX_CFLAGS) $(ULTRIX_OPT)" "MLIB=$(ULTRIX_MLIB)" "XLIB=$(ULTRIX_XLIB)"

ultrix-debug:
	@$(MAKE) $(TARGETS) "CC=$(ULTRIX_CC)" "CFLAGS=$(ULTRIX_CFLAGS) $(ULTRIX_DEBUG)" "MLIB=$(ULTRIX_MLIB)" "XLIB=$(ULTRIX_XLIB)"

#
# If LFLAGS is specified on the command line then
# that will override the following default.
# CFLAGS will be defined by the command line arguments
# of the recursive make.
#
LFLAGS=$(CFLAGS)

client: xpilot
server: xpilots

xpilots: $(OBJS1)
	rm -f xpilots
	$(CC) $(LFLAGS) -o $@ $(OBJS1) $(MLIB)

xpilot: $(OBJS2)
	rm -f xpilot
	$(CC) $(LFLAGS) -o $@ $(OBJS2) $(AUDIOLIB) $(XLIB) $(MLIB)

xp-replay: $(OBJS3)
	rm -f xp-replay
	$(CC) $(LFLAGS) -o $@ $(OBJS3) $(XLIB) $(MLIB)

install:
	@echo "Specify either install-apollo, install-hppa or install-sun or install-sonynews or install-suncmw"

install-binaries:
	if [ ! -d $(INSTALLDIR)/. ]; then mkdir -p $(INSTALLDIR); fi
	cp xpilot xpilots xp-replay $(INSTALLDIR)
	-strip $(INSTALLDIR)/xpilot $(INSTALLDIR)/xpilots $(INSTALLDIR)/xp-replay
	-chmod +x $(INSTALLDIR)/xpilot $(INSTALLDIR)/xpilots $(INSTALLDIR)/xp-replay

install-libdir:
	if [ ! -d $(LIBDIR)/. ]; then mkdir -p $(LIBDIR); fi
	/bin/rm -f $(LIBDIR)/maps
	cp -r ../lib/defaults ../lib/sounds ../lib/maps ../lib/textures $(LIBDIR)
	chmod -R a+r $(LIBDIR)/. $(SOUNDDIR)/.

install-man:
	if [ ! -d $(MANDIR)/. ]; then mkdir -p $(MANDIR); fi
	for f in xpilot xpilots xp-replay; \
	do \
		if [ -f ../doc/man/$$f.man ]; then \
			cp ../doc/man/$$f.man $(MANDIR)/$$f.6; \
		fi; \
	done

install-apollo: apollo install-binaries install-libdir

install-hppa: hppa install-binaries install-libdir

install-sun: sun install-binaries install-libdir

install-solaris: solaris install-binaries install-libdir

install-suncmw: sun
	cp xpilot $(INSTALLDIR)/xpilot-$(VERSION).suncmw
	cp xpilots $(INSTALLDIR)/xpilots-$(VERSION).suncmw
	chpriv a=all $(INSTALLDIR)/xpilot-$(VERSION).suncmw
	chpriv f=file_dac_read      $(INSTALLDIR)/xpilot-$(VERSION).suncmw
	chpriv f+file_dac_write     $(INSTALLDIR)/xpilot-$(VERSION).suncmw
	chpriv f+file_downgrade_il  $(INSTALLDIR)/xpilot-$(VERSION).suncmw
	chpriv f+file_mac_read      $(INSTALLDIR)/xpilot-$(VERSION).suncmw
	chpriv f+file_mac_write     $(INSTALLDIR)/xpilot-$(VERSION).suncmw
	chpriv f+file_upgrade_il    $(INSTALLDIR)/xpilot-$(VERSION).suncmw
	chpriv f+net_allowaccess    $(INSTALLDIR)/xpilot-$(VERSION).suncmw
	chpriv f+net_boot           $(INSTALLDIR)/xpilot-$(VERSION).suncmw
	chpriv f+net_broadcast      $(INSTALLDIR)/xpilot-$(VERSION).suncmw
	chpriv f+net_mac_override   $(INSTALLDIR)/xpilot-$(VERSION).suncmw
	chpriv f+win_admin          $(INSTALLDIR)/xpilot-$(VERSION).suncmw
	chpriv a=all $(INSTALLDIR)/xpilots-$(VERSION).suncmw
	chpriv f=file_dac_read      $(INSTALLDIR)/xpilots-$(VERSION).suncmw
	chpriv f+file_dac_write     $(INSTALLDIR)/xpilots-$(VERSION).suncmw
	chpriv f+file_downgrade_il  $(INSTALLDIR)/xpilots-$(VERSION).suncmw
	chpriv f+file_mac_read      $(INSTALLDIR)/xpilots-$(VERSION).suncmw
	chpriv f+file_mac_write     $(INSTALLDIR)/xpilots-$(VERSION).suncmw
	chpriv f+file_upgrade_il    $(INSTALLDIR)/xpilots-$(VERSION).suncmw
	chpriv f+net_allowaccess    $(INSTALLDIR)/xpilots-$(VERSION).suncmw
	chpriv f+net_boot           $(INSTALLDIR)/xpilots-$(VERSION).suncmw
	chpriv f+net_broadcast      $(INSTALLDIR)/xpilots-$(VERSION).suncmw
	chpriv f+net_mac_override   $(INSTALLDIR)/xpilots-$(VERSION).suncmw

install-sonynews: sonynews install-binaries install-libdir

install-sgi: sgi install-binaries install-libdir

install-ultrix: ultrix install-binaries install-libdir

install-apollo-debug: apollo-debug install-apollo

install-hppa-debug: hppa-debug install-hppa

install-sun-debug: sun-debug install-sun

install-sonynews-debug: sonynews-debug install-sonynews

install-sgi-debug: sgi-debug install-sgi

install-ultrix-debug: ultrix-debug install-ultrix

#
# strcasecmp.o and strdup.o declared here in case they are
# commented out for another platform
#

clean:
	rm -f $(OBJS1) $(OBJS2) strcasecmp.o strdup.o xpilot xpilots \
		xp-replay $(OBJS3) core

ctags:
	ctags *.h *.c

###
server.o: server.c version.h config.h types.h const.h global.h \
 object.h keys.h bit.h draw.h item.h click.h map.h rules.h proto.h \
 socklib.h sched.h netserver.h error.h portability.h
metaserver.o: metaserver.c config.h version.h const.h types.h global.h \
 object.h keys.h bit.h draw.h item.h click.h map.h rules.h proto.h \
 socklib.h pack.h metaserver.h saudio.h error.h netserver.h
netserver.o: netserver.c types.h version.h config.h const.h global.h \
 object.h keys.h bit.h draw.h item.h click.h map.h rules.h proto.h \
 pack.h socklib.h sched.h net.h error.h netserver.h packet.h setup.h \
 saudio.h
contact.o: contact.c version.h config.h types.h const.h global.h \
 object.h keys.h bit.h draw.h item.h click.h map.h rules.h proto.h \
 socklib.h pack.h net.h netserver.h sched.h error.h
event.o: event.c version.h config.h const.h types.h global.h object.h \
 keys.h bit.h draw.h item.h click.h map.h rules.h proto.h score.h \
 saudio.h netserver.h
map.o: map.c version.h config.h const.h types.h global.h object.h \
 keys.h bit.h draw.h item.h click.h map.h rules.h proto.h error.h
math.o: math.c version.h config.h const.h types.h draw.h error.h
cmdline.o: cmdline.c version.h config.h const.h types.h global.h \
 object.h keys.h bit.h draw.h item.h click.h map.h rules.h proto.h \
 defaults.h error.h
net.o: net.c version.h config.h const.h types.h error.h net.h packet.h \
 bit.h socklib.h
play.o: play.c version.h config.h const.h types.h global.h object.h \
 keys.h bit.h draw.h item.h click.h map.h rules.h proto.h score.h \
 saudio.h netserver.h error.h objpos.h
player.o: player.c version.h config.h const.h types.h global.h \
 object.h keys.h bit.h draw.h item.h click.h map.h rules.h proto.h \
 score.h netserver.h saudio.h error.h objpos.h
rules.o: rules.c version.h config.h const.h types.h global.h object.h \
 keys.h bit.h draw.h item.h click.h map.h rules.h proto.h
update.o: update.c version.h config.h const.h types.h global.h \
 object.h keys.h bit.h draw.h item.h click.h map.h rules.h proto.h \
 score.h saudio.h objpos.h
collision.o: collision.c version.h config.h const.h types.h global.h \
 object.h keys.h bit.h draw.h item.h click.h map.h rules.h proto.h \
 score.h saudio.h netserver.h pack.h error.h objpos.h
walls.o: walls.c version.h config.h const.h types.h global.h object.h \
 keys.h bit.h draw.h item.h click.h map.h rules.h proto.h score.h \
 saudio.h netserver.h pack.h error.h walls.h objpos.h
objpos.o: objpos.c version.h config.h const.h types.h global.h \
 object.h keys.h bit.h draw.h item.h click.h map.h rules.h proto.h \
 objpos.h
error.o: error.c version.h config.h const.h types.h error.h
id.o: id.c version.h const.h types.h global.h object.h keys.h bit.h \
 draw.h item.h click.h map.h rules.h proto.h error.h
frame.o: frame.c version.h config.h const.h types.h global.h object.h \
 keys.h bit.h draw.h item.h click.h map.h rules.h proto.h netserver.h \
 saudio.h error.h
portability.o: portability.c version.h config.h portability.h
robot.o: robot.c version.h config.h const.h types.h global.h object.h \
 keys.h bit.h draw.h item.h click.h map.h rules.h proto.h score.h \
 saudio.h netserver.h pack.h robot.h error.h
robotdef.o: robotdef.c version.h config.h const.h types.h global.h \
 object.h keys.h bit.h draw.h item.h click.h map.h rules.h proto.h \
 score.h saudio.h netserver.h pack.h robot.h error.h
option.o: option.c types.h version.h config.h const.h global.h \
 object.h keys.h bit.h draw.h item.h click.h map.h rules.h proto.h \
 defaults.h error.h
socklib.o: socklib.c version.h socklib.h
sched.o: sched.c version.h config.h const.h types.h error.h sched.h \
 global.h object.h keys.h bit.h draw.h item.h click.h map.h rules.h \
 portability.h
saudio.o: saudio.c version.h config.h const.h types.h global.h \
 object.h keys.h bit.h draw.h item.h click.h map.h rules.h proto.h \
 netserver.h saudio.h
xpilot.o: xpilot.c version.h config.h const.h types.h pack.h bit.h \
 error.h socklib.h net.h protoclient.h portability.h
client.o: client.c version.h config.h const.h types.h setup.h error.h \
 rules.h bit.h netclient.h paint.h client.h draw.h item.h xinit.h \
 protoclient.h
join.o: join.c types.h version.h config.h const.h error.h client.h \
 draw.h item.h netclient.h protoclient.h
net.o: net.c version.h config.h const.h types.h error.h net.h packet.h \
 bit.h socklib.h
netclient.o: netclient.c types.h version.h config.h const.h error.h \
 net.h netclient.h setup.h packet.h bit.h paint.h client.h draw.h \
 item.h xinit.h pack.h socklib.h protoclient.h
xinit.o: xinit.c version.h config.h const.h types.h keys.h icon.h \
 paint.h client.h draw.h item.h xinit.h widget.h configure.h error.h \
 netclient.h dbuff.h protoclient.h items/itemRocketPack.xbm \
 items/itemCloakingDevice.xbm items/itemEnergyPack.xbm \
 items/itemWideangleShot.xbm items/itemRearShot.xbm \
 items/itemMinePack.xbm items/itemSensorPack.xbm items/itemTank.xbm \
 items/itemEcm.xbm items/itemAfterburner.xbm items/itemTransporter.xbm \
 items/itemLaser.xbm items/itemEmergencyThrust.xbm \
 items/itemTractorBeam.xbm items/itemAutopilot.xbm \
 items/itemEmergencyShield.xbm
colors.o: colors.c version.h config.h const.h types.h paint.h client.h \
 draw.h item.h xinit.h error.h dbuff.h protoclient.h
dbuff.o: dbuff.c version.h config.h const.h types.h draw.h bit.h \
 dbuff.h
default.o: default.c types.h version.h config.h const.h paint.h \
 client.h draw.h item.h pack.h bit.h keys.h netclient.h xinit.h \
 error.h protoclient.h audio.h
xevent.o: xevent.c version.h config.h const.h types.h paint.h client.h \
 draw.h item.h xinit.h keys.h packet.h bit.h setup.h netclient.h \
 widget.h error.h record.h
paint.o: paint.c version.h config.h const.h types.h error.h bit.h \
 keys.h rules.h setup.h dbuff.h texture.h paint.h client.h draw.h \
 item.h paintdata.h record.h xinit.h
paintdata.o: paintdata.c version.h config.h const.h types.h error.h \
 bit.h client.h draw.h item.h setup.h rules.h paint.h paintdata.h \
 record.h xinit.h protoclient.h
painthud.o: painthud.c version.h config.h const.h types.h error.h \
 bit.h keys.h rules.h setup.h texture.h paint.h client.h draw.h item.h \
 paintdata.h record.h xinit.h protoclient.h
paintmap.o: paintmap.c version.h config.h const.h types.h error.h \
 bit.h keys.h rules.h setup.h texture.h paint.h client.h draw.h item.h \
 paintdata.h record.h xinit.h protoclient.h
paintobjects.o: paintobjects.c version.h config.h const.h types.h \
 error.h bit.h keys.h rules.h setup.h texture.h paint.h client.h \
 draw.h item.h paintdata.h record.h xinit.h protoclient.h
paintradar.o: paintradar.c version.h config.h const.h types.h error.h \
 bit.h keys.h rules.h setup.h paint.h client.h draw.h item.h \
 paintdata.h xinit.h
portability.o: portability.c version.h config.h portability.h
record.o: record.c version.h config.h error.h const.h types.h client.h \
 draw.h item.h paint.h setup.h record.h recordfmt.h xpmread.h
talk.o: talk.c version.h config.h const.h types.h paint.h client.h \
 draw.h item.h xinit.h error.h netclient.h protoclient.h
about.o: about.c version.h config.h const.h types.h keys.h paint.h \
 client.h draw.h item.h xinit.h widget.h configure.h error.h \
 netclient.h dbuff.h protoclient.h
configure.o: configure.c version.h config.h const.h types.h paint.h \
 client.h draw.h item.h xinit.h bit.h keys.h netclient.h widget.h \
 configure.h setup.h error.h protoclient.h
widget.o: widget.c version.h config.h const.h types.h paint.h client.h \
 draw.h item.h paintdata.h xinit.h bit.h error.h widget.h \
 protoclient.h
math.o: math.c version.h config.h const.h types.h draw.h error.h
syslimit.o: syslimit.c
error.o: error.c version.h config.h const.h types.h error.h
socklib.o: socklib.c version.h socklib.h
query.o: query.c version.h config.h error.h socklib.h protoclient.h
caudio.o: caudio.c version.h
usleep.o: usleep.c types.h
texture.o: texture.c version.h config.h const.h types.h paint.h \
 client.h draw.h item.h xinit.h error.h xpmread.h texture.h \
 ../lib/textures/rock4.xpm ../lib/textures/ball.xpm
xpmread.o: xpmread.c version.h config.h const.h types.h paint.h \
 client.h draw.h item.h xinit.h error.h xpmread.h
xp-replay.o: xp-replay.c recordfmt.h item.h buttons.h xp-replay.h \
 items/itemRocketPack.xbm items/itemCloakingDevice.xbm \
 items/itemEnergyPack.xbm items/itemWideangleShot.xbm \
 items/itemRearShot.xbm items/itemMinePack.xbm \
 items/itemSensorPack.xbm items/itemTank.xbm items/itemEcm.xbm \
 items/itemAfterburner.xbm items/itemTransporter.xbm \
 items/itemLaser.xbm items/itemEmergencyThrust.xbm \
 items/itemTractorBeam.xbm items/itemAutopilot.xbm \
 items/itemEmergencyShield.xbm tools/eject.xbm tools/fastf.xbm \
 tools/pause.xbm tools/play.xbm tools/record.xbm tools/revplay.xbm \
 tools/rewind.xbm tools/stop.xbm
buttons.o: buttons.c buttons.h xp-replay.h tools/grey.xbm
