[GRASS-SVN] r33927 - in grass/trunk/swig/python: . NumPtr
svn_grass at osgeo.org
svn_grass at osgeo.org
Sat Oct 18 07:14:18 EDT 2008
Author: glynn
Date: 2008-10-18 07:14:18 -0400 (Sat, 18 Oct 2008)
New Revision: 33927
Modified:
grass/trunk/swig/python/Makefile
grass/trunk/swig/python/NumPtr/Makefile
grass/trunk/swig/python/my_typemaps.i
Log:
Fix "%typemap(out) char **"
Generalise build rules
List my_typemaps.i and renames.i as dependencies for %_wrap.c
Discard output when running test.py to byte-compile modules
Modified: grass/trunk/swig/python/Makefile
===================================================================
--- grass/trunk/swig/python/Makefile 2008-10-17 16:37:26 UTC (rev 33926)
+++ grass/trunk/swig/python/Makefile 2008-10-18 11:14:18 UTC (rev 33927)
@@ -14,16 +14,16 @@
default: _$(LIB_NAME).so numptr
-$(LIB_NAME)_wrap.c: $(LIB_NAME).i
+%_wrap.c: %.i my_typemaps.i renames.i
$(SWIG) $(ARCH_INC) -python -shadow $<
-$(LIB_NAME)_wrap.o: $(LIB_NAME)_wrap.c
+%_wrap.o: %_wrap.c
$(CC) $(CFLAGS) $(INCLUDE_DIRS) $<
-_$(LIB_NAME).so: $(LIB_NAME)_wrap.o
- $(LD) $(LDFLAGS) $< -o _$(LIB_NAME).so
+_%.so: %_wrap.o
+ $(LD) $(LDFLAGS) $< -o $@
# build bytecode .pyc file; ignore undefined symbol error
- echo "import $(LIB_NAME)" | python; true
+ echo "import $*" | python; true
numptr:
$(MAKE) -C NumPtr
Modified: grass/trunk/swig/python/NumPtr/Makefile
===================================================================
--- grass/trunk/swig/python/NumPtr/Makefile 2008-10-17 16:37:26 UTC (rev 33926)
+++ grass/trunk/swig/python/NumPtr/Makefile 2008-10-18 11:14:18 UTC (rev 33927)
@@ -5,7 +5,7 @@
numptr:
python setup.py build --build-lib build/lib
# build bytecode .pyc file
- python build/lib/test.py
+ python build/lib/test.py >& /dev/null
clean:
-rm -rf build/
Modified: grass/trunk/swig/python/my_typemaps.i
===================================================================
--- grass/trunk/swig/python/my_typemaps.i 2008-10-17 16:37:26 UTC (rev 33926)
+++ grass/trunk/swig/python/my_typemaps.i 2008-10-18 11:14:18 UTC (rev 33927)
@@ -33,7 +33,7 @@
for(i=0;i<len;i++) {
stringobject=PyString_FromString($1[i]);
if(!stringobject) return NULL;
- PyList_SetItem($1,i,stringobject);
+ PyList_SetItem($result,i,stringobject);
}
// G_free_list($1);
}
More information about the grass-commit
mailing list