-
Notifications
You must be signed in to change notification settings - Fork 15
/
Copy pathMakefile
48 lines (34 loc) · 763 Bytes
/
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
# makefile for marshal library for Lua
# change these to reflect your Lua installation
LUA= /usr/local/bin/lua
LUAINC= /usr/local/include
LUALIB= $(LUA)
LUABIN= /usr/local/bin
WARN= -ansi -pedantic -Wall
INCS= -I$(LUAINC)
CFLAGS=-O3 $(INCS)
LDFLAGS=
OS_NAME=$(shell uname -s)
MH_NAME=$(shell uname -m)
ifeq ($(OS_NAME), Darwin)
CFLAGS+=-bundle -undefined dynamic_lookup
else ifeq ($(OS_NAME), Linux)
CFLAGS+=-shared -fPIC
endif
MYNAME= marshal
MYLIB= l$(MYNAME)
T= $(MYNAME).so
OBJS= $(MYLIB).o
TEST= test.lua
all: test
test: $T
$(LUABIN)/lua $(TEST)
o: $(MYLIB).o
so: $T
$T: $(OBJS)
$(CC) $(CFLAGS) $(WARN) -o $@ $(OBJS)
clean:
rm -f $(OBJS) $T
doc:
@echo "$(MYNAME) library:"
@fgrep '/**' $(MYLIB).c | cut -f2 -d/ | tr -d '*' | sort | column