#
# $Id: makefile.vbcc68k,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 AmigaOS/68k 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=68040 -fpu=68040 $(DEBUG) \
         -dontwarn=214 -dontwarn=165
LIBS = -lmgl -lm040 -lextra -ldebug -lamiga -lcgfx
LIBNAME = vlibm68k:mgl.lib
DIR = Build
EXENAME = GLTest
EXESRC = src/GLTest.c

DEMOS = bounce GLTest texsub gears smtest

CC = vc
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 vinclude68k:mgl

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

lib: $(LIBNAME)
	@echo "Done"

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

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

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

smtest: demos/smtest.c $(DIR)/init.o $(LIBNAME)
	$(CC) $(CFLAGS) -o smtest demos/smtest.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
