# 
# $Id: Makefile,v 1.1.1.1 2000/04/07 19:44:48 tfrieden Exp $
# 
# $Date: 2000/04/07 19:44:48 $
# $Revision: 1.1.1.1 $
# 
# (C) 1999 by Hyperion
# All rights reserved
# 
# This file is part of the MiniGL library project
# See the file Licence.txt for more details
# 
# 

VPATH = ../src/ ../demos
INCLUDE = -I../include -I/Warp3d/include
CFLAGS = $(INCLUDE)  -m68060 $(DEBUG) #-Wa,-mno-68882 -Wa,-mno-68881 # -noixemul
CFLAGS2= $(INCLUDE)  -m68060 $(DEBUG)
DEBUG = -g -gstabs
LIBNAME = ../lib/libmgl.a
EXENAME = ../GLTest
INSTALLPATH = /usr

DEMOS = ../bounce ../GLTest ../texsub ../gears ../smtest ../warp

CC = gcc -O2 -Wimplicit-function-dec

AR = ar
RANLIB = ranlib

LIBOBJ = matrix.o context.o vertexbuffer.o draw.o texture.o fog.o hclip.o others.o init.o glu.o

EXEOBJ = GLTest.o

all: $(LIBNAME) $(DEMOS)

clean:
	-rm *.o ../GLtest ../lib/libmgl.a

%.o: %.c
	$(CC) $(CFLAGS) -c $<

lib: $(LIBNAME)
	@echo "Done"

../bounce: bounce.o init.o $(LIBNAME)
	gcc -g -o ../bounce bounce.o init.o -L$(INSTALLPATH)/lib -L../lib -lmgl -lm -ldebug

../texsub: texsub.o init.o $(LIBNAME)
	gcc -g -o ../texsub texsub.o init.o -L$(INSTALLPATH)/lib -L../lib -lmgl -lm -ldebug

../gears: gears.o init.o $(LIBNAME)
	gcc -g -o ../gears gears.o init.o -L$(INSTALLPATH)/lib -L../lib -lmgl -lm -ldebug

../smtest: smtest.o init.o $(LIBNAME)
	gcc -g -o ../smtest smtest.o init.o -L$(INSTALLPATH)/lib -L../lib -lmgl -lm -ldebug

../warp: warp.o init.o $(LIBNAME)
	gcc -g -o ../warp warp.o init.o -L$(INSTALLPATH)/lib -L../lib -lmgl -lm -ldebug


$(LIBNAME): $(LIBOBJ)
	$(AR) rcs $(LIBNAME) $(LIBOBJ)
	-mkdir /$(INSTALLPATH)/include/mgl
	cp $(LIBNAME) $(INSTALLPATH)/lib
	cp ../include/mgl/*.h $(INSTALLPATH)/include/mgl

$(EXENAME): $(EXEOBJ) $(LIBNAME)
	gcc -g -o $(EXENAME) $(EXEOBJ) -L$(INSTALLPATH)/lib -L../lib  -lmgl -lm -ldebug

depend:
	makedepend $(INCLUDE) src/*.c


