/**/#
/**/# Imakefile for ./Src - part of the UMDENG X-Tank distribution
/**/#
/**/# $Id: Imakefile,v 1.26 1992/02/06 07:57:38 lidl Exp $
/**/#

#include "../Imakefile.Config"

      CDEBUGFLAGS = -g
          DEPLIBS = $(DEPXLIB)
  LOCAL_LIBRARIES = $(XLIB)
             SRCS = 3d.c XMultiSync.c actions.c animate.c box.c collision.c \
                    console.c cosell.c display.c escher.c explosion.c \
                    file.c game.c gr.c graphics.c highlib.c hit.c icounter.c \
                    init.c input.c interface.c intersect.c lowlib.c main.c \
                    malloc.c mapper.c maze.c mdesign.c menu.c message.c \
                    objects.c program.c radar.c repair.c scroll.c setup.c \
                    setups.c status.c sysdep.c thread.c unix.c update.c \
                    util.c vdesign.c vehicle.c newfile.c vload.c \
                    version.c $(SRCS2)
             OBJS = 3d.o XMultiSync.o actions.o animate.o box.o collision.o \
                    console.o cosell.o display.o escher.o explosion.o \
                    file.o game.o gr.o graphics.o highlib.o hit.o icounter.o \
                    init.o input.o interface.o intersect.o lowlib.o main.o \
                    malloc.o mapper.o maze.o mdesign.o menu.o message.o \
                    objects.o program.o radar.o repair.o scroll.o setup.o \
                    setups.o status.o sysdep.o thread.o unix.o update.o \
                    util.o vdesign.o vehicle.o newfile.o vload.o \
                    version.o $(OBJS2)
             INCL = Include/bullet.h Include/common.h Include/cosell.h \
                    Include/disc.h Include/game.h Include/globals.h \
                    Include/gr.h Include/graphics.h Include/icounter.h \
                    Include/interface.h Include/limits.h Include/loc.h \
                    Include/lowlib.h Include/malloc.h Include/map.h \
                    Include/maze.h Include/mdesign.h Include/menu.h \
                    Include/message.h Include/object.h Include/outpost.h \
                    Include/program.h Include/screen.h Include/scroll.h \
                    Include/settings.h Include/setup.h Include/special-defs.h \
                    Include/special.h Include/sysdep.h Include/team.h \
                    Include/terminal.h Include/thread.h Include/tread-defs.h \
                    Include/types.h Include/vdesc.h Include/vehicle.h \
                    Include/vehicleparts.h Include/vstructs.h \
                    Include/weapon-defs.h Include/xtank.h Include/xtanklib.h
            XINCL = Include/Xlibos.h Include/x11.h

/**/# Note that both x11.c and mazeconv.c are included in other .c files,
/**/# so they are not listed above!

/**/# Important things that Xtank wants to find

   EXTRA_INCLUDES = -I. -IInclude

/**/# Everybody needs the following libraries
#ifdef NeXTArchitecture
  EXTRA_LIBRARIES = -LPrograms -lxtankrobots
#else
  EXTRA_LIBRARIES = -LPrograms -lxtankrobots -lm
#endif

/**/# Start of System Dependent Things
/**/# (e.g. libraries, linker flags and so forth)

#ifdef i860Architecture
    SYS_LIBRARIES = -lnsl
#endif
#ifdef ApolloArchitecture
    SYS_LIBRARIES = -L/usr/X11/lib
#endif
#ifdef HPArchitecture
    SYS_LIBRARIES = -lBSD -lmalloc
# ifdef hp9000s800
            SRCS2 = flush_hp9k8.c
            OBJS2 = flush_hp9k8.o
# endif
#endif
#ifdef MultimaxArchitecture
        CCOPTIONS = -g -O -q nosb -q ext=parallel
#endif
#if defined(RiscArchitecture) || defined(RsArchitecture)
/**/#
/**/# Which is real?  I dont know... X11R5 says the latter...
/**/#
            SRCS2 = rs6klongjmp.s
            OBJS2 = rs6klongjmp.o
 EXTRA_LOAD_FLAGS = -lbsd
#endif
#ifdef RtArchitecture
/**/# IBM RT
#endif
#ifdef SGIArchitecture
    SYS_LIBRARIES = -lm43 -lbsd -lsun
#endif
#ifdef SunArchitecture
    SYS_LIBRARIES = /usr/lib/debug/malloc.o -llwp
        CCOPTIONS = -Bstatic
#ifdef SparcArchitecture
/**/# Sun4
#else
/**/# Sun3
#endif
#endif
#ifdef UltrixArchitecture
#ifdef MipsArchitecture
            SRCS2 = mipssj.s
            OBJS2 = mipssj.o
#endif
#endif
#ifdef VaxArchitecture
            SRCS2 = vaxsj.s
            OBJS2 = vaxsj.o
#endif

/**/# End of System Dependent Things

#define IHaveSubdirs
#define PassCDebugFlags 'CDEBUGFLAGS=$(CDEBUGFLAGS)'
#undef PassCDebugFlags
#define PassCDebugFlags
#define PassDefines 'DEFINES=$(DEFINES)'

          SUBDIRS = Programs

MakeSubdirs($(SUBDIRS))

all::
	$(RM) version.c

ComplexProgramTarget($(XTANK_TARGET))

ExtraSpecialObjectRule(init.o, init.c, -g)

setups.c: setups.l
	flex -t setups.l > $@
	@-chmod 664 $@ 2>/dev/null

vload.c: vload.l
	flex -t vload.l | sed 's/yy/zz/g' > $@
	@-chmod 664 $@ 2>/dev/null

version.c:
	@echo -n "Updating version number..."
	@../Bin/newversion.sh $(XTANK_TARGET)
	@echo " Done."

copyout:
	co $(SRCS) $(INCL)

all::
	@-chgrp xtank *.o 2>/dev/null
	@-chmod 664 *.o 2>/dev/null

/**/#prof:
/**/#	$(COMPILE.c) -O -pg $(SRCS)
/**/#	$(LINK.c) -O -pg -o xtank.sun4.prof $(OBJS) $(LIBSUN)

/**/#lint: $(SRCS)
/**/#	$(LINT.c) $(SRCS) | grep -v "possible pointer alignment problem"

print:
	enscript -2rG Makefile $(INCL) $(SRCS) x11.c

TAGS: $(INCL) $(SRCS) $(XINCL) $(XSRCS) x11.c
	etags -t $(INCL) $(XINCL) $(SRCS) $(XSRCS) x11.c
