-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
33 lines (23 loc) · 790 Bytes
/
Copy pathMakefile
File metadata and controls
33 lines (23 loc) · 790 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
LUA_INCDIR=/usr/include/lua5.4
LUA_BIN=/usr/bin/lua5.4
LIBDIR=/usr/local/lib/lua/5.4
CFLAGS=-Wall -Wextra -Wpointer-arith -Werror -fPIC -O3 -D_REENTRANT -D_GNU_SOURCE
LDFLAGS=-shared -fPIC
export LUA_CPATH=$(PWD)/?.so
default: all
all: template.so
template.so: template.o table.o list.o
gcc $(LDFLAGS) -o template.so template.o table.o list.o
template.o: src/template.h src/template.c src/table.h src/list.h
gcc -c -o template.o $(CFLAGS) -I$(LUA_INCDIR) src/template.c
table.o: src/table.h src/table.c
gcc -c -o table.o $(CFLAGS) -I$(LUA_INCDIR) src/table.c
list.o: src/list.h src/list.c
gcc -c -o list.o $(CFLAGS) -I$(LUA_INCDIR) src/list.c
.PHONY: test
test:
$(LUA_BIN) test/test.lua
install:
cp template.so $(LIBDIR)
clean:
-rm -f template.o table.o list.o template.so