#
# Makefile for building 32bit Windows
#

CC = gcc
CFLAGS = -Wall -O2
LDFLAGS = -L\rsxwdk\lib -lemx

WINLIB = \rsxwdk\lib\emx.a
RSXW32 = C:\RSXWDK\RSXW32.EXE

# program name
PRG = speed

.c.o:
	$(CC) $(CFLAGS) -c $<

.o.w32:
	$(CC) -o $(PRG).w32 $<

all : $(PRG).exe $(PRG).w32
	@echo Make Ready!

#
# We create two files :
#   PRG.exe - rsxrc file with resources
#   PRG.w32 - the EMX/GCC output
#

OBJS = $(PRG).o

$(PRG).exe: $(RSXW32) $(PRG).w32
	\rsxwdk\rsxwbind $(RSXW32) $(PRG).w32 $(PRG).exe

$(PRG).w32: $(OBJS) $(WINLIB)
	$(CC) $(LDFLAGS) -o $(PRG).w32 $(OBJS) -v

