-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile.mingw
52 lines (38 loc) · 1.15 KB
/
Makefile.mingw
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
# Makefile for Lua BitOp -- a bit operations library for Lua 5.1/5.2.
# This is a modified Makefile for MinGW. C:\MinGW\bin must be in your PATH.
# Compile: mingw32-make -f Makefile.mingw
# Install: mingw32-make -f Makefile.mingw install
# Lua executable name. Used for testing.
LUA= lua
# Include path where lua.h, luaconf.h and lauxlib.h reside:
INCLUDES= "-I.."
# Path of lua51.dll:
LUADLLPATH= "..\lua51.dll"
# Path where C modules for Lua should be installed:
LUACMODPATH= ".."
CC= gcc
CCOPT= -O2 -fomit-frame-pointer
CCWARN = -Wall
SOCC= $(CC) -shared
SOCFLAGS= $(CCOPT) $(CCWARN) $(INCLUDES) $(CFLAGS)
SOLDFLAGS= $(LDFLAGS)
RM= del
STRIP= strip --strip-unneeded
INSTALL= copy
MODNAME= bit
MODSO= $(MODNAME).dll
all: $(MODSO)
$(MODNAME).o: $(MODNAME).c
$(CC) $(SOCFLAGS) -c -o $@ $<
$(MODSO): $(MODNAME).o
$(SOCC) $(SOLDFLAGS) -o $@ $< $(LUADLLPATH)
$(STRIP) $@
install: $(MODSO)
$(INSTALL) $< $(LUACMODPATH)
test: $(MODSO)
@$(LUA) bittest.lua && echo "basic test OK"
@$(LUA) nsievebits.lua && echo "nsievebits test OK"
@$(LUA) md5test.lua && echo "MD5 test OK"
clean:
$(RM) *.o *.so *.obj *.lib *.exp *.dll *.manifest
.PHONY: all install test clean