# Makefile for Windows Git, compiled with MinGW GCC 2.95

CC = gcc-2 -Wall -O3 -mwindows
OPTIONS = -DUSE_INLINE -DUSE_DIRECT_THREADING
LIBS = -L. -lglk

OUTPUT = ../Executables/Release/Git

CFLAGS = $(OPTIONS) -I../Include

OBJS =	git.o memory.o compiler.o opcodes.o operands.o peephole.o terp.o \
	glkop.o search.o git_windows.o savefile.o saveundo.o gestalt.o \
	accel.o heap.o glk.o res.o

git: $(OBJS) libglk.a
	$(CC) -s -o $(OUTPUT) $(OBJS) $(LIBS)

glk.o: ../glk.c
	$(CC) $(CFLAGS) -c -o $@ $^

res.o: win/git.rc
	windres --preprocessor "gcc-2 -E -xc-header -DRC_INVOKED" $^ $@

libglk.a:
	dlltool --dllname=Glk.dll --def=../GlkDll/Glk.def --output-lib=libglk.a

clean:
	del *.o *.a

