-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
executable file
·68 lines (57 loc) · 2.58 KB
/
Makefile
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
all: py4pd
lib.name = py4pd
uname := $(shell uname -s)
# =================================== Windows ===================================
ifeq (MINGW,$(findstring MINGW,$(uname)))
PYTHON_DLL := $(shell cat pythondll.txt)
PYTHON_INCLUDE := $(shell cat pythonincludes.txt)
PYTHON_PATH := $(shell cat pythonpath.txt)
NUMPY_INCLUDE := $(shell cat numpyincludes.txt)
PYTHON_DLL := $(PYTHON_DLL)
cflags = -I '$(PYTHON_INCLUDE)' -I '$(NUMPY_INCLUDE)' -Wno-cast-function-type -Wno-unused-variable -std=c99
ldlibs = '$(PYTHON_DLL)' -lwinpthread
# =================================== Linux =====================================
else ifeq (Linux,$(findstring Linux,$(uname)))
# $(shell rm -f src/*.o)
PYTHON_INCLUDE := $(shell $(PYTHON_VERSION) -c 'import sysconfig;print(sysconfig.get_config_var("INCLUDEPY"))')
NUMPY_INCLUDE := $(shell $(PYTHON_VERSION) -c 'import numpy; print(numpy.get_include())')
cflags = -I $(PYTHON_INCLUDE) -I $(NUMPY_INCLUDE) -Wno-cast-function-type
ldlibs = -l $(PYTHON_VERSION)
# =================================== MacOS =====================================
else ifeq (Darwin,$(findstring Darwin,$(uname)))
PYTHON_INCLUDE := $(shell $(PYTHON_VERSION) -c 'import sysconfig;print(sysconfig.get_config_var("INCLUDEPY"))')
NUMPY_INCLUDE := $(shell $(PYTHON_VERSION) -c 'import numpy; print(numpy.get_include())')
ifeq ($(extension),d_arm64)
cflags = -I $(PYTHON_INCLUDE) -I $(NUMPY_INCLUDE) -Wno-bad-function-cast -Wnull-pointer-subtraction -mmacosx-version-min=12
else
cflags = -I $(PYTHON_INCLUDE) -I $(NUMPY_INCLUDE) -Wno-bad-function-cast -Wnull-pointer-subtraction -mmacosx-version-min=10.9
endif
PYTHON_LIB := $(shell $(PYTHON_VERSION) -c 'import sysconfig;print(sysconfig.get_config_var("LIBDIR"))') -std=c99 -D_BSD_SOURCE
ldlibs = -L $(PYTHON_LIB) -l $(PYTHON_VERSION) -Wno-null-pointer-subtraction
else
$(error "Unknown system type: $(uname)")
$(shell exit 1)
endif
# =================================== Sources ===================================
py4pd.class.sources = \
src/py4pd.c \
src/utils.c \
src/module.c \
src/ext-libraries.c \
src/ext-class.c \
src/pic.c \
src/dsp.c \
src/player.c
# =================================== Data ======================================
datafiles = \
$(wildcard Help-files/*.pd) \
$(wildcard scripts/*.py) \
$(wildcard py.py) \
$(wildcard py4pd-help.pd) \
$(PYTHON_DLL)
# =================================== Pd Lib Builder =============================
PDLIBBUILDER_DIR=./resources/pd-lib-builder/
ifeq ($(extension),d_arm64)
override arch := arm64
endif
include $(PDLIBBUILDER_DIR)/Makefile.pdlibbuilder