From a1bb3dc448bc313427fedb4c435763acb90853fc Mon Sep 17 00:00:00 2001 From: Joshua Haberman Date: Tue, 9 Aug 2011 23:41:09 -0700 Subject: Makefile target for running Python tests. --- Makefile | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 177a221..6fb994a 100644 --- a/Makefile +++ b/Makefile @@ -136,7 +136,7 @@ OBJ=$(patsubst %.c,%.o,$(SRC)) PICOBJ=$(patsubst %.c,%.lo,$(SRC)) ifneq (, $(findstring DUPB_USE_JIT_X64, $(USER_CFLAGS))) -upb/pb/decoder.o: upb/pb/decoder_x86.h +upb/pb/decoder.o upb/pb/decoder.lo: upb/pb/decoder_x86.h ifeq (, $(findstring DNDEBUG, $(USER_CFLAGS))) $(error "JIT only works with -DNDEBUG enabled!") endif @@ -197,10 +197,6 @@ descriptorgen: upb/descriptor.pb tools/upbc tools/upbc: tools/upbc.c $(LIBUPB) -# Language extensions. -python: $(LIBUPB_PIC) - cd lang_ext/python && python setup.py build - # Tests. ####################################################################### tests/test.proto.pb: tests/test.proto @@ -397,3 +393,15 @@ lua: $(LUAEXT) lang_ext/lua/upb.so: lang_ext/lua/upb.c $(LIBUPB_PIC) $(E) CC lang_ext/lua/upb.c $(Q) $(CC) $(CFLAGS) $(CPPFLAGS) $(LUA_CPPFLAGS) -fpic -shared -o $@ $< upb/libupb_pic.a $(LUA_LDFLAGS) + + +# Python extension ############################################################# + +PYTHONEXT=lang_ext/python/build/install/lib/python/upb/__init__.so +python: $(PYTHONEXT) +$(PYTHONEXT): $(LIBUPB_PIC) lang_ext/python/upb.c + $(E) PYTHON lang_ext/python/upb.c + $(Q) cd lang_ext/python && python setup.py build install --home=build/install + +pythontest: $(PYTHONEXT) + cd lang_ext/python && cp test.py build/install/lib/python && python ./build/install/lib/python/test.py -- cgit v1.2.3