summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorJoshua Haberman <joshua@reverberate.org>2010-07-18 22:45:15 -0700
committerJoshua Haberman <joshua@reverberate.org>2010-07-18 22:45:15 -0700
commit5871ed0d02ff69b20b65f577dd3be18a2e92dec7 (patch)
tree72f3d51fdf0a42e9cf3b5303b8fee7833fce2a1c /Makefile
parent4b6c8b6b2317436ab77b38e17b49a7c7b03bf3f4 (diff)
First go at Lua bindings.
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile10
1 files changed, 10 insertions, 0 deletions
diff --git a/Makefile b/Makefile
index 10ef96d..749c5a7 100644
--- a/Makefile
+++ b/Makefile
@@ -30,6 +30,13 @@ CFLAGS=-std=c99
INCLUDE=-Idescriptor -Icore -Itests -Istream -I.
CPPFLAGS=-Wall -Wextra -g $(INCLUDE) $(strip $(shell test -f perf-cppflags && cat perf-cppflags))
LDLIBS=-lpthread
+ifeq ($(shell uname), Darwin)
+ CPPFLAGS += -I/usr/include/lua5.1
+ LDFLAGS += -L/usr/local/lib -llua
+else
+ CFLAGS += $(strip $(shell pkg-config --silence-errors --cflags lua || pkg-config --cflags lua5.1))
+ LDFLAGS += $(strip $(shell pkg-config --silence-errors --libs lua || pkg-config --libs lua5.1))
+endif
LIBUPB=core/libupb.a
LIBUPB_PIC=core/libupb_pic.a
@@ -59,6 +66,9 @@ core/upb_def.o: core/upb_def.c
core/upb_def.lo: core/upb_def.c
$(CC) $(CFLAGS) $(CPPFLAGS) -Os -c -o $@ $< -fPIC
+lang_ext/lua/upb.so: lang_ext/lua/upb.lo
+ $(CC) $(CFLAGS) $(CPPFLAGS) -shared -o $@ $< core/libupb_pic.a
+
STATICOBJ=$(patsubst %.c,%.o,$(SRC))
SHAREDOBJ=$(patsubst %.c,%.lo,$(SRC))
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback