diff --git a/src/Makefile b/src/Makefile index 8fb2226..465e7bc 100644 --- a/src/Makefile +++ b/src/Makefile @@ -1,5 +1,14 @@ -default: $(wildcard %.py) +PYTHON=python +PYVERSION=$(shell $(PYTHON) -c "import sys; print(sys.version[:3])") + +irpf90.exe: irpf90.so + gcc build/*/irpf90.o -L/usr/lib -lpython$(PYVERSION) -o irpf90.exe + +irpf90.so : $(wildcard %.py) irpf90.c ./cython_setup.py build_ext --inplace +irpf90.c: irpf90.py + cython --embed irpf90.py + clean: rm *.c *.so *.pyc 2>/dev/null diff --git a/src/command_line.py b/src/command_line.py index 0c0052b..bae1b02 100644 --- a/src/command_line.py +++ b/src/command_line.py @@ -179,7 +179,7 @@ do_$LONG = property(fget=do_$LONG) """ for short in options: long = options[short][0] - exec t.replace("$LONG",long).replace("$SHORT",short) + exec t.replace("$LONG",long).replace("$SHORT",short) #in locals() def do_run(self): if '_do_run' not in self.__dict__: diff --git a/src/cython_setup.py b/src/cython_setup.py index 4925a95..f50de79 100755 --- a/src/cython_setup.py +++ b/src/cython_setup.py @@ -4,7 +4,7 @@ from distutils.extension import Extension from Cython.Distutils import build_ext import os -to_remove = """cython_setup.py command_line.py irpf90.py""".split() +to_remove = """cython_setup.py command_line.py""".split() ext_modules = [] files = os.listdir('.') @@ -16,7 +16,6 @@ for file in files: module = file.split('.')[0] ext_modules += [ Extension(module,[file]) ] - setup( name = 'IRPF90 extensions', cmdclass = {'build_ext': build_ext}, @@ -24,3 +23,5 @@ setup( ) + + diff --git a/src/irpf90.py b/src/irpf90.py index 1bf4501..4cc43c1 100644 --- a/src/irpf90.py +++ b/src/irpf90.py @@ -28,9 +28,12 @@ import vim import os,sys -wd = os.path.abspath(os.path.dirname(__file__)) +try: + wd = os.path.abspath(os.path.dirname(__file__)) + sys.path.insert(0,(wd+"/../src/")) +except: + pass sys.setcheckinterval(1000) -sys.path.insert(0,(wd+"/../src/")) def main(): from command_line import command_line diff --git a/src/version.py b/src/version.py index 414119a..cc35df9 100644 --- a/src/version.py +++ b/src/version.py @@ -1 +1 @@ -version = "1.2.9" +version = "1.2.10"