1
0
Fork 0
nix-overlay/patches/liblpeg-makefile.patch

52 lines
1 KiB
Diff
Raw Normal View History

2023-05-03 15:16:35 +00:00
--- a/makefile 2019-03-11 15:08:29
+++ b/makefile 2023-05-03 17:12:18
@@ -1,30 +1,7 @@
+.DEFAULT_GOAL := macosx
+
LIBNAME = lpeg
-LUADIR = ../lua/
-COPT = -O2 -DNDEBUG
-# COPT = -g
-
-CWARNS = -Wall -Wextra -pedantic \
- -Waggregate-return \
- -Wcast-align \
- -Wcast-qual \
- -Wdisabled-optimization \
- -Wpointer-arith \
- -Wshadow \
- -Wsign-compare \
- -Wundef \
- -Wwrite-strings \
- -Wbad-function-cast \
- -Wdeclaration-after-statement \
- -Wmissing-prototypes \
- -Wnested-externs \
- -Wstrict-prototypes \
-# -Wunreachable-code \
-
-
-CFLAGS = $(CWARNS) $(COPT) -std=c99 -I$(LUADIR) -fPIC
-CC = gcc
-
FILES = lpvm.o lpcap.o lptree.o lpcode.o lpprint.o
# For Linux
@@ -33,11 +10,14 @@ macosx:
# For Mac OS
macosx:
- $(MAKE) lpeg.so "DLLFLAGS = -bundle -undefined dynamic_lookup"
+ $(MAKE) lpeg.dylib "DLLFLAGS = -dynamiclib -undefined dynamic_lookup"
lpeg.so: $(FILES)
env $(CC) $(DLLFLAGS) $(FILES) -o lpeg.so
+lpeg.dylib: $(FILES)
+ env $(CC) $(DLLFLAGS) $(FILES) -o lpeg.dylib
+
$(FILES): makefile
test: test.lua re.lua lpeg.so