File: Makefile.am

package info (click to toggle)
gnucap-python 0.0.2-1.1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster, sid
  • size: 2,672 kB
  • sloc: python: 7,873; sh: 4,384; cpp: 1,786; makefile: 252
file content (143 lines) | stat: -rw-r--r-- 3,285 bytes parent folder | download
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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
# gnucap-python top level Makefile.am
# Author: 2018 Felix Salfelder
# license GPLv3+
#
# (inspired by now obsolete files from Henrik Johansson)
#

# put stuff into $prefix, no matter what gnucap-conf says
AM_DISTCHECK_CONFIGURE_FLAGS=--enable-plugpath-override

check_PROGRAMS = test_python
test_python_SOURCES = test_python.cc

test_python_LDADD = ${DEPS_LIBS} @PYTHON_EXTRA_LIBS@ ${PYTHON_LIBS}
test_python_CPPFLAGS = ${GC_CPPFLAGS} @PYTHON_CPPFLAGS@ \
	-DPYTHON_SO=\"@ac_python_libdir@/@ac_python_soname@\" ${AM_CPPFLAGS}

ACLOCAL_AMFLAGS = -I m4
SUBDIRS = \
	examples \
	gnucap \
	misc

all-local:
	rm -f c_python.so
	-${LN_S} .libs/c_python.so c_python.so
	-${LN_S} out3.6 out3.7

# gnucap plugins
pluginsdir = $(gnucap_plugpath)
plugins_LTLIBRARIES = c_python.la

c_python_la_SOURCES = c_python.cc # gnucap_wrap.cxx
c_python_la_CXXFLAGS = -Wall ${AM_CXXFLAGS} -fPIC ${DEPS_CFLAGS}

# BUG: it does not work without NUMPY either.
if NUMPY
  c_python_la_SOURCES += # numpy_interface.cc
  SWIG_FLAGS = -DHAS_NUMPY
endif

c_python_la_CPPFLAGS = ${GC_CPPFLAGS} @PYTHON_CPPFLAGS@ \
	-DPYTHON_SO=\"@ac_python_libdir@/@ac_python_soname@\" ${AM_CPPFLAGS}

c_python_la_LDFLAGS = -shared -module -avoid-version @LDFLAGS@ @PYTHON_LIBS@
c_python_la_LIBADD = ${DEPS_LIBS} @PYTHON_EXTRA_LIBS@
c_python_la_LIBADD += gnucap/libgnucap-python.la

# possibly required on non-posix systems
#c_python_la_LIBADD += @GC_LIBS@

CLEANFILES =

####### TESTS #########
GNUCAP_PLUGPATH := ${builddir}:@GC_PKGLIBDIR@:${GNUCAP_PLUGPATH:%=:%}
PYTHONPATH=.

AM_TESTS_ENVIRONMENT = \
    export REDIRECT='exec 2>&9'\
           PYTHON=${PYTHON} \
           PYTHON_VERSION=${PYTHON_VERSION} \
           PYTHONPATH=. \
           MAKEFLAGS=--no-print-directory \
			  GNUCAP_PLUGPATH=$(top_builddir)/misc/.libs:${GNUCAP_PLUGPATH} \
           srcdir='$(srcdir)';
AM_TESTS_FD_REDIRECT = 9>&2
TEST_EXTENSIONS = .gc .py
PY_LOG_COMPILER = $(top_srcdir)/py_log_compiler
GC_LOG_COMPILER = $(top_srcdir)/gc_log_compiler

PY_TESTS = \
	ac.py \
	crash.py \
	comp.py \
	elmt.py \
	matrix.0.py \
	param.py \
	sim.py \
	store.py

GC_TESTS = \
	use_simplugin.gc \
	pz.0.gc \
	pz.0g.gc

pz.0.gc.out: pz_spice.py
pz.0g.gc.out: pz_spice.py
pz_spice.py:
	$(LN_S) $(top_srcdir)/examples/$@

CLEANFILES += pz_spice.py


if PY2
crash.log: PY_LOG_FLAGS=SKIP
CRASH_OUT = crash.py.out
endif

CLEANFILES += ${CRASH_OUT} out3.7 c_python.so

use_simplugin.gc.out: $(PWD)/simplugin.py

if VPATH_BUILD
$(PWD)/%.py: %.py
	$(LN_S) $< $@
endif


TESTS = ${PY_TESTS} ${GC_TESTS}
SED_OUT = sed -e '/^default plugins/s/:.*//' \
	           -e '/^core-lib version/s/:.*//' \
	           -e '/^main version/s/:.*//'

${PY_TESTS:%.py=%.py.out}: %.py.out: %.py
	${PYTHON} < ${srcdir}/$*.py | ${SED_OUT} > $@; exit $${PIPESTATUS[0]}

TLP=.libs${LD_LIBRARY_PATH:%=:%}

${GC_TESTS:%.gc=%.gc.out}: %.gc.out: %.gc
	GNUCAP_PLUGPATH=${GNUCAP_PLUGPATH} \
	PYTHONPATH=${PYTHONPATH} \
	LD_LIBRARY_PATH=${TLP} \
	gnucap < ${srcdir}/$*.gc | ${SED_OUT} > $@

.PHONY: .P
.P:
	@:

$(GC_TESTS:%.gc=%.gc.out): .P
$(PY_TESTS:%.py=%.py.out): .P
$(GC_TESTS:%.gc=%.log): .P
$(PY_TESTS:%.py=%.log): .P

EXTRA_DIST = \
	bootstrap \
	THANKS \
	CONTRIBUTE \
	gc_log_compiler \
	py_log_compiler \
	simplugin.py \
	${TESTS:%=out3.6/%.ref} \
	${TESTS:%=out2.7/%.ref} \
	${TESTS}