[GRASS-SVN] r42274 - grass/trunk/lib/python/ctypes

svn_grass at osgeo.org svn_grass at osgeo.org
Mon May 17 17:44:14 EDT 2010


Author: glynn
Date: 2010-05-17 17:44:13 -0400 (Mon, 17 May 2010)
New Revision: 42274

Modified:
   grass/trunk/lib/python/ctypes/Makefile
Log:
Move ctypesgen boilerplate to common module
Add wrappers for ogsf, nviz libraries


Modified: grass/trunk/lib/python/ctypes/Makefile
===================================================================
--- grass/trunk/lib/python/ctypes/Makefile	2010-05-17 21:05:05 UTC (rev 42273)
+++ grass/trunk/lib/python/ctypes/Makefile	2010-05-17 21:44:13 UTC (rev 42274)
@@ -10,7 +10,7 @@
 DOXINPUT=grasspython.dox
 
 MODULES = date grass raster gmath proj imagery vector display stats \
-	dbmi g3d arraystats cluster trans vedit
+	dbmi g3d arraystats cluster trans vedit ogsf nviz
 
 date_LIBS       = $(DATETIMELIB)
 grass_LIBS      = $(GISLIB)
@@ -27,6 +27,8 @@
 cluster_LIBS    = $(CLUSTERLIB)
 trans_LIBS      = $(TRANSLIB)
 vedit_LIBS      = $(VEDITLIB)
+ogsf_LIBS       = $(OGSFLIB)
+nviz_LIBS       = $(NVIZLIB)
 
 date_INC        = datetime.h P_datetime.h
 grass_INC       = gis.h gisdefs.h
@@ -43,10 +45,14 @@
 cluster_INC     = cluster.h
 trans_INC       = transform.h
 vedit_INC       = vedit.h
+ogsf_INC	= ogsf_proto.h gstypes.h gsurf.h kftypes.h keyframe.h
+nviz_INC        = nviz.h
 
-CTYPESFLAGS = $(INC) $(LIBPATH)
-EXTRA_CLEAN_FILES := $(foreach M,$(MODULES),$(M).pyc $(M).py)
+SED = sed
 
+CTYPESFLAGS = $(INC)
+EXTRA_CLEAN_FILES := $(foreach M,$(MODULES),$(M).py) ctypesheader.py
+
 ifneq ($(MINGW),)
 EXTRA_LIBS = $(INTLLIB)
 endif
@@ -57,8 +63,8 @@
 GDIR = $(PYDIR)/grass
 DSTDIR = $(GDIR)/lib
 
-PYFILES  := $(patsubst %,$(DSTDIR)/%.py,$(MODULES) __init__)
-PYCFILES  := $(patsubst %,$(DSTDIR)/%.pyc,$(MODULES) __init__)
+PYFILES  := $(patsubst %,$(DSTDIR)/%.py,$(MODULES) __init__ ctypesheader)
+PYCFILES  := $(patsubst %,$(DSTDIR)/%.pyc,$(MODULES) __init__ ctypesheader)
 LPYFILES := $(patsubst %,%.py,$(MODULES))
 
 ifneq ($(strip $(CTYPESGEN)),)
@@ -68,11 +74,27 @@
 endif
 
 $(DSTDIR)/%.py: %.py | $(DSTDIR)
-	$(INSTALL_DATA) $< $@
+	$(SED) \
+	-e '/^# End loader$$/a\
+	from ctypesheader import *\
+	from ctypesheader import _variadic_function' \
+	-e '/^# Begin preamble$$/,/^# End preamble$$/d' \
+	-e '/^# Begin loader$$/,/^# End loader$$/d' \
+	$< > $@
+#	$(INSTALL_DATA) $< $@
 
 %.py: $(%_INC) $(%_LIBS)
 	$(CTYPESGEN) $(CTYPESFLAGS) $($*_LIBS) $(EXTRA_LIBS) $(patsubst %.h,$(ARCH_INCDIR)/%.h,$($*_INC)) -o $@
 
+$(DSTDIR)/ctypesheader.py: ctypesheader.py | $(DSTDIR)
+	$(INSTALL_DATA) $< $@
+
+ctypesheader.py: grass.py
+	$(SED) -n \
+	-e '/^# Begin preamble$$/,/^# End preamble$$/p' \
+	-e '/^# Begin loader$$/,/^# End loader$$/p' \
+	$< > $@
+
 $(PYDIR):
 	$(MKDIR) $@
 



More information about the grass-commit mailing list