Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
nexedi
cython
Commits
9ad9a05e
Commit
9ad9a05e
authored
Apr 21, 2009
by
Robert Bradshaw
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
embedding example
Windows fixing needs help
parent
0bf694af
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
32 additions
and
52 deletions
+32
-52
Demos/embed/Makefile
Demos/embed/Makefile
+13
-24
Demos/embed/Makefile.unix
Demos/embed/Makefile.unix
+13
-24
Demos/embed/embedded.pyx
Demos/embed/embedded.pyx
+6
-4
No files found.
Demos/embed/Makefile
View file @
9ad9a05e
PYVERSION
=
2.2
# Makefile for creating our standalone Cython program
PYHOME
=
$(HOME)
/pkg/python/
$(PYVERSION)
PYVERSION
=
2.3
PYARCH
=
$(PYHOME)
/
$(ARCH)
PYPREFIX
=
/usr
PYINCLUDE
=
\
INCLUDES
=
-I
$(PYPREFIX)
/include/python
$(PYVERSION)
-I
$(PYHOME)
/include/python
$(PYVERSION)
\
-I
$(PYARCH)
/include/python
$(PYVERSION)
PYLIB
=
-L
$(PYARCH)
/lib/python
$(PYVERSION)
/config
\
-lpython
$(PYVERSION)
\
-ldl
-lpthread
-lutil
-lm
%.c
:
%.pyx
embedded
:
embedded.o
../../bin/cython
$<
gcc
-o
$@
$^
-lpython
$(PYVERSION)
%.o
:
%
.c
embedded.o
:
embedded
.c
gcc
-c
-fPIC
$(PYINCLUDE)
$<
gcc
-c
$^
$(INCLUDES)
#%.so: %.o
embedded.c
:
embedded.pyx
# gcc -shared $< -lm -o $@
@
python ../../cython.py
--embed
embedded.pyx
all
:
main
all
:
embedded
main
:
main.o embedded.o
gcc main.o embedded.o
$(PYLIB)
-o
main
clean
:
clean
:
@
echo
Cleaning Demos/embed
@
echo
Cleaning Demos/embed
@
rm
-f
*
~
*
.o
*
.so core core.
*
embedded.h embedded.c main
@
rm
-f
*
~
*
.o
*
.so core core.
*
*
.c embedded
embedded.h
:
embedded.c
main.o
:
embedded.h
Demos/embed/Makefile.unix
View file @
9ad9a05e
PYVERSION
=
2.2
# Makefile for creating our standalone Cython program
PYHOME
=
$(HOME)
/pkg/python/
$(PYVERSION)
PYVERSION
=
2.3
PYARCH
=
$(PYHOME)
/
$(ARCH)
PYPREFIX
=
/usr
PYINCLUDE
=
\
INCLUDES
=
-I
$(PYPREFIX)
/include/python
$(PYVERSION)
-I
$(PYHOME)
/include/python
$(PYVERSION)
\
-I
$(PYARCH)
/include/python
$(PYVERSION)
PYLIB
=
-L
$(PYARCH)
/lib/python
$(PYVERSION)
/config
\
-lpython
$(PYVERSION)
\
-ldl
-lpthread
-lutil
-lm
%.c
:
%.pyx
embedded
:
embedded.o
../../bin/cython
$<
gcc
-o
$@
$^
-lpython
$(PYVERSION)
%.o
:
%
.c
embedded.o
:
embedded
.c
gcc
-c
-fPIC
$(PYINCLUDE)
$<
gcc
-c
$^
$(INCLUDES)
#%.so: %.o
embedded.c
:
embedded.pyx
# gcc -shared $< -lm -o $@
@
python ../../cython.py
--embed
embedded.pyx
all
:
main
all
:
embedded
main
:
main.o embedded.o
gcc main.o embedded.o
$(PYLIB)
-o
main
clean
:
clean
:
@
echo
Cleaning Demos/embed
@
echo
Cleaning Demos/embed
@
rm
-f
*
~
*
.o
*
.so core core.
*
embedded.h embedded.c main
@
rm
-f
*
~
*
.o
*
.so core core.
*
*
.c embedded
embedded.h
:
embedded.c
main.o
:
embedded.h
Demos/embed/embedded.pyx
View file @
9ad9a05e
cdef
public
void
spam
():
praise
()
def
praise
():
print
__name__
print
"Spam, glorious spam!"
if
__name__
==
"__main__"
:
print
"Hi, I'm embedded."
else
:
print
"I'm being imported."
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment