tubular

lpeg makefile

May 3rd, 2012
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Make 0.83 KB | None | 0 0
  1. LIBNAME = lpeg
  2. LUADIR = /usr/include/lua5.1/
  3.  
  4. COPT = -O2 -DNDEBUG
  5.  
  6. CWARNS = -Wall -Wextra -pedantic \
  7.         -Waggregate-return \
  8.     -Wbad-function-cast \
  9.         -Wcast-align \
  10.         -Wcast-qual \
  11.     -Wdeclaration-after-statement \
  12.     -Wdisabled-optimization \
  13.         -Wmissing-prototypes \
  14.         -Wnested-externs \
  15.         -Wpointer-arith \
  16.         -Wshadow \
  17.     -Wsign-compare \
  18.     -Wstrict-prototypes \
  19.     -Wundef \
  20.         -Wwrite-strings \
  21.     #  -Wunreachable-code \
  22.  
  23.  
  24. CFLAGS = $(CWARNS) $(COPT) -ansi -I$(LUADIR)
  25. CC = gcc
  26.  
  27. # For Linux
  28. DLLFLAGS = -shared -fpic
  29. ENV =
  30.  
  31. # For Mac OS
  32. # ENV = MACOSX_DEPLOYMENT_TARGET=10.4
  33. # DLLFLAGS = -bundle -undefined dynamic_lookup
  34.  
  35. lpeg.so: lpeg.o
  36.     env $(ENV) $(CC) $(DLLFLAGS) lpeg.o -o lpeg.so
  37.  
  38. lpeg.o:     makefile lpeg.c lpeg.h
  39.  
  40. test: test.lua re.lua lpeg.so
  41.     test.lua
Advertisement
Add Comment
Please, Sign In to add comment