Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Fetching contributors…

Octocat-spinner-32-eaf2f5

Cannot retrieve contributors at this time

file 58 lines (45 sloc) 2.517 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57

LUA_LIBDIR=c:\usr\local\lib\lua
LUA_DIR=c:\usr\local\share\lua\5.1
BIN_DIR=c:\usr\local\bin
CFLAGS=/O2 /DWINDOWS /D_WIN64 /Ic:\usr\local\include /Ilibffi\win32
LIB_OPTION="c:\usr\local\bin\lua5.1.lib"
PREFIX=c:\usr\local
LIBFFI_OBJS=libffi\win32\ffi.obj libffi\win32\prep_cif.obj libffi\win32\types.obj libffi\win32\win64.obj

{src\alien}.c{src\alien}.obj:
cl /c /MD /Fo$@ $(CFLAGS) $<

{libffi\win32}.c{libffi\win32}.obj:
cl /c /MD /Fo$@ $(CFLAGS) /D_MSC_VER /DX86_64 $<

all: src\alien\core.dll src\alien\struct.dll tests\alientest.dll
IF EXIST src\alien\core.dll.manifest del src\alien\core.dll.manifest
IF EXIST src\alien\struct.dll.manifest del src\alien\struct.dll.manifest
IF EXIST tests\alientest.dll.manifest del tests\alientest.dll.manifest

libffi\win32\ffi.lib: $(LIBFFI_OBJS)
lib /out:libffi\win32\ffi.lib $(LIBFFI_OBJS)

libffi\win32\win64.obj: libffi\win32\win64.asm
        ml64.exe /nologo /c /Zi /Folibffi\win32\win64.obj libffi\win32\win64.asm

src\alien\core.dll: src\alien\core.obj libffi\win32\ffi.lib
link /dll /out:src\alien\core.dll /def:src\alien\core.def src\alien\core.obj $(LIB_OPTION) libffi\win32\ffi.lib
IF EXIST src\alien\core.dll.manifest mt -manifest src\alien\core.dll.manifest -outputresource:src\alien\core.dll;2

src\alien\struct.dll: src\alien\struct.obj
link /dll /out:src\alien\struct.dll /def:src\alien\struct.def $(LIB_OPTION) src\alien\struct.obj
IF EXIST src\alien\struct.dll.manifest mt -manifest src\alien\struct.dll.manifest -outputresource:src\alien\struct.dll;2

tests\alientest.dll:
cl /c /MD $(CFLAGS) /Fotests\alientest.obj tests\alientest.c
link /dll /out:tests\alientest.dll tests\alientest.obj $(LIB_OPTION)
IF EXIST tests\alientest.dll.manifest mt -manifest tests\alientest.dll.manifest -outputresource:tests\alientest.dll;2

install:
IF NOT EXIST "$(LUA_LIBDIR)\alien" mkdir "$(LUA_LIBDIR)\alien"
copy src\alien\core.dll "$(LUA_LIBDIR)\alien"
IF NOT EXIST "$(LUA_LIBDIR)\alien" mkdir "$(LUA_LIBDIR)\alien"
copy src\alien\struct.dll "$(LUA_LIBDIR)\alien"
copy src\alien.lua "$(LUA_DIR)\"
copy src\constants "$(BIN_DIR)\"
xcopy /E /S tests "$(PREFIX)\tests\"
xcopy /E /S samples "$(PREFIX)\samples\"
xcopy /E /S doc "$(PREFIX)\doc\"

clean:
del src\alien\*.dll src\alien\*.obj src\alien\*.exp src\alien\*.lib src\alien\*.dll.manifest
del tests\alientest.dll tests\alientest.obj tests\alientest.exp tests\alientest.lib tests\alientest.dll.manifest
del libffi\win32\ffi.lib libffi\win32\*.obj

test:
cd tests && lua5.1 test_alien.lua
Something went wrong with that request. Please try again.