| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent a376c3a commit 358ea50
5 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -6,26 +6,32 @@ | |||
| 6 | 6 | # make clean | |
| 7 | 7 | ||
| 8 | 8 | RELEASE = pythonnet-2.0-alpha3 | |
| 9 | + KEYFILE = pythonnet.key | ||
| 9 | 10 | ||
| 10 | 11 | PYTHON ?= python | |
| 11 | 12 | PYTHONVER ?= $(shell $(PYTHON) -c "import sys; print 'PYTHON%i%i' % sys.version_info[:2]") | |
| 12 | 13 | UCS ?= $(shell $(PYTHON) -c "from distutils.sysconfig import get_config_var; \ | |
| 13 | - print 'UCS%i' % (get_config_var('Py_UNICODE_SIZE') or 2)") | ||
| 14 | + print 'UCS%i' % (get_config_var('Py_UNICODE_SIZE') or 2)") | ||
| 15 | + SITEPACKAGES = $(shell $(PYTHON) -c "from distutils.sysconfig import get_python_lib; \ | ||
| 16 | + print get_python_lib(plat_specific=1, standard_lib=0)") | ||
| 17 | + INSTALL=/usr/bin/install -m644 | ||
| 14 | 18 | ||
| 15 | 19 | ifeq ($(origin WINDIR), undefined) | |
| 16 | 20 | RUNNER = mono | |
| 17 | 21 | ILDASM = monodis | |
| 18 | 22 | ILASM = ilasm | |
| 19 | 23 | CSC = gmcs | |
| 20 | - RUNTIME_REF = /reference:Mono.Posix.dll | ||
| 24 | + RUNTIME_REF = | ||
| 21 | 25 | ALL = clr.so monoclr | |
| 26 | + GACUTIL = gacutil /nologo | ||
| 22 | 27 | else | |
| 23 | 28 | RUNNER = | |
| 24 | 29 | ILDASM = ildasm.exe | |
| 25 | - ILASM = ilasm.exe | ||
| 26 | - CSC = csc.exe | ||
| 30 | + ILASM = $(WINDIR)/Microsoft.NET/Framework/v2.0.50727/ilasm.exe | ||
| 31 | + CSC = $(WINDIR)/Microsoft.NET/Framework/v2.0.50727/csc.exe | ||
| 27 | 32 | RUNTIME_REF = | |
| 28 | - ALL = clr.pyd | ||
| 33 | + ALL = | ||
| 34 | + GACUTIL = $(ProgramFiles)/Microsoft.NET/SDK/v2.0/Bin/gacutil.exe /nologo | ||
| 29 | 35 | endif | |
| 30 | 36 | ||
| 31 | 37 | ifeq ($(origin DEFINE), undefined) | |
@@ -34,6 +40,10 @@ else | |||
| 34 | 40 | _DEFINE = $(DEFINE),$(PYTHONVER),$(UCS) | |
| 35 | 41 | endif | |
| 36 | 42 | ||
| 43 | + ifeq ($(UCS), UCS4) | ||
| 44 | + RUNTIME_REF = /reference:Mono.Posix.dll | ||
| 45 | + endif | ||
| 46 | + | ||
| 37 | 47 | CSC += /define:$(_DEFINE) /nologo $(CSCARGS) | |
| 38 | 48 | ||
| 39 | 49 | BASEDIR = $(shell pwd) | |
@@ -43,9 +53,9 @@ RUNTIME_CS = $(wildcard $(BASEDIR)/src/runtime/*.cs) | |||
| 43 | 53 | TESTING_CS = $(wildcard $(BASEDIR)/src/testing/*.cs) | |
| 44 | 54 | EMBED_CS = $(wildcard $(BASEDIR)/src/embed_tests/*.cs) | |
| 45 | 55 | ||
| 46 | - all: Python.Runtime.dll python.exe Python.Test.dll $(ALL) | ||
| 56 | + all: Python.Runtime.dll python.exe Python.Test.dll clr.pyd $(ALL) | ||
| 47 | 57 | ||
| 48 | - cleanall: clean all | ||
| 58 | + cleanall: realclean all | ||
| 49 | 59 | ||
| 50 | 60 | python.exe: Python.Runtime.dll $(PYTHON_CS) | |
| 51 | 61 | cd "$(BASEDIR)/src/console"; \ | |
@@ -74,8 +84,19 @@ Python.Test.dll: Python.Runtime.dll | |||
| 74 | 84 | /reference:../../Python.Runtime.dll,System.Windows.Forms.dll \ | |
| 75 | 85 | /recurse:*.cs | |
| 76 | 86 | ||
| 87 | + Python.EmbeddingTest.dll: Python.Runtime.dll $(EMBED_CS) | ||
| 88 | + cd $(BASEDIR)/src/embed_tests; \ | ||
| 89 | + $(CSC) /target:library /out:../../Python.EmbeddingTest.dll \ | ||
| 90 | + /reference:../../Python.Runtime.dll,System.Windows.Forms.dll,nunit.framework \ | ||
| 91 | + /recurse:*.cs | ||
| 92 | + | ||
| 77 | 93 | .PHONY=clean | |
| 78 | 94 | clean: | |
| 95 | + rm -f *.exe *.dll *.so *.pyd | ||
| 96 | + make -C src/monoclr clean | ||
| 97 | + | ||
| 98 | + .PHONY=realclean | ||
| 99 | + realclean: clean | ||
| 79 | 100 | find . \( -name \*.o -o -name \*.so -o -name \*.py[co] -o -name \ | |
| 80 | 101 | \*.dll -o -name \*.exe -o -name \*.pdb -o -name \*.mdb \ | |
| 81 | 102 | -o -name \*.pyd -o -name \*~ \) -exec rm -f {} \; | |
@@ -93,21 +114,36 @@ test: all | |||
| 93 | 114 | $(RUNNER) ./python.exe ./src/tests/runtests.py | |
| 94 | 115 | ||
| 95 | 116 | .PHONY=dist | |
| 96 | - dist: clean all | ||
| 117 | + dist: realclean | ||
| 118 | + if ! [ -f $(KEYFILE) ]; then \ | ||
| 119 | + echo "Could not find $(KEYFILE) to sign assemblies"; \ | ||
| 120 | + exit 1; \ | ||
| 121 | + fi | ||
| 97 | 122 | rm -rf ./$(RELEASE) | |
| 123 | + mkdir -p ./release/ | ||
| 98 | 124 | mkdir ./$(RELEASE) | |
| 99 | - mkdir -p ./release | ||
| 100 | - cp ./makefile ./$(RELEASE)/ | ||
| 125 | + cp ./Makefile ./$(RELEASE)/ | ||
| 101 | 126 | cp ./*.sln ./$(RELEASE)/ | |
| 127 | + cp ./*.mds ./$(RELEASE)/ | ||
| 102 | 128 | cp ./*.txt ./$(RELEASE)/ | |
| 103 | 129 | svn export ./demo ./$(RELEASE)/demo/ | |
| 104 | 130 | svn export ./doc ./$(RELEASE)/doc/ | |
| 105 | 131 | svn export ./src ./$(RELEASE)/src/ | |
| 106 | - cp ./python.exe ./$(RELEASE)/ | ||
| 107 | - cp ./*.dll ./$(RELEASE)/ | ||
| 108 | - cp ./*.pyd ./$(RELEASE)/ | ||
| 109 | - tar czf $(RELEASE).tgz ./$(RELEASE)/ | ||
| 110 | - mv $(RELEASE).tgz ./release/ | ||
| 132 | + for PY in python2.4 python2.5; do \ | ||
| 133 | + for PYUCS in UCS2 UCS4; do \ | ||
| 134 | + make clean; \ | ||
| 135 | + make PYTHON=$$PY UCS=$$PYUCS CSCARGS=/keyfile:$(BASEDIR)/$(KEYFILE); \ | ||
| 136 | + mkdir ./$(RELEASE)/$$PY-$$PYUCS; \ | ||
| 137 | + cp *.dll *.exe *.pyd *.so ./$(RELEASE)/$$PY-$$PYUCS/; \ | ||
| 138 | + done; \ | ||
| 139 | + done; | ||
| 140 | + tar czf $(RELEASE).tar.gz ./$(RELEASE)/ | ||
| 141 | + zip -r -6 $(RELEASE).zip ./$(RELEASE) | ||
| 142 | + md5sum $(RELEASE).tar.gz $(RELEASE).zip > $(RELEASE).md5 | ||
| 143 | + sha256sum $(RELEASE).tar.gz $(RELEASE).zip > $(RELEASE).sha | ||
| 144 | + gpg -sb $(RELEASE).zip | ||
| 145 | + gpg -sb $(RELEASE).tar.gz | ||
| 146 | + mv $(RELEASE).* ./release/ | ||
| 111 | 147 | rm -rf ./$(RELEASE)/ | |
| 112 | 148 | ||
| 113 | 149 | dis: | |
@@ -124,3 +160,6 @@ monoclr: | |||
| 124 | 160 | run: python.exe | |
| 125 | 161 | $(RUNNER) python.exe | |
| 126 | 162 | ||
| 163 | + install: all | ||
| 164 | + $(PYTHON) setup.py install | ||
| 165 | + | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -12,10 +12,14 @@ | |||
| 12 | 12 | Author: Christian Heimes <christian(at)cheimes(dot)de> | |
| 13 | 13 | """ | |
| 14 | 14 | ||
| 15 | - from setuptools import setup | ||
| 16 | - from setuptools import Extension | ||
| 15 | + import os | ||
| 16 | + import sys | ||
| 17 | + from distutils.core import setup | ||
| 18 | + from distutils.core import Extension | ||
| 17 | 19 | import subprocess | |
| 18 | 20 | ||
| 21 | + VERSION = "%i.%i" % sys.version_info[:2] | ||
| 22 | + | ||
| 19 | 23 | def pkgconfig(*packages, **kw): | |
| 20 | 24 | """From http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/502261 | |
| 21 | 25 | """ | |
@@ -44,6 +48,11 @@ def pkgconfig(*packages, **kw): | |||
| 44 | 48 | **pkgconfig('mono') | |
| 45 | 49 | ) | |
| 46 | 50 | ||
| 51 | + extensions = [] | ||
| 52 | + if os.name == "posix": | ||
| 53 | + extensions.append(clr) | ||
| 54 | + | ||
| 47 | 55 | setup(name="clr", | |
| 48 | - ext_modules = [clr], | ||
| 56 | + ext_modules = extensions, | ||
| 57 | + scripts = ["src/monoclr/clrpython%s" % VERSION], | ||
| 49 | 58 | ) | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,7 +1,7 @@ | |||
| 1 | 1 | # Author: Christian Heimes | |
| 2 | 2 | ||
| 3 | 3 | PYTHON = python2.5 | |
| 4 | - BASENAME = $(shell basename $(PYTHON)) | ||
| 4 | + BASENAME = $(shell $(PYTHON) -c "import sys; print 'python%i.%i' % sys.version_info[:2]") | ||
| 5 | 5 | GCC = gcc | |
| 6 | 6 | ||
| 7 | 7 | PY_LIBS = $(shell $(PYTHON) -c "from distutils.sysconfig import get_config_vars; \ | |
@@ -15,9 +15,9 @@ MONO_CFLAGS = $(shell pkg-config --cflags mono) | |||
| 15 | 15 | LIBS = $(MONO_LIBS) $(PY_LIBS) | |
| 16 | 16 | CFLAGS = $(MONO_CFLAGS) $(PY_CFLAGS) | |
| 17 | 17 | ||
| 18 | - all: clrpython python | ||
| 18 | + all: clr$(BASENAME) $(BASENAME) | ||
| 19 | 19 | ||
| 20 | - clrpython: clrpython.o pynetinit.o | ||
| 20 | + clr$(BASENAME): clrpython.o pynetinit.o | ||
| 21 | 21 | $(GCC) $(LIBS) clrpython.o pynetinit.o -o clr$(BASENAME) | |
| 22 | 22 | ||
| 23 | 23 | clrpython.o: pynetclr.h clrpython.c | |
@@ -26,12 +26,13 @@ clrpython.o: pynetclr.h clrpython.c | |||
| 26 | 26 | pynetinit.o: pynetclr.h pynetinit.c | |
| 27 | 27 | $(GCC) $(CFLAGS) -c pynetinit.c -o pynetinit.o | |
| 28 | 28 | ||
| 29 | - python: python.c | ||
| 29 | + $(BASENAME): python.c | ||
| 30 | 30 | $(GCC) $(PY_CFLAGS) $(PY_LIBS) python.c -o $(BASENAME) | |
| 31 | 31 | ||
| 32 | 32 | clean: | |
| 33 | 33 | rm -f *.o | |
| 34 | 34 | rm -f *.so | |
| 35 | - rm -f clr$(PYTHON) | ||
| 36 | - rm -f $(PYTHON) | ||
| 35 | + rm -f clrpython2.? | ||
| 36 | + rm -f python2.? | ||
| 37 | 37 | rm -rf build/ | |
| 38 | + | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -14,20 +14,20 @@ | |||
| 14 | 14 | <DebugType>full</DebugType> | |
| 15 | 15 | <Optimize>true</Optimize> | |
| 16 | 16 | <OutputPath>.\bin\Debug\</OutputPath> | |
| 17 | - <DefineConstants>TRACE;DEBUG;PYTHON24</DefineConstants> | ||
| 17 | + <DefineConstants>TRACE;DEBUG;PYTHON25,UCS2</DefineConstants> | ||
| 18 | 18 | <AllowUnsafeBlocks>true</AllowUnsafeBlocks> | |
| 19 | 19 | </PropertyGroup> | |
| 20 | 20 | <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> | |
| 21 | 21 | <DebugType>pdbonly</DebugType> | |
| 22 | 22 | <Optimize>true</Optimize> | |
| 23 | 23 | <OutputPath>.\bin\Release\</OutputPath> | |
| 24 | - <DefineConstants>TRACE;PYTHON24</DefineConstants> | ||
| 24 | + <DefineConstants>TRACE;PYTHON25,UCS2</DefineConstants> | ||
| 25 | 25 | <AllowUnsafeBlocks>true</AllowUnsafeBlocks> | |
| 26 | 26 | </PropertyGroup> | |
| 27 | 27 | <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'EmbeddingTest|AnyCPU' "> | |
| 28 | 28 | <DebugSymbols>true</DebugSymbols> | |
| 29 | 29 | <OutputPath>bin\EmbeddingTest\</OutputPath> | |
| 30 | - <DefineConstants>TRACE;DEBUG;PYTHON24</DefineConstants> | ||
| 30 | + <DefineConstants>TRACE;DEBUG;PYTHON25,UCS2</DefineConstants> | ||
| 31 | 31 | <AllowUnsafeBlocks>true</AllowUnsafeBlocks> | |
| 32 | 32 | <Optimize>true</Optimize> | |
| 33 | 33 | <DebugType>full</DebugType> | |
@@ -36,7 +36,7 @@ | |||
| 36 | 36 | <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'UnitTests|AnyCPU' "> | |
| 37 | 37 | <DebugSymbols>true</DebugSymbols> | |
| 38 | 38 | <OutputPath>bin\UnitTests\</OutputPath> | |
| 39 | - <DefineConstants>TRACE;DEBUG;PYTHON24</DefineConstants> | ||
| 39 | + <DefineConstants>TRACE;DEBUG;PYTHON25,UCS2</DefineConstants> | ||
| 40 | 40 | <AllowUnsafeBlocks>true</AllowUnsafeBlocks> | |
| 41 | 41 | <Optimize>true</Optimize> | |
| 42 | 42 | <DebugType>full</DebugType> | |
@@ -115,4 +115,4 @@ | |||
| 115 | 115 | </PostBuildEvent> | |
| 116 | 116 | <PreBuildEvent>del "$(TargetDir)clr.pyd"</PreBuildEvent> | |
| 117 | 117 | </PropertyGroup> | |
| 118 | - </Project> | ||
| 118 | + </Project> | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments