# bitness (32 or 64)
DIRBIT = 32

# path to GCC
PATH = $(GCC$(DIRBIT))

# path to Lua or LuaJIT source directory
LUADIR = $(CROOT)\work\github\LuaJIT\src

# path to directory with lua51.dll and luafar3.dll
LIBDIR = $(CROOT)\Programs\Far3-$(DIRBIT)bit

# interpreter object file (either 'lua.o' or 'luajit.o')
OBJ_INTERPR = luajit.o

ifeq ($(DIRBIT),64)
TARGET = lfjit64.exe
else
TARGET = lfjit.exe
endif

vpath %.c $(LUADIR)

CFLAGS = -O2 -W -Wall -I$(LUADIR)
LIBS = -L$(LIBDIR) -lluafar3 -llua51 -static-libgcc
CC = gcc

$(TARGET): linit.o $(OBJ_INTERPR)
	$(CC) -o $@ $^ $(LIBS) -s

clean:
	del *.o *.exe
