setup.py
author Catarina Boucinha <ccb@fe.up.pt>
Thu, 27 Aug 2009 16:06:46 +0100
changeset 202 da1a8186f86f
parent 104 340b858bf93e
permissions -rwxr-xr-x
Initial (very rough) version of semantic checker (stage3)
103
c4488f56aca1 add setup.py to build windows installer
greg
parents:
diff changeset
     1
import os,sys
c4488f56aca1 add setup.py to build windows installer
greg
parents:
diff changeset
     2
from distutils.core import setup
c4488f56aca1 add setup.py to build windows installer
greg
parents:
diff changeset
     3
c4488f56aca1 add setup.py to build windows installer
greg
parents:
diff changeset
     4
install_dir=os.path.join("LOLITech","matiec")
c4488f56aca1 add setup.py to build windows installer
greg
parents:
diff changeset
     5
c4488f56aca1 add setup.py to build windows installer
greg
parents:
diff changeset
     6
data_files=[]
c4488f56aca1 add setup.py to build windows installer
greg
parents:
diff changeset
     7
os.getcwd()
c4488f56aca1 add setup.py to build windows installer
greg
parents:
diff changeset
     8
os.chdir(os.getcwd())
c4488f56aca1 add setup.py to build windows installer
greg
parents:
diff changeset
     9
c4488f56aca1 add setup.py to build windows installer
greg
parents:
diff changeset
    10
def generate(base_dir):
c4488f56aca1 add setup.py to build windows installer
greg
parents:
diff changeset
    11
    listfile=[]
c4488f56aca1 add setup.py to build windows installer
greg
parents:
diff changeset
    12
    if base_dir == "":
c4488f56aca1 add setup.py to build windows installer
greg
parents:
diff changeset
    13
        directory = "."
c4488f56aca1 add setup.py to build windows installer
greg
parents:
diff changeset
    14
    else:
c4488f56aca1 add setup.py to build windows installer
greg
parents:
diff changeset
    15
        directory = base_dir
c4488f56aca1 add setup.py to build windows installer
greg
parents:
diff changeset
    16
    data_files.append((os.path.join(install_dir, base_dir), listfile))
c4488f56aca1 add setup.py to build windows installer
greg
parents:
diff changeset
    17
c4488f56aca1 add setup.py to build windows installer
greg
parents:
diff changeset
    18
    for element in os.listdir(directory):
c4488f56aca1 add setup.py to build windows installer
greg
parents:
diff changeset
    19
        element_path=os.path.join(base_dir, element)
c4488f56aca1 add setup.py to build windows installer
greg
parents:
diff changeset
    20
        if os.path.isdir(element_path):
104
340b858bf93e changes in setup.py to filter "exe" files and the and the "lib" directory
greg
parents: 103
diff changeset
    21
            basename_element=os.path.basename(element_path)
340b858bf93e changes in setup.py to filter "exe" files and the and the "lib" directory
greg
parents: 103
diff changeset
    22
            if basename_element == "lib":
340b858bf93e changes in setup.py to filter "exe" files and the and the "lib" directory
greg
parents: 103
diff changeset
    23
                generate(element_path)
103
c4488f56aca1 add setup.py to build windows installer
greg
parents:
diff changeset
    24
        elif os.path.isfile(element_path):
104
340b858bf93e changes in setup.py to filter "exe" files and the and the "lib" directory
greg
parents: 103
diff changeset
    25
            ext_element=os.path.splitext(element)
340b858bf93e changes in setup.py to filter "exe" files and the and the "lib" directory
greg
parents: 103
diff changeset
    26
            if ext_element[1] == ".exe" or ext_element[1] == ".h" or ext_element[1] == ".txt" or ext_element[1] == ".c":
340b858bf93e changes in setup.py to filter "exe" files and the and the "lib" directory
greg
parents: 103
diff changeset
    27
                listfile.append(element_path)
103
c4488f56aca1 add setup.py to build windows installer
greg
parents:
diff changeset
    28
c4488f56aca1 add setup.py to build windows installer
greg
parents:
diff changeset
    29
generate("")
c4488f56aca1 add setup.py to build windows installer
greg
parents:
diff changeset
    30
c4488f56aca1 add setup.py to build windows installer
greg
parents:
diff changeset
    31
setup(name='MatIEC',
c4488f56aca1 add setup.py to build windows installer
greg
parents:
diff changeset
    32
      version='0.1',
c4488f56aca1 add setup.py to build windows installer
greg
parents:
diff changeset
    33
      description='IEC to C Compiler',
c4488f56aca1 add setup.py to build windows installer
greg
parents:
diff changeset
    34
      author='Mario de Sousa, Edouard Tisserant, Laurent Bessard',
c4488f56aca1 add setup.py to build windows installer
greg
parents:
diff changeset
    35
      author_email='edouard.tisserant@lolitech.fr,laurent.bessard@lolitech.fr,gregory.trelat@lolitech.fr',
c4488f56aca1 add setup.py to build windows installer
greg
parents:
diff changeset
    36
      url='http://www.beremiz.org',
c4488f56aca1 add setup.py to build windows installer
greg
parents:
diff changeset
    37
      license='GPL',
c4488f56aca1 add setup.py to build windows installer
greg
parents:
diff changeset
    38
      data_files=data_files, # Add files to install
c4488f56aca1 add setup.py to build windows installer
greg
parents:
diff changeset
    39
)