# Makefile generated by imake - do not edit!
# $XConsortium: imake.c,v 1.37 88/10/08 20:08:30 jim Exp $
#
# The cpp used on this machine replaces all newlines and multiple tabs and
# spaces in a macro expansion with a single space.  Imake tries to compensate
# for this, but is not always successful.
#

###########################################################################
# X Window System Makefile generated from template file Imake.tmpl
# $XConsortium: Imake.tmpl,v 1.91 88/10/23 22:37:10 jim Exp $
#
# Do not change the body of the imake template file.  Server-specific
# parameters may be set in the appropriate .macros file; site-specific
# parameters (but shared by all servers) may be set in site.def.  If you
# make any changes, you'll need to rebuild the makefiles using
# "make World" (at best) or "make Makefile; make Makefiles" (at least) in
# the top level directory.
#
# If your C preprocessor doesn't define any unique symbols, you'll need
# to set BOOTSTRAPCFLAGS when rebuilding imake (usually when doing
# "make Makefile", "make Makefiles", or "make World").
#
# If you absolutely can't get imake to work, you'll need to set the
# variables at the top of each Makefile as well as the dependencies at the
# bottom (makedepend will do this automatically).
#

###########################################################################
# platform-specific configuration parameters - edit Sun.macros to change

# platform:  $XConsortium: Sun.macros,v 1.52 88/10/23 11:00:55 jim Exp $
# operating system:  SunOS 4.0

BOOTSTRAPCFLAGS =
             AS = as
             CC = gcc -traditional -m68881 -fwritable-strings -fpcc-struct-return -finline-functions -fstrength-reduce -fomit-frame-pointer
    TARGET_ARCH =
            CPP = /lib/cpp
             LD = ld
           LINT = lint
        INSTALL = install
           TAGS = ctags
             RM = rm -f
             MV = mv
             LN = ln -s
         RANLIB = ranlib
RANLIBINSTFLAGS = -t
             AR = ar clq
             LS = ls
       LINTOPTS = -axz
    LINTLIBFLAG = -C
           MAKE = make
STD_CPP_DEFINES =
    STD_DEFINES =

###########################################################################
# site-specific configuration parameters - edit site.def to change

# site:  $XConsortium: site.def,v 1.16 88/10/12 10:30:24 jim Exp $

###########################################################################
# definitions common to all Makefiles - do not edit

          SHELL = /bin/sh

        DESTDIR =
      USRLIBDIR = $(DESTDIR)/usr/lib
         BINDIR = $(DESTDIR)/usr/X11/bin
         INCDIR = $(DESTDIR)/usr/include/X11
         ADMDIR = $(DESTDIR)/usr/adm
         LIBDIR = $(DESTDIR)/usr/X11/lib
     LINTLIBDIR = $(USRLIBDIR)/lint
        FONTDIR = $(LIBDIR)/fonts
       XINITDIR = $(LIBDIR)/xinit
         XDMDIR = $(LIBDIR)/xdm
         UWMDIR = $(LIBDIR)/uwm
         AWMDIR = $(LIBDIR)/awm
         TWMDIR = $(LIBDIR)/twm
        MANPATH = $(DESTDIR)/usr/X11/man
  MANSOURCEPATH = $(MANPATH)/man
         MANDIR = $(MANSOURCEPATH)1
      LIBMANDIR = $(MANSOURCEPATH)3
    XAPPLOADDIR = $(LIBDIR)/app-defaults

   INSTBINFLAGS = -m 0755
   INSTUIDFLAGS = -m 4755
   INSTLIBFLAGS = -m 0664
   INSTINCFLAGS = -m 0444
   INSTMANFLAGS = -m 0444
   INSTAPPFLAGS = -m 0444
  INSTKMEMFLAGS = -m 4755
        FCFLAGS = -t
    CDEBUGFLAGS = -O

        PATHSEP = /
         DEPEND = $(DEPENDSRC)/makedepend
          IMAKE = $(IMAKESRC)/imake
            RGB = $(RGBSRC)/rgb
             FC = $(BDFTOSNFSRC)/bdftosnf
      MKFONTDIR = $(MKFONTDIRSRC)/mkfontdir
      MKDIRHIER = $(SCRIPTSSRC)/mkdirhier.sh

         CFLAGS = $(CDEBUGFLAGS) $(INCLUDES) $(STD_DEFINES) $(DEFINES)
      LINTFLAGS = $(LINTOPTS) $(INCLUDES) $(STD_DEFINES) $(DEFINES) -DLINT
        LDFLAGS = $(CDEBUGFLAGS) $(SYS_LIBRARIES) $(SYSAUX_LIBRARIES)
            TOP = TOPDIR
      CLIENTSRC = $(TOP)/clients
        DEMOSRC = $(TOP)/demos
         LIBSRC = $(TOP)/lib
        FONTSRC = $(TOP)/fonts
     INCLUDESRC = $(TOP)/X11
      SERVERSRC = $(TOP)/server
        UTILSRC = $(TOP)/util
     SCRIPTSSRC = $(UTILSRC)/scripts
     EXAMPLESRC = $(TOP)/examples
     CONTRIBSRC = $(TOP)/contrib
         DOCSRC = $(TOP)/doc
         RGBSRC = $(TOP)/rgb
      DEPENDSRC = $(UTILSRC)/makedepend
       IMAKESRC = $(UTILSRC)/imake
       IRULESRC = $(UTILSRC)/imake.includes
        XLIBSRC = $(LIBSRC)/X
         XMUSRC = $(LIBSRC)/Xmu
     TOOLKITSRC = $(LIBSRC)/Xt
     AWIDGETSRC = $(LIBSRC)/Xaw
     OLDXLIBSRC = $(LIBSRC)/oldX
    BDFTOSNFSRC = $(FONTSRC)/bdftosnf
   MKFONTDIRSRC = $(FONTSRC)/mkfontdir
   EXTENSIONSRC = $(TOP)/extensions
   EXTENSIONLIB = $(USRLIBDIR)/libXext.a
           XLIB = $(USRLIBDIR)/libX11.a
         XMULIB = $(USRLIBDIR)/libXmu.a
        OLDXLIB = $(USRLIBDIR)/liboldX.a
       XTOOLLIB = $(USRLIBDIR)/libXt.a
         XAWLIB = $(USRLIBDIR)/libXaw.a
       LINTXLIB = $(XLIBSRC)/llib-lX11.ln
        LINTXMU = $(XMUSRC)/llib-lXmu.ln
      LINTXTOOL = $(TOOLKITSRC)/llib-lXt.ln
        LINTXAW = $(AWIDGETSRC)/llib-lXaw.ln
       INCLUDES = -I$(TOP)
      MACROFILE = Sun.macros
   ICONFIGFILES = $(IRULESRC)/Imake.tmpl \
			$(IRULESRC)/$(MACROFILE) $(IRULESRC)/site.def
  IMAKE_DEFINES =
      IMAKE_CMD = $(NEWTOP)$(IMAKE) -TImake.tmpl -I$(NEWTOP)$(IRULESRC) \
			-s Makefile $(IMAKE_DEFINES)
         RM_CMD = $(RM) *.CKP *.ln *.BAK *.bak *.o core errs ,* *~ *.a \
			.emacs_* tags TAGS make.log MakeOut

###########################################################################
# rules:  $XConsortium: Imake.rules,v 1.71 88/10/23 22:46:34 jim Exp $

###########################################################################
# start of Imakefile

#Imakefile for xtrek 5.3.7

CC 		= cc
TARGET_ARCH 	= -sun3

# X11_R3_ENV gets you the code in XTextExt.c, which will
# be part of the R4 environment. It speeds up string operations
# by several orders of magnitude.

XTOPTIONS	= -DTURBO_OPTION -DTELEPORT_OPTION
CFLAGS 		= -O -DX11_R3_ENV $(XTOPTIONS)
YACC		= yacc
LEX		= lex

PREFIX		= /afs/andrew.cmu.edu/usr0/games
#PREFIX		= /usr/X11
XTREKBINDIR	= $(PREFIX)/bin
XTREKLIBDIR	= $(PREFIX)/lib/xtrek
FONTDIR		= $(PREFIX)/fonts/x11
TEMPDIR		= /tmp
PLANETFILE	= /tmp/.planets
SCOREFILE	= /tmp/scores
MOTDFILE	= $(XTREKLIBDIR)/motd
DEFCONFIG	= $(XTREKLIBDIR)/default.config
XTREKOWNER	= games
XTREKGROUP	= src
XTREK		= xtrek
XTREKD		= xtrekd
SYS_LIBRARIES 	= -lm -lX11
XTREKFONT	= xtrek

#========= Do Not Change Anything Below

INSTALLFLAGS    = -s -g $(XTREKGROUP) -o $(XTREKOWNER)

SRCS	= \
	XTextExt.c \
	clock.c \
	colors.c \
	coup.c \
	damage.c \
	data.c \
	death.c \
	dmessage.c \
	enter.c \
	getship.c \
	help.c \
	icon.c \
	inform.c \
	input.c \
	interface.c \
	list.c \
	main.c \
	minisubs.c \
	newwin.c \
	parseutil.c \
	phaser.c \
	planet.c \
	redraw.c \
	resource.c \
	rmove.c \
	rotate.c \
	smessage.c \
	statline.c \
	stats.c \
	subdaemon.c \
	teleport.c \
	torp.c \
	util.c \
	war.c \
	xtparse.c

OBJS = \
	XTextExt.o \
	clock.o \
	colors.o \
	coup.o \
	damage.o \
	data.o \
	death.o \
	dmessage.o \
	enter.o \
	getship.o \
	help.o \
	icon.o \
	inform.o \
	input.o \
	interface.o \
	list.o \
	main.o \
	minisubs.o \
	newwin.o \
	parseutil.o \
	phaser.o \
	planet.o \
	redraw.o \
	resource.o \
	rmove.o \
	rotate.o \
	smessage.o \
	statline.o \
	stats.o \
	subdaemon.o \
	teleport.o \
	torp.o \
	util.o \
	war.o \
	xtparse.o

HEADERS	= \
	Xlibint.h \
	Xlibos.h \
	data.h \
	decl.h \
	defs.h \
	paths.h \
	planets.h \
	polar.h \
	struct.h \
	xdefs.h \
	xtrekfont.h

all: $(XTREKD) $(XTREK) $(XTREKFONT).snf

$(XTREKD): $(OBJS)
	$(RM) $@
	$(CC) -o $@ $(OBJS)  $(LDFLAGS)  $(SYSLAST_LIBRARIES)

relink::
	$(RM) $(XTREKD)
	$(MAKE) $(MFLAGS) $(XTREKD)

clean::
	$(RM) $(XTREKD)

$(XTREK): xtrek.o
	$(RM) $@
	$(CC) -o $@ xtrek.o  $(LDFLAGS)  $(SYSLAST_LIBRARIES)

relink::
	$(RM) $(XTREK)
	$(MAKE) $(MFLAGS) $(XTREK)

clean::
	$(RM) $(XTREK)

install:: $(XTREKD) $(XTREK)
	@case '${MFLAGS}' in *[i]*) set +e;; esac; \
	for i in $(XTREKD) $(XTREK); do \
	(set -x; $(INSTALL) -c $(INSTALLFLAGS) $$i $(XTREKBINDIR)); \
	done

$(XTREKFONT).snf: $(XTREKFONT).bdf
	$(FC) $(FCFLAGS) $? >$@

clean::
	$(RM) xtrekd xtrek
	$(RM) *.o xtrek.snf xtparse.c xttoken.c
	$(RM) *.aux *.dvi *.log

paths.h:  dummy
	@echo	"/* Machine Generated: DO NOT EDIT */" > paths.h
	@echo	\#define FONTDIR \"$(FONTDIR)\" >> paths.h
	@echo	\#define LIBDIR \"$(XTREKLIBDIR)\" >> paths.h
	@echo	\#define PROGRAM_NAME \"$(XTREK)\" >> paths.h
	@echo	\#define DIR \"$(TEMPDIR)\" >> paths.h
	@echo	\#define PLFILE \"$(PLANETFILE)\" >> paths.h
	@echo	\#define MOTD \"$(MOTDFILE)\" >> paths.h
	@echo	\#define SCOREFILE \"$(SCOREFILE)\" >> paths.h
	@echo	\#define FONTNAME \"$(XTREKFONT)\" >> paths.h
	@echo	\#define DEFAULT_CONFIG \"$(DEFCONFIG)\" >> paths.h

dummy:

decl.h:   $(SRCS)
	@grep GLOBAL *.c > decl.temp
	@echo	"/* Machine Generated: DO NOT EDIT */" > decl.h
	@sed -e "s/.*GLOBAL/extern/" -e  "s/(.*)/();/" decl.temp >> decl.h
	@$(RM) decl.temp

xtparse.o: xttoken.c xtparse.c

xttoken.c: xttoken.l
	       $(LEX) xttoken.l
	       mv lex.yy.c xttoken.c

xtparse.c: xtparse.y
	       $(YACC) xtparse.y
	       mv y.tab.c xtparse.c

###########################################################################
# Imake.tmpl common rules for all Makefiles - do not edit

emptyrule::

clean::
	$(RM_CMD) \#*

Makefile:: $(IMAKE)

Makefile:: Imakefile \
	$(IRULESRC)/Imake.tmpl \
	$(IRULESRC)/Imake.rules \
	$(IRULESRC)/site.def \
	$(IRULESRC)/$(MACROFILE)
	-@if [ -f Makefile ]; then \
	echo "$(RM) Makefile.bak; $(MV) Makefile Makefile.bak"; \
	$(RM) Makefile.bak; $(MV) Makefile Makefile.bak; \
	else exit 0; fi
	$(IMAKE_CMD) -DTOPDIR=$(TOP)

$(IMAKE):
	@echo "making $@"; \
	cd $(IMAKESRC); $(MAKE) BOOTSTRAPCFLAGS=$(BOOTSTRAPCFLAGS)

tags::
	$(TAGS) -w *.[ch]
	$(TAGS) -xw *.[ch] > TAGS

###########################################################################
# empty rules for directories that do not have SUBDIRS - do not edit

install::
	@echo "install done"

install.man::
	@echo "install.man done"

Makefiles::

###########################################################################
# dependencies generated by makedepend

