Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 62cf605

Browse files
committed
New version submitted by Jim Fulton.
1 parent f71bd68 commit 62cf605

1 file changed

Lines changed: 29 additions & 12 deletions

File tree

Misc/gMakefile

Lines changed: 29 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,20 @@
33
# Jim Fulton, Digital Creations, [email protected]
44

55

6-
# Uncomment this line if you want to fix the location of the PYTHON
7-
# installation. Otherwise, set the environment variable before using this
8-
# Makefile.
9-
# $(PYTHONHOME)= /usr/local/
6+
# Uncomment and modify these lines if you want to fix the location of
7+
# the PYTHON installation and the python version. Otherwise, set the
8+
# environment variables before using this Makefile.
9+
10+
# $(PYTHONHOME)= /usr/local/
11+
# $(PYTHONVERSION)= 1.4
1012

1113
# The following lines should be left as is:
14+
VERSION= $(PYTHONVERSION)
1215
pyinstalldir= $(PYTHONHOME)
1316
installdir= $(PYTHONHOME)
1417
exec_installdir=$(pyinstalldir)
15-
INCLUDEPY= $(pyinstalldir)/include/python1.4
16-
LIBP= $(exec_installdir)/lib/python1.4
18+
INCLUDEPY= $(pyinstalldir)/include/python$(VERSION)
19+
LIBP= $(exec_installdir)/lib/python$(VERSION)
1720
LIBPL= $(LIBP)/config
1821
PYMAKE= make -f $(LIBPL)/Makefile
1922

@@ -31,34 +34,48 @@ MODULE=your-module
3134
OBS=$(MODULE).o
3235

3336
# Put extra linker options, such as libraries here:
34-
EXTRA=
37+
EXTRALD=
38+
39+
# Put Extra compiler options, such as extra -I options, here
40+
CFLAGS=-O
3541

3642
# If you have any Python modules, include them here, so that they
37-
# can be installed.
43+
# can get installed.
3844
PYMODULES=
3945

4046
build:
4147
if [ "$(MODULE)" != your-module ]; then \
4248
$(PYMAKE) INCLDIR=$(INCLUDEPY) CONFIGINCLDIR=$(LIBPL) \
4349
ASHAREDMODULE=$(MODULE) \
4450
'ASHAREDMODULESOBS=$(OBS)' \
45-
'ASHAREDMODULESEXTRA=$(EXTRA)' \
51+
'ASHAREDMODULESEXTRA=$(EXTRALD)' \
52+
'OPT=$(CFLAGS)' \
4653
asharedmodule; \
4754
fi
4855

49-
install: installso installpy
56+
# Normally we don't install .py files:
57+
install: installso installpyc
58+
59+
# But sometimes we may want to:
60+
installpy: install
61+
for m in $(PYMODULES) the-end; do \
62+
if [ "$$m" != the-end ]; then \
63+
cp $$m.py $(installdir)/lib/python$(VERSION)/; \
64+
fi; \
65+
done
66+
5067

5168
installso: build
5269
if [ "$(MODULE)" != your-module ]; then \
5370
$(PYMAKE) exec_prefix=$(installdir) \
5471
ASHAREDMODULE=$(MODULE) asharedinstall; \
5572
fi
5673

57-
installpy:
74+
installpyc:
5875
for m in $(PYMODULES) the-end; do \
5976
if [ "$$m" != the-end ]; then \
6077
python -c "import $$m"; \
61-
cp $$m.pyc $(installdir)/lib/python/; \
78+
cp $$m.pyc $(installdir)/lib/python$(VERSION)/; \
6279
fi; \
6380
done
6481

0 commit comments

Comments
 (0)