aboutsummaryrefslogtreecommitdiff
path: root/makefile
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2019-02-20 10:13:46 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2019-02-20 10:13:46 -0300
commite08e5df853560de6482d84066a7accc6a18de545 (patch)
treeee19686bb35da90709a32ed24bf7855de1a3946a /makefile
downloadlpeg-e08e5df853560de6482d84066a7accc6a18de545.tar.gz
lpeg-e08e5df853560de6482d84066a7accc6a18de545.tar.bz2
lpeg-e08e5df853560de6482d84066a7accc6a18de545.zip
Fist version of LPeg on GIT
LPeg repository is being moved to git. Past versions won't be moved; they are still available in RCS.
Diffstat (limited to 'makefile')
-rw-r--r--makefile55
1 files changed, 55 insertions, 0 deletions
diff --git a/makefile b/makefile
new file mode 100644
index 0000000..d803c12
--- /dev/null
+++ b/makefile
@@ -0,0 +1,55 @@
1LIBNAME = lpeg
2LUADIR = ../lua/
3
4# COPT = -O2 -DNDEBUG
5COPT = -g
6
7CWARNS = -Wall -Wextra -pedantic \
8 -Waggregate-return \
9 -Wcast-align \
10 -Wcast-qual \
11 -Wdisabled-optimization \
12 -Wpointer-arith \
13 -Wshadow \
14 -Wsign-compare \
15 -Wundef \
16 -Wwrite-strings \
17 -Wbad-function-cast \
18 -Wdeclaration-after-statement \
19 -Wmissing-prototypes \
20 -Wnested-externs \
21 -Wstrict-prototypes \
22# -Wunreachable-code \
23
24
25CFLAGS = $(CWARNS) $(COPT) -std=c99 -I$(LUADIR) -fPIC
26CC = gcc
27
28FILES = lpvm.o lpcap.o lptree.o lpcode.o lpprint.o
29
30# For Linux
31linux:
32 make lpeg.so "DLLFLAGS = -shared -fPIC"
33
34# For Mac OS
35macosx:
36 make lpeg.so "DLLFLAGS = -bundle -undefined dynamic_lookup"
37
38lpeg.so: $(FILES)
39 env $(CC) $(DLLFLAGS) $(FILES) -o lpeg.so
40
41$(FILES): makefile
42
43test: test.lua re.lua lpeg.so
44 ./test.lua
45
46clean:
47 rm -f $(FILES) lpeg.so
48
49
50lpcap.o: lpcap.c lpcap.h lptypes.h
51lpcode.o: lpcode.c lptypes.h lpcode.h lptree.h lpvm.h lpcap.h
52lpprint.o: lpprint.c lptypes.h lpprint.h lptree.h lpvm.h lpcap.h
53lptree.o: lptree.c lptypes.h lpcap.h lpcode.h lptree.h lpvm.h lpprint.h
54lpvm.o: lpvm.c lpcap.h lptypes.h lpvm.h lpprint.h lptree.h
55