# MinGW tests makefile for Glide3
#
#  Copyright (c) 2002 - Borca Daniel
#  Email : dborca@users.sourceforge.net
#  Web   : http://www.geocities.com/dborca
#

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

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

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

CC = mingw32-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__WIN32__ -DH3
CFLAGS += -DFX_GLIDE_NAPALM=1

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

LDLIBS = -lgdi32 -lglide3x

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

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