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 41 42
|
LIBNAME = lpeg
LUADIR = /usr/include/lua5.1/
COPT = -O2 -DNDEBUG
CWARNS = -Wall -Wextra -pedantic \
-Waggregate-return \
-Wbad-function-cast \
-Wcast-align \
-Wcast-qual \
-Wdeclaration-after-statement \
-Wdisabled-optimization \
-Wmissing-prototypes \
-Wnested-externs \
-Wpointer-arith \
-Wshadow \
-Wsign-compare \
-Wstrict-prototypes \
-Wundef \
-Wwrite-strings \
# -Wunreachable-code \
CFLAGS = $(CWARNS) $(COPT) -ansi -I$(LUADIR)
CC = gcc
# For Linux
DLLFLAGS = -shared -fpic
ENV =
# For Mac OS
# ENV = MACOSX_DEPLOYMENT_TARGET=10.4
# DLLFLAGS = -bundle -undefined dynamic_lookup
lpeg.so: lpeg.o
env $(ENV) $(CC) $(DLLFLAGS) lpeg.o -o lpeg.so
lpeg.o: makefile lpeg.c lpeg.h
test: test.lua re.lua lpeg.so
test.lua
|