# The bB Win32 cross compiling makefile. 
#
# See COMPILE.txt for details on how to setup the supporting environment
#

SHELL=/bin/sh
CHMOD=chmod
CP=cp
RM=rm
CFLAGS=-O2 -m32
CC=i686-w64-mingw32-gcc
LEX=lex
LEXFLAGS=-t

all:            2600basic.Windows.x86.exe preprocess.Windows.x86.exe postprocess.Windows.x86.exe bbfilter.Windows.x86.exe optimize.Windows.x86.exe

2600basic.Windows.x86.exe: 2600bas.c statements.c keywords.c statements.h keywords.h
	${CC} ${CFLAGS} -o 2600basic.Windows.x86.exe 2600bas.c statements.c keywords.c

postprocess.Windows.x86.exe: postprocess.c
	${CC} ${CFLAGS} -o postprocess.Windows.x86.exe postprocess.c

bbfilter.Windows.x86.exe: bbfilter.c
	${CC} ${CFLAGS} -o bbfilter.Windows.x86.exe bbfilter.c

preprocess.Windows.x86.exe: preprocess.lex
	${LEX} ${LEXFLAGS}<preprocess.lex>lex.yy.c
	${CC} ${CFLAGS} -o preprocess.Windows.x86.exe lex.yy.c
	${RM} -f lex.yy.c

optimize.Windows.x86.exe: optimize.lex
	${LEX} ${LEXFLAGS} -i<optimize.lex>lex.yy.c
	${CC} ${CFLAGS} -o optimize.Windows.x86.exe lex.yy.c
	${RM} -f lex.yy.c

install:        all

clean:
	${RM} -f a.out core 2600basic.Windows.x86.exe preprocess.Windows.x86.exe postprocess.Windows.x86.exe bbfilter.Windows.x86.exe optimize.Windows.x86.exe

love:
	@echo "not war"
