xref: /aosp_15_r20/external/libcap-ng/bindings/python3/Makefile.am (revision 8dd5e09d5faf27a871e8654ddaa2d2af7c696578)
1# Makefile.am --
2# Copyright 2009,2014-17 Red Hat Inc.
3# All Rights Reserved.
4#
5# This library is free software; you can redistribute it and/or
6# modify it under the terms of the GNU Lesser General Public
7# License as published by the Free Software Foundation; either
8# version 2.1 of the License, or (at your option) any later version.
9#
10# This library is distributed in the hope that it will be useful,
11# but WITHOUT ANY WARRANTY; without even the implied warranty of
12# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13# Lesser General Public License for more details.
14#
15# You should have received a copy of the GNU Lesser General Public License
16# along with this program; see the file COPYING. If not, write to the
17# Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor
18# Boston, MA 02110-1335, USA.
19#
20# Authors:
21#   Steve Grubb <[email protected]>
22#
23SUBDIRS = test
24CONFIG_CLEAN_FILES = *.loT *.rej *.orig
25AM_CFLAGS = -fPIC -DPIC $(PYTHON3_CFLAGS)
26AM_CPPFLAGS = -I. -I$(top_builddir) $(PYTHON3_INCLUDES)
27LIBS = ${top_builddir}/src/libcap-ng.la
28SWIG_FLAGS = -python
29SWIG_INCLUDES = ${AM_CPPFLAGS}
30PYTHON = $(PYTHON3)
31pyexec_PYTHON = capng.py
32pyexec_LTLIBRARIES = _capng.la
33pyexec_SOLIBRARIES = _capng.so
34_capng_la_CFLAGS = -shared
35_capng_la_LDFLAGS = -module -avoid-version -Wl,-z,relro
36_capng_la_HEADERS: $(top_builddir)/config.h
37_capng_la_DEPENDENCIES =${top_srcdir}/src/cap-ng.h ${top_builddir}/src/libcap-ng.la
38_capng_la_LIBADD = ${top_builddir}/src/libcap-ng.la
39nodist__capng_la_SOURCES  = capng_wrap.c
40
41capng.py capng_wrap.c: ${srcdir}/../src/capng_swig.i caps.h capng.h
42	swig -o capng_wrap.c ${SWIG_FLAGS} ${SWIG_INCLUDES} ${srcdir}/../src/capng_swig.i
43caps.h:
44	cat $(CAPABILITY_HEADER) | grep '^#define CAP'  | grep -v '[()]' > caps.h
45capng.h:
46	cat ${top_srcdir}/src/cap-ng.h | grep -v '_state' > capng.h
47
48CLEANFILES = capng.py* capng_wrap.c caps.h capng.h *~
49clean-local:
50	$(RM) -rf __pycache__
51