#
# Makefile for building 32bit Windows program
#

CC = gcc
CFLAGS = -Wall -O2
RC = RC.EXE
WINLIB = /rsxwdk/lib/emx.a

# rsxwdk extender for 32bit windows prgs (without recources!)
RSXW32 = C:\RSXWDK\RSXW32.EXE

# program name
PRG = gnugo

OBJS = gnugo.o nonwin.o saveopen.o

#
# We create two files :
#   PRG.exe - rsxw32.exe file with resources
#   PRG.w32 - the EMX/GCC output
#
all : $(PRG).exe $(PRG).w32
	@echo Make Ready!

$(PRG).exe: $(PRG).res $(RSXW32)
	copy /B $(RSXW32) $(PRG).exe
	$(RC) -t $(PRG).res

$(PRG).res: $(PRG).rc
	$(RC) -r $(PRG).rc

$(PRG).w32: $(OBJS) $(WINLIB)
	$(CC) -Lc:\rsxwdk\lib -o $(PRG).w32 $(OBJS) -lemx
