# DOS/DJGPP tests makefile for Glide3
#
#  Copyright (c) 2002 - Borca Daniel
#  Email : dborca@users.sourceforge.net
#  Web   : http://www.geocities.com/dborca
#
# $Header: /cvsroot/glide/glide3x/h3/glide3/tests/Attic/Makefile.DJ,v 1.1.2.6 2003/08/28 15:34:26 dborca Exp $
#


#
#  Available options:
#
#    Environment variables:
#	CPU		optimize for the given processor.
#			default = pentium
#	DXE=1		use DXE modules.
#			default = no
#
#    Targets:
#	<file.exe>	build a specific file
#


.PHONY: all
.SUFFIXES: .c .o .exe
.SECONDARY: tlib.o

FX_GLIDE_HW = h3
TOP = ../../..
CPU ?= pentium

CC = gcc
CFLAGS = -Wall -O2 -ffast-math -mcpu=$(CPU)
CFLAGS += -I$(TOP)/$(FX_GLIDE_HW)/glide3/src -I$(TOP)/$(FX_GLIDE_HW)/incsrc
CFLAGS += -I$(TOP)/swlibs/fxmisc
CFLAGS += -D__DOS__ -DH3
CFLAGS += -D__DOS32__

LDFLAGS = -s -L$(TOP)/$(FX_GLIDE_HW)/lib

ifdef DXE
LDLIBS = -lgld3i
else
LDLIBS = -lgld3x
endif

.c.o:
	$(CC) -o $@ $(CFLAGS) -c $<
%.exe: tlib.o %.o
	$(CC) -o $@ $(LDFLAGS) $^ $(LDLIBS)

all:
	$(error Must specify <filename.exe> to build)
