#
# GRX test programs makefile for mingw32.
# Uses GNU make.
#
.SUFFIXES: .exe
.PHONY: clean

GRXVW32=y

include ../makedefs.grx

# The following line is useful only in this makefile to force recompilation
GRXLIB = ../lib/$(GRX_LIB_SUBDIR)/libgrx20.a
# In normal use the library libgrx20.a is linked in through 
# {$L grx20} contained in the unit grx.pas called by "uses grx".
# The same is valid for other ADDON libraries.
# If the library is NOT installed give its path
# (default when first compiling/testing the library)
GRXLIBPATH = -L../lib/$(GRX_LIB_SUBDIR)
# When it is installed in a standard system location
# (normal use) this is no more necessary

LIBS= $(GRXLIBPATH) -mwindows

# Compiler and options on your system  
COMPILER = $(PC) --autobuild


PROGS= 			\
	blt_test.exe 	\
	keytest.exe 	\
	txt_test.exe 	\
	vir_test.exe	\
	jpgtest.exe	\
	colortst.exe	\
	imgview.exe

PROGS_C=		\
	polytest.exe	\
	modetest.exe

all: $(PROGS) $(PROGS_C)

$(PROGS): %.exe : %.pas $(GRXLIB) grx.pas
	$(COMPILER) $(CCOPT) -o $*.exe $*.pas $(LIBS)

$(PROGS_C): %.exe : %.pas $(GRXLIB) grx.pas
	$(COMPILER) $(CCOPT) -o $*.exe $*.pas $(LIBS) -mconsole

clean:
ifeq ($(HAVE_UNIX_TOOLS),y)
	rm -f *.o *.exe *.gpi *.gpm
else
	if exist *.o del *.o
	if exist *.exe del *.exe
	if exist *.gpi del *.gpi
	if exist *.gpm del *.gpm
endif
