diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2019-02-20 10:13:46 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2019-02-20 10:13:46 -0300 |
commit | e08e5df853560de6482d84066a7accc6a18de545 (patch) | |
tree | ee19686bb35da90709a32ed24bf7855de1a3946a /makefile | |
download | lpeg-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-- | makefile | 55 |
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 @@ | |||
1 | LIBNAME = lpeg | ||
2 | LUADIR = ../lua/ | ||
3 | |||
4 | # COPT = -O2 -DNDEBUG | ||
5 | COPT = -g | ||
6 | |||
7 | CWARNS = -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 | |||
25 | CFLAGS = $(CWARNS) $(COPT) -std=c99 -I$(LUADIR) -fPIC | ||
26 | CC = gcc | ||
27 | |||
28 | FILES = lpvm.o lpcap.o lptree.o lpcode.o lpprint.o | ||
29 | |||
30 | # For Linux | ||
31 | linux: | ||
32 | make lpeg.so "DLLFLAGS = -shared -fPIC" | ||
33 | |||
34 | # For Mac OS | ||
35 | macosx: | ||
36 | make lpeg.so "DLLFLAGS = -bundle -undefined dynamic_lookup" | ||
37 | |||
38 | lpeg.so: $(FILES) | ||
39 | env $(CC) $(DLLFLAGS) $(FILES) -o lpeg.so | ||
40 | |||
41 | $(FILES): makefile | ||
42 | |||
43 | test: test.lua re.lua lpeg.so | ||
44 | ./test.lua | ||
45 | |||
46 | clean: | ||
47 | rm -f $(FILES) lpeg.so | ||
48 | |||
49 | |||
50 | lpcap.o: lpcap.c lpcap.h lptypes.h | ||
51 | lpcode.o: lpcode.c lptypes.h lpcode.h lptree.h lpvm.h lpcap.h | ||
52 | lpprint.o: lpprint.c lptypes.h lpprint.h lptree.h lpvm.h lpcap.h | ||
53 | lptree.o: lptree.c lptypes.h lpcap.h lpcode.h lptree.h lpvm.h lpprint.h | ||
54 | lpvm.o: lpvm.c lpcap.h lptypes.h lpvm.h lpprint.h lptree.h | ||
55 | |||