blob: 788451813986e5e4c7ea4a74ad4b5b15a7ab488f [file] [log] [blame]
Christophe Favergeon53f828f2019-03-25 13:42:44 +01001from distutils.core import setup, Extension
2import glob
3import numpy
4import config
5import sys
6import os
7from config import ROOT
8
Christophe Favergeon9e284082019-05-23 09:08:30 +02009includes = [os.path.join(ROOT,"Include"),os.path.join("cmsisdsp_pkg","src")]
Christophe Favergeon53f828f2019-03-25 13:42:44 +010010
11if sys.platform == 'win32':
12 cflags = ["-DWIN",config.cflags,"-DUNALIGNED_SUPPORT_DISABLE"]
13 # Custom because a customized arm_math.h is required to build on windows
14 # since the visual compiler and the win platform are
15 # not supported by default in arm_math.h
16else:
17 cflags = ["-Wno-unused-variable","-Wno-implicit-function-declaration",config.cflags]
18
19transform = glob.glob(os.path.join(ROOT,"Source","TransformFunctions","*.c"))
Christophe Favergeon9e284082019-05-23 09:08:30 +020020#transform.remove(os.path.join(ROOT,"Source","TransformFunctions","arm_dct4_init_q15.c"))
21#transform.remove(os.path.join(ROOT,"Source","TransformFunctions","arm_rfft_init_q15.c"))
Christophe Favergeon53f828f2019-03-25 13:42:44 +010022transform.remove(os.path.join(ROOT,"Source","TransformFunctions","TransformFunctions.c"))
23
24support = glob.glob(os.path.join(ROOT,"Source","SupportFunctions","*.c"))
25support.remove(os.path.join(ROOT,"Source","SupportFunctions","SupportFunctions.c"))
26
27fastmath = glob.glob(os.path.join(ROOT,"Source","FastMathFunctions","*.c"))
28fastmath.remove(os.path.join(ROOT,"Source","FastMathFunctions","FastMathFunctions.c"))
29
30filtering = glob.glob(os.path.join(ROOT,"Source","FilteringFunctions","*.c"))
31filtering.remove(os.path.join(ROOT,"Source","FilteringFunctions","FilteringFunctions.c"))
32
33matrix = glob.glob(os.path.join(ROOT,"Source","MatrixFunctions","*.c"))
34matrix.remove(os.path.join(ROOT,"Source","MatrixFunctions","MatrixFunctions.c"))
35
36statistics = glob.glob(os.path.join(ROOT,"Source","StatisticsFunctions","*.c"))
37statistics.remove(os.path.join(ROOT,"Source","StatisticsFunctions","StatisticsFunctions.c"))
38
39complexf = glob.glob(os.path.join(ROOT,"Source","ComplexMathFunctions","*.c"))
40complexf.remove(os.path.join(ROOT,"Source","ComplexMathFunctions","ComplexMathFunctions.c"))
41
42basic = glob.glob(os.path.join(ROOT,"Source","BasicMathFunctions","*.c"))
43basic.remove(os.path.join(ROOT,"Source","BasicMathFunctions","BasicMathFunctions.c"))
44
45controller = glob.glob(os.path.join(ROOT,"Source","ControllerFunctions","*.c"))
46controller.remove(os.path.join(ROOT,"Source","ControllerFunctions","ControllerFunctions.c"))
47
Christophe Favergeon9e284082019-05-23 09:08:30 +020048common = glob.glob(os.path.join(ROOT,"Source","CommonTables","*.c"))
49common.remove(os.path.join(ROOT,"Source","CommonTables","CommonTables.c"))
Christophe Favergeon53f828f2019-03-25 13:42:44 +010050
Christophe Favergeon9e284082019-05-23 09:08:30 +020051#modulesrc = glob.glob(os.path.join("cmsisdsp_pkg","src","*.c"))
52modulesrc = []
53modulesrc.append(os.path.join("cmsisdsp_pkg","src","fftinit.c"))
54modulesrc.append(os.path.join("cmsisdsp_pkg","src","cmsismodule.c"))
Christophe Favergeon53f828f2019-03-25 13:42:44 +010055
56module1 = Extension(config.extensionName,
57 sources = (support
58 + fastmath
59 + filtering
60 + matrix
61 + statistics
62 + complexf
63 + basic
64 + controller
65 + transform
66 + modulesrc
Christophe Favergeon9e284082019-05-23 09:08:30 +020067 + common
Christophe Favergeon53f828f2019-03-25 13:42:44 +010068 )
69 ,
70 include_dirs = includes + [numpy.get_include()],
71 #extra_compile_args = ["-Wno-unused-variable","-Wno-implicit-function-declaration",config.cflags]
72 extra_compile_args = cflags
73 )
74
75setup (name = config.setupName,
76 version = '0.0.1',
77 description = config.setupDescription,
78 ext_modules = [module1],
79 author = 'Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved.',
80 url="https://github.com/ARM-software/CMSIS_5",
81 classifiers=[
82 "Programming Language :: Python",
83 "License :: OSI Approved :: Apache Software License",
84 "Operating System :: OS Independent",
85 ])