aboutsummaryrefslogtreecommitdiffstats
path: root/community/lua-lpeg/build-static-lib.patch
blob: d109ae52c04b6c0b2ba21f0a8db370c6aafa8deb (plain)
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
--- a/makefile
+++ b/makefile
@@ -24,12 +24,15 @@
 
 CFLAGS = $(CWARNS) $(COPT) -std=c99 -I$(LUADIR) -fPIC
 CC = gcc
+AR = ar
+RANLIB = ranlib
 
 FILES = lpvm.o lpcap.o lptree.o lpcode.o lpprint.o
 
 # For Linux
 linux:
 	make lpeg.so "DLLFLAGS = -shared -fPIC"
+	make lpeg.a
 
 # For Mac OS
 macosx:
@@ -37,6 +40,10 @@
 
 lpeg.so: $(FILES)
 	env $(CC) $(DLLFLAGS) $(FILES) -o lpeg.so
+
+lpeg.a: $(FILES)
+	env $(AR) rc lpeg.a $(FILES)
+	env $(RANLIB) lpeg.a
 
 $(FILES): makefile