66# make clean
77
88RELEASE = pythonnet-2.0-alpha3
9+ KEYFILE = pythonnet.key
910
1011PYTHON ?= python
1112PYTHONVER ?= $(shell $(PYTHON ) -c "import sys; print 'PYTHON% i% i' % sys.version_info[:2]")
1213UCS ?= $(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
1418
1519ifeq ($(origin WINDIR ) , undefined)
1620 RUNNER = mono
1721 ILDASM = monodis
1822 ILASM = ilasm
1923 CSC = gmcs
20- RUNTIME_REF = /reference:Mono.Posix.dll
24+ RUNTIME_REF =
2125 ALL = clr.so monoclr
26+ GACUTIL = gacutil /nologo
2227else
2328 RUNNER =
2429 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
2732 RUNTIME_REF =
28- ALL = clr.pyd
33+ ALL =
34+ GACUTIL = $(ProgramFiles ) /Microsoft.NET/SDK/v2.0/Bin/gacutil.exe /nologo
2935endif
3036
3137ifeq ($(origin DEFINE ) , undefined)
3440 _DEFINE = $(DEFINE ) ,$(PYTHONVER ) ,$(UCS )
3541endif
3642
43+ ifeq ($(UCS ) , UCS4)
44+ RUNTIME_REF = /reference:Mono.Posix.dll
45+ endif
46+
3747CSC += /define:$(_DEFINE ) /nologo $(CSCARGS )
3848
3949BASEDIR = $(shell pwd)
@@ -43,9 +53,9 @@ RUNTIME_CS = $(wildcard $(BASEDIR)/src/runtime/*.cs)
4353TESTING_CS = $(wildcard $(BASEDIR ) /src/testing/* .cs)
4454EMBED_CS = $(wildcard $(BASEDIR ) /src/embed_tests/* .cs)
4555
46- all : Python.Runtime.dll python.exe Python.Test.dll $(ALL )
56+ all : Python.Runtime.dll python.exe Python.Test.dll clr.pyd $(ALL )
4757
48- cleanall : clean all
58+ cleanall : realclean all
4959
5060python.exe : Python.Runtime.dll $(PYTHON_CS )
5161 cd " $( BASEDIR) /src/console" ; \
@@ -74,8 +84,19 @@ Python.Test.dll: Python.Runtime.dll
7484 /reference:../../Python.Runtime.dll,System.Windows.Forms.dll \
7585 /recurse:* .cs
7686
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+
7793.PHONY =clean
7894clean :
95+ rm -f * .exe * .dll * .so * .pyd
96+ make -C src/monoclr clean
97+
98+ .PHONY =realclean
99+ realclean : clean
79100 find . \( -name \* .o -o -name \* .so -o -name \* .py[co] -o -name \
80101 \* .dll -o -name \* .exe -o -name \* .pdb -o -name \* .mdb \
81102 -o -name \* .pyd -o -name \* ~ \) -exec rm -f {} \;
@@ -93,21 +114,36 @@ test: all
93114 $(RUNNER ) ./python.exe ./src/tests/runtests.py
94115
95116.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
97122 rm -rf ./$(RELEASE )
123+ mkdir -p ./release/
98124 mkdir ./$(RELEASE )
99- mkdir -p ./release
100- cp ./makefile ./$(RELEASE ) /
125+ cp ./Makefile ./$(RELEASE ) /
101126 cp ./* .sln ./$(RELEASE ) /
127+ cp ./* .mds ./$(RELEASE ) /
102128 cp ./* .txt ./$(RELEASE ) /
103129 svn export ./demo ./$(RELEASE ) /demo/
104130 svn export ./doc ./$(RELEASE ) /doc/
105131 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/
111147 rm -rf ./$(RELEASE ) /
112148
113149dis :
@@ -124,3 +160,6 @@ monoclr:
124160run : python.exe
125161 $(RUNNER ) python.exe
126162
163+ install : all
164+ $(PYTHON ) setup.py install
165+
0 commit comments