aboutsummaryrefslogtreecommitdiffstats
path: root/src/build-data/makefile/python.in
blob: 5b1d2379daf6175b011a6cf2b6e163860b6aed73 (plain)
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

PYTHON_ROOT = /usr/lib/python%{python_version}/config
PYTHON_INC = -I/usr/include/python%{python_version}
PYTHON_SITE_PACKAGE_DIR = /usr/lib/python%{python_version}/site-packages/

PYTHON_FLAGS = -I%{python_dir} -fPIC -ftemplate-depth-255 $(WARN_FLAGS) $(PYTHON_INC) $(CFLAGS)

BOTAN_PYTHON_MODDIR = %{python_obj_dir}

PYTHON_OBJS   = %{python_objs}

python: $(BOTAN_PYTHON_MODDIR)/_botan.so

PYTHON_FLAGS   = $(LANG_FLAGS) $(WARN_FLAGS) $(SO_OBJ_FLAGS) -Os -ftemplate-depth=255 $(PYTHON_INC) -Wno-error

%{python_build_cmds}

$(BOTAN_PYTHON_MODDIR)/_botan.so: $(PYTHON_OBJS)
	cp %{python_dir}/*.py $(BOTAN_PYTHON_MODDIR)
	$(CXX) -shared -Wl,-soname,$@ $(PYTHON_OBJS) -L. -L$(PYTHON_ROOT) $(LDFLAGS) -lbotan-$(SERIES) -lboost_python-%{python_version} -o $@

install_python:
	mkdir -p $(PYTHON_SITE_PACKAGE_DIR)/botan
	cp $(BOTAN_PYTHON_MODDIR)/_botan.so $(BOTAN_PYTHON_MODDIR)/*.py $(PYTHON_SITE_PACKAGE_DIR)/botan
	chmod -R u=rwX,go=rX $(PYTHON_SITE_PACKAGE_DIR)/botan