# Copyright (c) 1986, 1991  Stanley T. Shebs.
# Copyright (c) 1995 Michael J. Peters
# This program may be used, copied, modified, and redistributed freely
# for noncommercial purposes, so long as this notice remains intact.
#
# This Makefile is VERY limited (HP-UX 9.X only).  I haven't had a chance 
# to create an Imakefile to support everything yet.

## ******* USER-DEFINABLE OPTIONS ************************



## ******* STOP EDITING HERE UNLESS YOU KNOW WHAT YOU'RE DOING *******

MAINOBJ = Motif.o X11.o attack.o command.o draw.o ginit.o help.o init.o \
      input.o map.o mconq.o minit.o mkmap.o move.o mplay.o mproduce.o \
      mutil.o mvars.o order.o output.o period.o phases.o side.o \
      sergeant.o unit.o util.o

MAINSRCS = Motif.c X11.c attack.c command.c draw.c ginit.c help.c init.c \
      input.c map.c mconq.c minit.c mkmap.c move.c mplay.c mproduce.c \
      mutil.c mvars.c order.c output.c period.c phases.c side.c \
      sergeant.c unit.c util.c

X11_LIBS = -L/usr/lib/X11R5 -lXt -lX11
MOTIF_LIBS = -L/usr/lib/Motif1.2 -lXm
CFLAGS =  -Aa -g -I/usr/include/X11R5 -I/usr/include/Motif1.2 \
          -D_INCLUDE_HPUX_SOURCE -D_XPG4 -D_INCLUDE_XOPEN_SOURCE -D_INCLUDE_POSIX_SOURCE
LINTFLAGS =  -Aa -u -v -I/usr/include/X11R5 -I/usr/include/Motif1.2 \
          -D_INCLUDE_HPUX_SOURCE -D_XPG4 -D_INCLUDE_XOPEN_SOURCE -D_INCLUDE_POSIX_SOURCE
LINT = /usr/bin/lint

all:: mconq

mconq: ${MAINOBJ}
	${CC} -Aa -o $@ ${MAINOBJ} ${MOTIF_LIBS} ${X11_LIBS} 

lint:
	${LINT} ${LINTFLAGS} ${MAINSRCS}

## ******* FONTS ***********************
## The following definitions will install the fonts into a
## subdirectory of the main font path.  As is, you will need
## to use "xset +fp [installed path]" before starting xconq
## or make a shell script to do this automatically.
##
## It is perhaps wiser to install the fonts manually into
## a directory within the standard search path (for example,
## $(FONTDIR)/misc ).  Take your pick.

OBJS=xconq.pcf standard.pcf

xconq.pcf: xconq.bdf
	bdftopcf -t $? -o $@

standard.pcf: standard.bdf
	bdftopcf -t $? -o $@

all:: $(OBJS)

all:: fonts.dir

fonts.dir: $(OBJS)
	mkfontdir .


# ******* dependencies ***********************

Motif.o: config.h misc.h dir.h period.h side.h unit.h map.h X11.h Motif.h global.h
X11.o: config.h misc.h dir.h period.h side.h unit.h map.h X11.h global.h
attack.o: config.h misc.h period.h side.h unit.h map.h global.h
command.o: config.h misc.h dir.h period.h side.h unit.h map.h mplay.h X11.h Motif.h global.h
draw.o: config.h misc.h period.h side.h unit.h map.h X11.h Motif.h global.h
ginit.o: config.h misc.h dir.h side.h unit.h map.h X11.h Motif.h global.h
help.o: config.h misc.h period.h side.h unit.h map.h Motif.h global.h
init.o: config.h misc.h dir.h period.h side.h unit.h map.h global.h
input.o: config.h misc.h side.h unit.h map.h Motif.h global.h
map.o:  config.h misc.h dir.h period.h side.h unit.h map.h global.h version.h
mconq.o: config.h misc.h dir.h period.h side.h unit.h map.h X11.h Motif.h global.h version.h standard.h
minit.o: config.h misc.h dir.h period.h side.h unit.h map.h mplay.h global.h
mkmap.o: config.h misc.h dir.h period.h map.h
move.o: config.h misc.h dir.h period.h side.h unit.h map.h mplay.h X11.h Motif.h global.h
mplay.o: config.h misc.h dir.h period.h side.h unit.h map.h mplay.h global.h
mproduce.o: config.h misc.h dir.h period.h side.h unit.h map.h mplay.h global.h
mutil.o: config.h misc.h dir.h period.h side.h unit.h map.h mplay.h global.h
mvars.o: config.h misc.h dir.h side.h unit.h mplay.h
order.o: config.h misc.h period.h dir.h side.h unit.h mplay.h global.h
output.o: config.h misc.h period.h side.h unit.h map.h X11.h Motif.h global.h
period.o: config.h misc.h period.h side.h unit.h global.h
phases.o: config.h misc.h dir.h period.h side.h unit.h map.h mplay.h global.h
sergeant.o: config.h misc.h dir.h period.h side.h unit.h map.h
side.o: config.h misc.h dir.h period.h side.h unit.h map.h global.h
unit.o: config.h misc.h dir.h period.h side.h unit.h map.h mplay.h global.h
util.o:  config.h misc.h dir.h map.h
