-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathMakefile
More file actions
42 lines (26 loc) · 755 Bytes
/
Makefile
File metadata and controls
42 lines (26 loc) · 755 Bytes
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
GENCFILE=code.c
INSTALLDIR=/usr/local
INSTALLLIB=$(INSTALLDIR)/lib
CLANGINCLUDE=/usr/include/clang/3.1/include
INCLUDE=/usr/include/lua5.1
LIBS=-lc -llua5.1
LUA=lua5.1
CFLAGS=-O2 -fpic -Wall
SONAME=stat.so
LIBNAME=$(SONAME)
$(LIBNAME): code.o
$(CC) -shared -Wl,-soname,$(SONAME) -o $(LIBNAME) code.o $(LIBS)
code.o: $(GENCFILE)
$(CC) $(CFLAGS) -I$(INCLUDE) -c $(GENCFILE) -o code.o
code.c: parse.lua stat.c
C_INCLUDE_PATH=$(CLANGINCLUDE) $(LUA) parse.lua stat.c
all: $(LIBNAME)
default: all
test: test.lua $(LIBNAME)
$(LUA) test.lua
clean:
rm -f *~ *.o $(LIBNAME) $(GENCFILE)
install: $(LIBNAME)
install -d $(INSTALLLIB)
install $(LIBNAME) $(INSTALLLIB)
ldconfig $(INSTALLLIB)