#
# $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
CFLAGS = $(INCLUDE) -mcpu=604e -mmultiple -D__PPC__ $(DEBUG)
CFLAGS2= $(INCLUDE) -mcpu=604e -mmultiple -D__PPC__ $(DEBUG)
DEBUG =
LIBNAME = ../libppc/libmgl.a
EXENAME = ../GLTest

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

CC = pgcc -V 2.95.2 -warpup -O3

AR = ppc-amigaos-ar
RANLIB = ppc-amigaos-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)

install:
	cp ../include/mgl/*.h /usr/os-includeppc/mgl
	cp ../libppc/libmgl.a /usr/ppc-amigaos/lib

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

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

lib: $(LIBNAME)
	@echo "Done"

../bounce: bounce.o init.o $(LIBNAME)
	$(CC) -o bounce.elf bounce.o init.o -L../libppc -lmgl -lm -ldebug
	elf2exe2 bounce.elf ../bounce

../smtest: smtest.o init.o $(LIBNAME)
	$(CC) -o smtest.elf smtest.o init.o -L../libppc -lmgl -lm -ldebug
	elf2exe2 smtest.elf ../smtest

../texsub: texsub.o init.o $(LIBNAME)
	$(CC) -o texsub.elf texsub.o init.o -L../libppc -lmgl -lm -ldebug
	elf2exe2 texsub.elf ../texsub

../gears: gears.o init.o $(LIBNAME)
	$(CC) -o gears.elf gears.o init.o -L../libppc -lmgl -lm -ldebug
	elf2exe2 gears.elf ../gears

../warp: warp.o init.o $(LIBNAME)
	$(CC) -o warp.elf warp.o init.o -L../libppc -lmgl -lm -ldebug
	elf2exe2 warp.elf ../warp

$(LIBNAME): $(LIBOBJ)
	$(AR) rcs $(LIBNAME) $(LIBOBJ)

$(EXENAME): $(EXEOBJ) $(LIBNAME)
	$(CC) -o temp.elf $(EXEOBJ) -L../libppc  -lmgl -lm -ldebug
	elf2exe2 temp.elf $(EXENAME)

GLTest2.o: ../src/GLTest2.c
	$(CC) $(CFLAGS2) -c ../src/GLTest2.c

GLTest2: GLTest2.o $(LIBNAME)
	$(CC) -o ../GLTest2 gltest2.o -L../libppc -lmgl -lm -ldebug

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


