1# Library versioning (C:R:A == current:revision:age)
2#
3# Various contradictory rules can be found for library versioning,
4# but we shall follow these:
5#
6#   https://www.sourceware.org/autobook/autobook/autobook_61.html
7#
8# In summation,
9#
10#   * If the library source code has changed at all since the last
11#     update, then we update the revision number.
12#
13#   * If any public interfaces have been added, removed, or changed
14#     since the last update, we increment the "current" number, and
15#     set the revision number to 0.
16#
17#   * If any interfaces have been added since the last public release,
18#     then we increment the "age" number. If any interfaces have been
19#     changed or removed, set the "age" to 0.
20#
21LIBSYMMETRICA_LT_VERSION = 2:0:0
22
23# The top-level symmetrica.h is meant to be included by consumers; the
24# original def.h and macro.h are thereby pulled in from the symmetrica
25# subdirectory. This avoids name clashes from installing the generically-
26# named def.h and macro.h in the global include path.
27include_HEADERS = symmetrica.h
28pkginclude_HEADERS = def.h macro.h
29
30lib_LTLIBRARIES = libsymmetrica.la
31
32# Always include the version script in the distribution tarball,
33# even if it might not get used; we won't know that until later.
34EXTRA_DIST = symmetrica.map
35
36libsymmetrica_la_LD_VERSION_SCRIPT =
37if HAVE_LD_VERSION_SCRIPT
38libsymmetrica_la_LD_VERSION_SCRIPT += -Wl,--version-script=$(top_srcdir)/src/symmetrica.map
39
40# Depend on symmetrica.map for the link step, so that changes to the
41# map file will trigger a re-link of the library.
42EXTRA_libsymmetrica_la_DEPENDENCIES = symmetrica.map
43endif
44
45# -DFAST disables some runtime checks in src/macro.h to speed things up.
46#
47# -DALLTRUE defines a bunch of other constants in def.h that ultimately
48# enable every symmetrica "subsystem."
49libsymmetrica_la_CPPFLAGS = -DFAST -DALLTRUE
50
51libsymmetrica_la_CFLAGS =
52if HAVE_WNO_UNUSED_RESULT
53# The library consistently ignores the return values of things like
54# scanf and fscanf, so it's counterproductive to emit a million
55# warnings about it.
56libsymmetrica_la_CFLAGS += -Wno-unused-result
57endif
58
59test_CFLAGS=
60if HAVE_FNO_MS_COMPATIBILITY
61# def.h defines its own min() and max() functions that clash with the
62# ones defined in the Windows SDK's version of stdlib.h. The ones in
63# stdlib.h are disabled when __STDC__ is defined truthy, but for
64# bug-compatibility with MSVC, clang doesn't do that by default when
65# it's targeting Windows. This flag, when it exists, disables
66# compatibility mode in clang, and makes the whole endeavor succeed.
67# In particular this is needed to compile using clang for Windows
68# and the Windows SDK headers.
69libsymmetrica_la_CFLAGS += -fno-ms-compatibility
70test_CFLAGS += -fno-ms-compatibility
71endif
72
73
74libsymmetrica_la_SOURCES = \
75	bar.c \
76	bi.c \
77	boe.c \
78	bruch.c \
79	classical.c \
80	de.c \
81	di.c \
82	ff.c \
83	galois.c \
84	ga.c \
85	gra.c \
86	hash.c \
87	hiccup.c \
88	io.c \
89	ko.c \
90	list.c \
91	lo.c \
92	ma.c \
93	mee.c \
94	mem.c \
95	mes.c \
96	mhe.c \
97	mhh.c \
98	mhm.c \
99	mhp.c \
100	mhs.c \
101	mmm.c \
102	mms.c \
103	mod_dg_sbd.c \
104	mo.c \
105	mpp.c \
106	mps.c \
107	mse.c \
108	msh.c \
109	msm.c \
110	mss.c \
111	muir.c \
112	na.c \
113	nb.c \
114	nc.c \
115	nu.c \
116	part.c \
117	pee.c \
118	peh.c \
119	pem.c \
120	perm.c \
121	pes.c \
122	phe.c \
123	phh.c \
124	phm.c \
125	phs.c \
126	plet.c \
127	pme.c \
128	pmh.c \
129	poly.c \
130	ppe.c \
131	pph.c \
132	ppm.c \
133	ppp.c \
134	pps.c \
135	pr.c \
136	pse.c \
137	psh.c \
138	psm.c \
139	pss.c \
140	rest.c \
141	rh.c \
142	sab.c \
143	sb.c \
144	sc.c \
145	sr.c \
146	ta.c \
147	teh.c \
148	tem.c \
149	tep.c \
150	tes.c \
151	the.c \
152	thm.c \
153	thp.c \
154	ths.c \
155	tme.c \
156	tmh.c \
157	tmp.c \
158	tms.c \
159	tpe.c \
160	tph.c \
161	tpm.c \
162	tps.c \
163	tse.c \
164	tsh.c \
165	tsm.c \
166	tsp.c \
167	vc.c \
168	zo.c \
169	zykelind.c \
170	zyk.c
171
172# The -no-undefined flag is required to create a Windows DLL,
173# because that platform does not support shared libraries with
174# undefined symbols in them. Symmetrica, however, does not rely
175# on undefined symbols in the first place. So, we append the
176# flag unconditionally.
177libsymmetrica_la_LDFLAGS = \
178	-version-info $(LIBSYMMETRICA_LT_VERSION) \
179	$(libsymmetrica_la_LD_VERSION_SCRIPT) \
180	-no-undefined
181
182libsymmetrica_la_LIBADD = $(LIBM)
183
184
185# The "test" executable itself.
186test_CPPFLAGS = $(libsymmetrica_la_CPPFLAGS)
187test_SOURCES = test.c
188test_LDADD = libsymmetrica.la
189
190# The "test" executable should be built only during "make check".
191check_PROGRAMS = test
192
193# Also include the test runner as necessary stuff for "make check".
194check_SCRIPTS = run-tests.sh
195
196# Finally, tell the build system what test suites exist.
197TESTS = $(check_SCRIPTS)
198