forked from LuaDist/luaxml
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
50 lines (40 loc) · 1.03 KB
/
Makefile
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
# 2009-03-16 by gf
# generic compiler and linker settings:
CC = gcc
INCDIR = -I../lua/src
LIB =
LIBDIR = -L. -L../lua/src
CFLAGS = -Os -Wall -c #-g
# generic platform specific rules:
ARCH = $(shell uname -s)
ifeq ($(ARCH),Linux)
CFLAGS += -fPIC
LFLAGS = -fPIC -shared
LIBS = $(LIBDIR) $(LIB) -llua -ldl
EXESUFFIX =
SHLIBSUFFIX = .so
else
ifeq ($(ARCH),Darwin) # MacOSX
LFLAGS = -bundle
LIBS = $(LIBDIR) -L/usr/local/lib $(LIB) -llua
EXESUFFIX = .app
SHLIBSUFFIX = .so
else # windows, MinGW
LFLAGS = -shared
LIBS = $(LIBDIR) $(LIB) -llua51 -mconsole -s
EXESUFFIX = .exe
SHLIBSUFFIX = .dll
endif
endif
# project specific targets:
all: LuaXML_lib$(SHLIBSUFFIX)
# project specific link rules:
LuaXML_lib$(SHLIBSUFFIX): LuaXML_lib.o
$(CC) -o $@ $(LFLAGS) $^ $(LIBS)
# project specific dependencies:
LuaXML_lib.o: LuaXML_lib.c
# generic rules and targets:
.c.o:
$(CC) $(CFLAGS) $(INCDIR) -c $<
clean:
rm -f *.o *~ LuaXML_lib.so LuaXML_lib.dll