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

INCLUDE = -Iinclude -Iinclude/mgl
DEBUG =
CFLAGS = -+ $(INCLUDE) -cpu=604 $(DEBUG) -dontwarn=214 -dontwarn=165
LIBS = -lmgl -lppcmath -lm -lextra -lamiga -lcgfx
LIBNAME = vlibwos:mgl.lib
DIR = Build.ppc
EXENAME = GLTestWOS
EXESRC = src/GLTest.c

DEMOS = bounceWOS GLTestWOS texsubWOS gearsWOS smtestWOS warpWOS

CC = vc +warpos -amiga-align
AR = join as

LIBOBJ = $(DIR)/matrix.o $(DIR)/context.o $(DIR)/vertexbuffer.o \
         $(DIR)/draw.o $(DIR)/texture.o $(DIR)/fog.o $(DIR)/hclip.o \
         $(DIR)/others.o $(DIR)/init.o $(DIR)/glu.o

all: $(LIBNAME) $(DEMOS)

install:
	copy include/mgl/#?.h vincludewos:mgl

clean:
	delete force quiet $(DIR)/#?.o GLtestWOS

lib: $(LIBNAME)
	@echo "Done"

bounceWOS: demos/bounce.c $(DIR)/init.o $(LIBNAME)
	$(CC) $(CFLAGS) -o bounceWOS demos/bounce.c $(DIR)/init.o $(LIBS)

texsubWOS: demos/texsub.c $(DIR)/init.o $(LIBNAME)
	$(CC) $(CFLAGS) -o texsubWOS demos/texsub.c $(DIR)/init.o $(LIBS)

gearsWOS: demos/gears.c $(DIR)/init.o $(LIBNAME)
	$(CC) $(CFLAGS) -o gearsWOS demos/gears.c $(DIR)/init.o $(LIBS)

smtestWOS: demos/smtest.c $(DIR)/init.o $(LIBNAME)
	$(CC) $(CFLAGS) -o smtestWOS demos/smtest.c $(DIR)/init.o $(LIBS)

warpWOS: demos/warp.c $(DIR)/init.o $(LIBNAME)
	$(CC) $(CFLAGS) -o warpWOS demos/warp.c $(DIR)/init.o $(LIBS)


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

$(EXENAME): $(EXESRC) $(LIBNAME)
	$(CC) $(CFLAGS) -o $@ $(EXESRC) $(LIBS)


INCS = src/sysinc.h include/mgl/clip.h include/mgl/config.h \
       include/mgl/context.h include/mgl/gl.h include/mgl/log.h \
       include/mgl/matrix.h include/mgl/minigl.h include/mgl/vertexbuffer.h


$(DIR)/context.o: src/context.c $(INCS)
	$(CC) $(CFLAGS) -c -o $@ src/context.c

$(DIR)/draw.o: src/draw.c $(INCS)
	$(CC) $(CFLAGS) -c -o $@ src/draw.c

$(DIR)/fog.o: src/fog.c $(INCS)
	$(CC) $(CFLAGS) -c -o $@ src/fog.c

$(DIR)/hclip.o: src/hclip.c $(INCS)
	$(CC) $(CFLAGS) -c -o $@ src/hclip.c

$(DIR)/init.o: src/init.c $(INCS)
	$(CC) $(CFLAGS) -c -o $@ src/init.c

$(DIR)/matrix.o: src/matrix.c $(INCS)
	$(CC) $(CFLAGS) -c -o $@ src/matrix.c

$(DIR)/others.o: src/others.c $(INCS)
	$(CC) $(CFLAGS) -c -o $@ src/others.c

$(DIR)/texture.o: src/texture.c $(INCS)
	$(CC) $(CFLAGS) -c -o $@ src/texture.c

$(DIR)/vertexbuffer.o: src/vertexbuffer.c $(INCS)
	$(CC) $(CFLAGS) -c -o $@ src/vertexbuffer.c

$(DIR)/glu.o: src/glu.c $(INCS)
	$(CC) $(CFLAGS) -c -o $@ src/glu.c
