summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
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