summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Cournapeau <cournape@gmail.com>2008-01-06 12:19:35 +0000
committerDavid Cournapeau <cournape@gmail.com>2008-01-06 12:19:35 +0000
commite68d581be46ca4bf36c7a3103b18fa46585d2fde (patch)
treee8180555ea5dbbaa6d76e9873de152278f5f5d37
parentf1b0e0c887f9d584638edde22c82879b94e96bd0 (diff)
downloadnumpy-e68d581be46ca4bf36c7a3103b18fa46585d2fde.tar.gz
Modify ufunc api generator to be compatible with scons builder
-rw-r--r--numpy/core/code_generators/generate_ufunc_api.py31
1 files changed, 20 insertions, 11 deletions
diff --git a/numpy/core/code_generators/generate_ufunc_api.py b/numpy/core/code_generators/generate_ufunc_api.py
index 96bb47cae..fa858b207 100644
--- a/numpy/core/code_generators/generate_ufunc_api.py
+++ b/numpy/core/code_generators/generate_ufunc_api.py
@@ -1,8 +1,6 @@
import os
import genapi
-UFUNC_API_ORDER = 'ufunc_api_order.txt'
-
h_template = r"""
#ifdef _UMATHMODULE
@@ -72,17 +70,28 @@ void *PyUFunc_API[] = {
"""
def generate_api(output_dir, force=False):
- header_file = os.path.join(output_dir, '__ufunc_api.h')
- c_file = os.path.join(output_dir, '__ufunc_api.c')
- doc_file = os.path.join(output_dir, 'ufunc_api.txt')
-
- targets = (header_file, c_file, doc_file)
- if (not force
- and not genapi.should_rebuild(targets,
- [UFUNC_API_ORDER, __file__])):
+ basename = 'ufunc_api'
+
+ h_file = os.path.join(output_dir, '__%s.h' % basename)
+ c_file = os.path.join(output_dir, '__%s.c' % basename)
+ d_file = os.path.join(output_dir, '%s.txt' % basename)
+ targets = (h_file, c_file, d_file)
+
+ sources = ['ufunc_api_order.txt']
+
+ if (not force and not genapi.should_rebuild(targets, sources + [__file__])):
return targets
+ else:
+ do_generate_api(targets, sources)
+
+ return targets
+
+def do_generate_api(targets, sources):
+ header_file = targets[0]
+ c_file = targets[1]
+ doc_file = targets[2]
- ufunc_api_list = genapi.get_api_functions('UFUNC_API', UFUNC_API_ORDER)
+ ufunc_api_list = genapi.get_api_functions('UFUNC_API', sources[0])
# API fixes for __arrayobject_api.h