#
#
#

#BIN = ../bin.udp
BIN = .

CC = ncc -eft

# Amdahl UTS2.1 stuff
UTSLIBS = -lsocket -lbsd -la
LIBS = -L../gmp-1.2 -lmp -lm $(UTSLIBS)


R_OBJS =    colors.o \
	    coup.o \
	    data.o \
	    death.o \
	    detonate.o \
	    defaults.o \
	    dmessage.o \
	    enter.o \
	    findslot.o \
	    getname.o \
	    getship.o \
	    inform.o \
	    interface.o \
	    newwin.o \
	    orbit.o \
	    option.o \
	    planetlist.o \
	    planets.o \
	    playerlist.o \
	    ranklist.o \
	    reserved.o \
	    rsa_key.o \
	    sintab.o \
	    smessage.o \
	    spopt.o \
	    socket.o \
	    stats.o \
	    util.o \
	    war.o \
	    warning.o \
	    rsa_util.o \
	    udpopt.o

R_FILES =   colors.c \
	    coup.c \
	    data.c \
	    death.c \
	    detonate.c \
	    defaults.c \
	    dmessage.c \
	    enter.c \
	    findslot.c \
	    getname.c \
	    getship.c \
	    inform.c \
	    input.c \
	    interface.c \
	    newwin.c \
	    orbit.c \
	    option.c \
	    planetlist.c \
	    planets.c \
	    playerlist.c \
	    ranklist.c \
	    redraw.c \
	    reserved.c \
	    rsa_key.c \
	    sintab.c \
	    smessage.c \
	    socket.c \
	    spopt.c \
	    stats.c \
	    util.c \
	    war.c \
	    warning.c \
	    rsa_util.c \
	    udpopt.c

INCLUDES = struct.h \
	    packets.h \
	    defs.h \
	    copyright.h \
	    bitmaps.h \
	    data.h \
	    oldbitmaps.h

INPUT = input.o redraw.o
MAINOBJ = main.o
MAINSRC = main.c
X10LIB = -lX
X10OBJS = x10window.o
X11LIB = -L/usr/lib/X11 -lX11
X11OBJS = x11window.o
GLLIB = -lgl_s
GLOBJS = glwindow.o

#LIBS = -lm -lbsd -lsocket -la

# TSH           -- changes by me
# TC            -- changes by Terence Chang
# SGALAXY       -- changes by Jerry Frain & Joe Young
# ATM           -- changes by Andy McFadden
# RWATCH	-- for robot client only
# TCURSORS      -- cursors for different windows
# GODMESSAGE	-- message to GOD.

CFLAGS = -O -s -I. -DTSH -DPCLIENT -DGALAXY -DATM -DGODMESSAGE -DTCURSORS \
	-DNOWARP -DSHORT_PACKETS -DGATEWAY -DTREKHOPD

all : netrek


x10netrek: $(R_OBJS) $(MAINOBJ) $(INPUT) $(X10OBJS)
	$(CC) -o x10netrek $(R_OBJS) $(INPUT) $(MAINOBJ) $(X10OBJS) $(X10LIB) $(LIBS)

glnetrek: $(R_OBJS) $(MAINOBJ) $(INPUT) $(GLOBJS)
	$(CC) -o glnetrek $(R_OBJS) $(MAINOBJ) $(INPUT) $(GLOBJS) $(GLLIB) $(LIBS)

netrek : $(R_OBJS) $(MAINOBJ) $(INPUT) $(X11OBJS)
	$(CC) -O -s -o netrek $(R_OBJS) $(INPUT) $(MAINOBJ) $(X11OBJS) $(X11LIB) $(LIBS)

clean:
	rm -f $(R_OBJS) $(MAINOBJ) $(INPUT) $(X10OBJS) $(X11OBJS) $(GLOBJS)

tags: $(R_FILES)
	ctags $(R_FILES) $(INCLUDES)

install: netrek
	mv netrek $(BIN)

#####

depend:
	mymkdep -f Makefile -MM $(R_FILES)
# DO NOT DELETE THIS LINE -- mkdep uses it.
# DO NOT PUT ANYTHING AFTER THIS LINE, IT WILL GO AWAY.

colors.o : colors.c copyright2.h Wlib.h defs.h copyright.h struct.h data.h 
coup.o : coup.c copyright.h Wlib.h copyright2.h defs.h struct.h data.h 
data.o : data.c copyright.h Wlib.h copyright2.h defs.h struct.h data.h 
death.o : death.c copyright.h Wlib.h copyright2.h defs.h struct.h data.h 
detonate.o : detonate.c copyright.h Wlib.h copyright2.h defs.h struct.h data.h 
defaults.o : defaults.c copyright2.h Wlib.h defs.h copyright.h struct.h data.h 
dmessage.o : dmessage.c copyright.h Wlib.h copyright2.h defs.h struct.h data.h 
enter.o : enter.c copyright.h Wlib.h copyright2.h defs.h struct.h data.h 
findslot.o : findslot.c copyright2.h Wlib.h defs.h copyright.h struct.h data.h 
getname.o : getname.c copyright2.h Wlib.h defs.h copyright.h struct.h data.h 
getship.o : getship.c copyright.h Wlib.h copyright2.h defs.h struct.h data.h 
inform.o : inform.c copyright.h Wlib.h copyright2.h defs.h struct.h data.h 
input.o : input.c copyright.h Wlib.h copyright2.h defs.h struct.h data.h packets.h 
interface.o : interface.c copyright.h Wlib.h copyright2.h defs.h struct.h data.h \
  packets.h 
newwin.o : newwin.c copyright.h Wlib.h copyright2.h defs.h struct.h data.h bitmaps.h \
  oldbitmaps.h packets.h 
orbit.o : orbit.c copyright.h Wlib.h copyright2.h defs.h struct.h data.h 
option.o : option.c copyright.h Wlib.h copyright2.h defs.h struct.h data.h packets.h 
planetlist.o : planetlist.c copyright.h Wlib.h copyright2.h defs.h struct.h \
  data.h 
planets.o : planets.c copyright2.h Wlib.h defs.h copyright.h struct.h data.h 
playerlist.o : playerlist.c copyright.h Wlib.h copyright2.h defs.h struct.h \
  data.h 
ranklist.o : ranklist.c copyright2.h Wlib.h defs.h copyright.h struct.h data.h 
redraw.o : redraw.c copyright.h Wlib.h copyright2.h defs.h struct.h data.h packets.h 
reserved.o : reserved.c copyright2.h packets.h 
sintab.o : sintab.c copyright.h 
smessage.o : smessage.c copyright.h Wlib.h copyright2.h defs.h struct.h data.h 
socket.o : socket.c copyright2.h Wlib.h defs.h copyright.h struct.h data.h packets.h 
spopt.o : spopt.c 
stats.o : stats.c copyright.h Wlib.h copyright2.h defs.h struct.h data.h 
util.o : util.c copyright.h Wlib.h copyright2.h defs.h struct.h data.h 
war.o : war.c copyright.h Wlib.h copyright2.h defs.h struct.h data.h packets.h 
warning.o : warning.c copyright.h Wlib.h copyright2.h defs.h struct.h data.h 
udpopt.o : udpopt.c copyright.h Wlib.h copyright2.h defs.h struct.h data.h 

# IF YOU PUT ANYTHING HERE IT WILL GO AWAY
