# This is a pretty bare-bones Makefile, buy hey! its free!
# Makefile for v 1.2 of battalion (OpenGL/Mesa version)
#
# if you are compiling this on an SGI the makefile should work fine,
# otherwise you may have to do a little bit of tweaking.
#
# battalion first checks the environment variable BATTALIONDATADIR to
# look for the data files. Specifically it looks for the battalion.sho
# showcase file. if battalion.sho is not found in the BATTALIONDATADIR
# directory then it will check ./battalion.data/
#
# if you are running the program on an SGI you will want to leave
# battalion.sho alone as it is your on-line help. If you do not have
# an SGI then you can replace this file with any smaller file with the
# same name if you want to conserve space.
#
# set -DMESA_TK_VERSION if you want to use the mesa tk libs rather than mine
# set -DMESAVERSION if using the mesa GL and GLU instead of OpenGL
# set -DSGIVERSION if compiling on a Silicon Graphics workstation with OpenGL
#         only set SGIVERSION if you are compiling on an SGI as this
#         will attempt to use the SGI audio libraries.
#
# include -laudio -laudiofile for the SGIVERSION, and omit otherwise
# for Mesa version use  -lMesaGLU -lMesaGL inplace of -lGL -lGLU
#
# battalion was written in C so cc, acc, gcc, DCC, CC should work fine.

INCLS = 
LIBS =  -L ./. -laudio -laudiofile -lGL -lGLU -lm -lX11 -lXext
CC = DCC
OPT = -O -fullwarn
LIBFLAG = -DSGIVERSION

battalion: battalion.o gprim.o graphics.o update.o tk.o font.o battalion.h
	$(CC) $(OPT) -o battalion graphics.o gprim.o update.o tk.o font.o battalion.o $(LIBS)

tk.o: tk.c tk.h battalion.h
	$(CC) $(OPT) -c tk.c $(INCLS) $(LIBFLAG)

font.o: font.c tk.h battalion.h
	$(CC) $(OPT) -c font.c $(INCLS) $(LIBFLAG)

gprim.o: gprim.c battalion.h
	$(CC) $(OPT) -c gprim.c $(INCLS) $(LIBFLAG)

graphics.o: graphics.c battalion.h
	$(CC) $(OPT) -c graphics.c $(INCLS) $(LIBFLAG)

update.o: update.c battalion.h
	$(CC) $(OPT) -c update.c $(INCLS) $(LIBFLAG)

battalion.o: battalion.c battalion.h
	$(CC) $(OPT) -c battalion.c $(INCLS) $(LIBFLAG)

install: battalion
	rm battalion.o gprim.o graphics.o update.o tk.o font.o

# this makefile works for OpenGL on SGIs, Mesa on SGIs, Mesa on SUN-OS 4,
# and Mesa on LINUX
