|
Packit |
909456 |
LIBNAME = lpeg
|
|
Packit |
909456 |
LUADIR = ../lua/
|
|
Packit |
909456 |
|
|
Packit |
909456 |
COPT = -O2
|
|
Packit |
909456 |
# COPT = -DLPEG_DEBUG -g
|
|
Packit |
909456 |
|
|
Packit |
909456 |
CWARNS = -Wall -Wextra -pedantic \
|
|
Packit |
909456 |
-Waggregate-return \
|
|
Packit |
909456 |
-Wcast-align \
|
|
Packit |
909456 |
-Wcast-qual \
|
|
Packit |
909456 |
-Wdisabled-optimization \
|
|
Packit |
909456 |
-Wpointer-arith \
|
|
Packit |
909456 |
-Wshadow \
|
|
Packit |
909456 |
-Wsign-compare \
|
|
Packit |
909456 |
-Wundef \
|
|
Packit |
909456 |
-Wwrite-strings \
|
|
Packit |
909456 |
-Wbad-function-cast \
|
|
Packit |
909456 |
-Wdeclaration-after-statement \
|
|
Packit |
909456 |
-Wmissing-prototypes \
|
|
Packit |
909456 |
-Wnested-externs \
|
|
Packit |
909456 |
-Wstrict-prototypes \
|
|
Packit |
909456 |
# -Wunreachable-code \
|
|
Packit |
909456 |
|
|
Packit |
909456 |
|
|
Packit |
909456 |
CFLAGS = $(CWARNS) $(COPT) -std=c99 -I$(LUADIR) -fPIC
|
|
Packit |
909456 |
CC = gcc
|
|
Packit |
909456 |
|
|
Packit |
909456 |
FILES = lpvm.o lpcap.o lptree.o lpcode.o lpprint.o
|
|
Packit |
909456 |
|
|
Packit |
909456 |
# For Linux
|
|
Packit |
909456 |
linux:
|
|
Packit Service |
eb2ca5 |
make lpeg.so "DLLFLAGS = -shared -fPIC -Wl,-z,now"
|
|
Packit |
909456 |
|
|
Packit |
909456 |
# For Mac OS
|
|
Packit |
909456 |
macosx:
|
|
Packit |
909456 |
make lpeg.so "DLLFLAGS = -bundle -undefined dynamic_lookup"
|
|
Packit |
909456 |
|
|
Packit |
909456 |
lpeg.so: $(FILES)
|
|
Packit |
909456 |
env $(CC) $(DLLFLAGS) $(FILES) -o lpeg.so
|
|
Packit |
909456 |
|
|
Packit |
909456 |
$(FILES): makefile
|
|
Packit |
909456 |
|
|
Packit |
909456 |
test: test.lua re.lua lpeg.so
|
|
Packit |
909456 |
./test.lua
|
|
Packit |
909456 |
|
|
Packit |
909456 |
clean:
|
|
Packit |
909456 |
rm -f $(FILES) lpeg.so
|
|
Packit |
909456 |
|
|
Packit |
909456 |
|
|
Packit |
909456 |
lpcap.o: lpcap.c lpcap.h lptypes.h
|
|
Packit |
909456 |
lpcode.o: lpcode.c lptypes.h lpcode.h lptree.h lpvm.h lpcap.h
|
|
Packit |
909456 |
lpprint.o: lpprint.c lptypes.h lpprint.h lptree.h lpvm.h lpcap.h
|
|
Packit |
909456 |
lptree.o: lptree.c lptypes.h lpcap.h lpcode.h lptree.h lpvm.h lpprint.h
|
|
Packit |
909456 |
lpvm.o: lpvm.c lpcap.h lptypes.h lpvm.h lpprint.h lptree.h
|
|
Packit |
909456 |
|