summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorJoshua Haberman <joshua@reverberate.org>2011-02-15 09:07:27 -0800
committerJoshua Haberman <joshua@reverberate.org>2011-02-15 09:07:27 -0800
commit3cfe887c40bab843bd7a4ee268262f82dbe7c38b (patch)
treef4fb492a2dbf9f0ba70727cb2af5183cd178f7da /Makefile
parent7af638ff2d1ed136e47c0db4b62d2d0be920bb0b (diff)
Fixes for building Lua extension.
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile11
1 files changed, 6 insertions, 5 deletions
diff --git a/Makefile b/Makefile
index 00905d7..749ba4c 100644
--- a/Makefile
+++ b/Makefile
@@ -96,6 +96,7 @@ clean:
rm -rf $(TESTS) tests/t.*
rm -rf src/descriptor.pb
rm -rf src/upbc deps
+ rm -rf lang_ext/lua/upb.so
cd lang_ext/python && python setup.py clean --all
# Core library (libupb.a).
@@ -317,15 +318,15 @@ benchmarks/b.parsetostruct_googlemessage2.proto2_compiled: \
# Lua extension ##################################################################
ifeq ($(shell uname), Darwin)
- CPPFLAGS += -I/usr/include/lua5.1
- LDFLAGS += -L/usr/local/lib -llua
+ LUA_CPPFLAGS = -I/usr/include/lua5.1
+ LUA_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))
+ LUA_CPPFLAGS = $(strip $(shell pkg-config --silence-errors --cflags lua || pkg-config --cflags lua5.1))
+ LUA_LDFLAGS = $(strip $(shell pkg-config --silence-errors --libs lua || pkg-config --libs lua5.1))
endif
LUAEXT=lang_ext/lua/upb.so
lua: $(LUAEXT)
lang_ext/lua/upb.so: lang_ext/lua/upb.lo $(LIBUPB_PIC)
@echo CC lang_ext/lua/upb.c
- @$(CC) $(CFLAGS) $(CPPFLAGS) -shared -o $@ $< src/libupb_pic.a
+ @$(CC) $(CFLAGS) $(CPPFLAGS) $(LUA_CPPFLAGS) -fpic -shared -o $@ $< src/libupb_pic.a $(LUA_LDFLAGS)
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback