[GRASS-SVN] r33482 - in grass/trunk/swig/python: . NumPtr NumPtr/src

svn_grass at osgeo.org svn_grass at osgeo.org
Wed Sep 17 04:22:27 EDT 2008


Author: hamish
Date: 2008-09-17 04:22:27 -0400 (Wed, 17 Sep 2008)
New Revision: 33482

Modified:
   grass/trunk/swig/python/Makefile
   grass/trunk/swig/python/NumPtr/Makefile
   grass/trunk/swig/python/NumPtr/README.GRASS
   grass/trunk/swig/python/NumPtr/src/Makefile
Log:
clean clean; rm needs -f in case setup.pyc isn't there
build bytecode .pyc files
 (merge from devbr6)


Modified: grass/trunk/swig/python/Makefile
===================================================================
--- grass/trunk/swig/python/Makefile	2008-09-17 08:06:47 UTC (rev 33481)
+++ grass/trunk/swig/python/Makefile	2008-09-17 08:22:27 UTC (rev 33482)
@@ -6,10 +6,8 @@
 LIB_NAME = python_grass7
 
 CFLAGS=-c -fpic -I. $(ARCH_INC) $(GDALCFLAGS) $(PYTHONCFLAGS)
-
 LDFLAGS=-shared -L$(ARCH_LIBDIR) $(GDALLIBS) $(PYTHONLDFLAGS) $(VECTLIB) $(IMAGERYLIB) $(GMATHLIB) $(GISLIB)
 
-#include $(MODULE_TOPDIR)/include/Make/Dir.make
 
 EXTRA_CLEAN_FILES = $(LIB_NAME)_wrap.o _$(LIB_NAME).so $(LIB_NAME)_wrap.c $(LIB_NAME).pyc $(LIB_NAME).py
 CLEAN_SUBDIRS = NumPtr
@@ -19,12 +17,13 @@
 $(LIB_NAME)_wrap.c: $(LIB_NAME).i
 	$(SWIG) $(ARCH_INC) -python -shadow $<
 
-
 $(LIB_NAME)_wrap.o: $(LIB_NAME)_wrap.c
 	$(CC) $(CFLAGS) $(INCLUDE_DIRS) $<
 
 _$(LIB_NAME).so: $(LIB_NAME)_wrap.o
 	$(LD) $(LDFLAGS) $< -o _$(LIB_NAME).so
+	# build bytecode .pyc file; ignore undefined symbol error
+	echo "import $(LIB_NAME)" | python; true
 
 numptr:
 	$(MAKE) -C NumPtr

Modified: grass/trunk/swig/python/NumPtr/Makefile
===================================================================
--- grass/trunk/swig/python/NumPtr/Makefile	2008-09-17 08:06:47 UTC (rev 33481)
+++ grass/trunk/swig/python/NumPtr/Makefile	2008-09-17 08:22:27 UTC (rev 33482)
@@ -3,9 +3,11 @@
 all: numptr
 
 numptr:
-	python setup.py build
-	#python build/lib.linux-i686-2.4/test.py
+	python setup.py build --build-lib build/lib
+	# build bytecode .pyc file
+	python build/lib/test.py
 
 clean:
 	-rm -rf build/
-	-rm setup.pyc src/NumPtr_wrap.c src/NumPtr.py
+	-rm -f setup.pyc
+	$(MAKE) -C src clean

Modified: grass/trunk/swig/python/NumPtr/README.GRASS
===================================================================
--- grass/trunk/swig/python/NumPtr/README.GRASS	2008-09-17 08:06:47 UTC (rev 33481)
+++ grass/trunk/swig/python/NumPtr/README.GRASS	2008-09-17 08:22:27 UTC (rev 33482)
@@ -48,13 +48,13 @@
 Modifications from the upstream tarball:
  * updated setup.py with current version number, upstream URL
  * removed old backup versions of a few files
- * removed binary lib/NumPtr.pyc. It will be automaticall regenerated (??)
+ * removed binary lib/NumPtr.pyc. It will be automatically regenerated
+ * update and GNUify src/Makefile (mostly unused)
  * added this file, VERSION file
 
 
 TODO:
- * incorporate the build into swig/python/Makefile, including byte-
-   compiling the .pyc file (by running build/lib.../test.py) and setting
+ * incorporate the build into swig/python/Makefile, including setting
    an appropriate install destination. (use "setup.py install" to do the
    install or use the common Makefile method for that?)
 

Modified: grass/trunk/swig/python/NumPtr/src/Makefile
===================================================================
--- grass/trunk/swig/python/NumPtr/src/Makefile	2008-09-17 08:06:47 UTC (rev 33481)
+++ grass/trunk/swig/python/NumPtr/src/Makefile	2008-09-17 08:22:27 UTC (rev 33482)
@@ -48,7 +48,7 @@
 	$(CC) -c -I$(PYTHONINC) -o $(name)_wrap.o $(name)_wrap.c
 
 clean:
-	rm -f $(OBJ) *.so *_wrap.* *.pyc *_lib.*
+	rm -f $(OBJ) *.so *_wrap.* *.pyc *_lib.* $(name).py
 
 test:
 	python test.py



More information about the grass-commit mailing list