forked from pythonnet/pythonnet
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
executable file
·51 lines (36 loc) · 1.37 KB
/
Makefile
File metadata and controls
executable file
·51 lines (36 loc) · 1.37 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
# Author: Christian Heimes
PYTHON = python
BASENAME = $(shell $(PYTHON) -c "import sys; print 'python%i.%i' % sys.version_info[:2]")
GCC = gcc
ifeq ($(origin WINDIR), undefined)
DLL_OR_SO = "-shared"
else
DLL_OR_SO = "-dynamiclib"
endif
PY_LIBS = $(shell $(PYTHON) -c "from distutils.sysconfig import get_config_vars; \
print get_config_vars('BLDLIBRARY')[0]") #-lpython
PY_CFLAGS = -I$(shell $(PYTHON) -c "from distutils.sysconfig import get_config_vars; \
print get_config_vars('CFLAGS')[0] + ' -I' + get_config_vars('CONFINCLUDEPY')[0]")
MONO_LIBS = $(shell pkg-config --libs mono) # Was --libs mono
MONO_CFLAGS = $(shell pkg-config --cflags mono) # Was --cflags mono
LIBS = $(MONO_LIBS) $(PY_LIBS)
CFLAGS = $(MONO_CFLAGS) $(PY_CFLAGS)
all: clr$(BASENAME) $(BASENAME) clr.so
clrmod.o: pynetclr.h clrmod.c
$(GCC) $(CFLAGS) -c clrmod.c -o clrmod.o
clrpython.o: pynetclr.h clrpython.c
$(GCC) $(CFLAGS) -c clrpython.c -o clrpython.o
pynetinit.o: pynetclr.h pynetinit.c
$(GCC) $(CFLAGS) -c pynetinit.c -o pynetinit.o
$(BASENAME): python.c
$(GCC) $(PY_CFLAGS) $(PY_LIBS) python.c -o $(BASENAME)
clr.so: clrmod.o pynetinit.o
$(GCC) $(LIBS) $(DLL_OR_SO) pynetinit.o clrmod.o -o clr.so
clr$(BASENAME): clrpython.o pynetinit.o
$(GCC) $(LIBS) clrpython.o pynetinit.o -o clr$(BASENAME)
clean:
rm -f *.o
rm -f *.so
rm -f clrpython2.?
rm -f python2.?
rm -rf build/