summaryrefslogtreecommitdiff
path: root/extension/Makefile.am
blob: 736fa1efa9f46cd07f210e821b4a314c00f418fc (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
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
144
145
146
147
148
149
150
151
152
153
154
155
156
#
# extension/Makefile.am --- automake input file for gawk
#
# Copyright (C) 1995-2006, 2012-2015, 2017, 2020, 2021, 2022,
# the Free Software Foundation, Inc.
#
# This file is part of GAWK, the GNU implementation of the
# AWK Programming Language.
#
# GAWK is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# GAWK is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
#

## Process this file with automake to produce Makefile.in.

AM_CPPFLAGS = -I$(srcdir)/..

# This variable insures that aclocal runs
# correctly after changing configure.ac
ACLOCAL_AMFLAGS = -I ../m4

# For some make's, e.g. OpenBSD, that don't define this
RM = rm -f

pkgextension_LTLIBRARIES =	\
	filefuncs.la	\
	fnmatch.la	\
	fork.la		\
	inplace.la	\
	intdiv.la	\
	ordchr.la	\
	readdir.la	\
	readfile.la	\
	revoutput.la	\
	revtwoway.la	\
	rwarray.la	\
	time.la

noinst_LTLIBRARIES =	\
	readdir_test.la	\
	testext.la

MY_MODULE_FLAGS = -module -avoid-version -no-undefined
# On Cygwin, gettext requires that we link with -lintl
MY_LIBS = $(LTLIBINTL)

filefuncs_la_SOURCES  = filefuncs.c stack.h stack.c gawkfts.h \
			gawkfts.c gawkdirfd.h
filefuncs_la_LDFLAGS  = $(MY_MODULE_FLAGS)
filefuncs_la_LIBADD   = $(MY_LIBS)

fnmatch_la_SOURCES    = fnmatch.c
fnmatch_la_LDFLAGS    = $(MY_MODULE_FLAGS)
fnmatch_la_LIBADD     = $(MY_LIBS)

fork_la_SOURCES       = fork.c
fork_la_LDFLAGS       = $(MY_MODULE_FLAGS)
fork_la_LIBADD        = $(MY_LIBS)

inplace_la_SOURCES    = inplace.c
inplace_la_LDFLAGS    = $(MY_MODULE_FLAGS)
inplace_la_LIBADD     = $(MY_LIBS)

# On Cygwin, intdiv has to be linked with the MPFR and GMP libraries.
# Solaris in addition wants the math library.
intdiv_la_SOURCES     = intdiv.c
intdiv_la_LDFLAGS     = $(MY_MODULE_FLAGS)
intdiv_la_LIBADD      = $(MY_LIBS) $(LIBMPFR) -lm

ordchr_la_SOURCES     = ordchr.c
ordchr_la_LDFLAGS     = $(MY_MODULE_FLAGS)
ordchr_la_LIBADD      = $(MY_LIBS)

readdir_la_SOURCES    = readdir.c gawkdirfd.h
readdir_la_LDFLAGS    = $(MY_MODULE_FLAGS)
readdir_la_LIBADD     = $(MY_LIBS)

readfile_la_SOURCES   = readfile.c
readfile_la_LDFLAGS   = $(MY_MODULE_FLAGS)
readfile_la_LIBADD    = $(MY_LIBS)

revoutput_la_SOURCES  = revoutput.c
revoutput_la_LDFLAGS  = $(MY_MODULE_FLAGS)
revoutput_la_LIBADD   = $(MY_LIBS)

revtwoway_la_SOURCES  = revtwoway.c
revtwoway_la_LDFLAGS  = $(MY_MODULE_FLAGS)
revtwoway_la_LIBADD   = $(MY_LIBS)

# On Cygwin, rwarray has to be linked with the MPFR and GMP libraries.
rwarray_la_SOURCES    = rwarray.c
rwarray_la_LDFLAGS    = $(MY_MODULE_FLAGS)
rwarray_la_LIBADD     = $(MY_LIBS) $(LIBMPFR)

time_la_SOURCES       = time.c
time_la_LDFLAGS       = $(MY_MODULE_FLAGS)
time_la_LIBADD        = $(MY_LIBS)

# N.B. Becaues we are not installing testext, we must specify -rpath in
# LDFLAGS to get automake to build a shared library, since it needs
# an installation path.
# On Cygwin, testext has to be linked with the MPFR and GMP libraries.
testext_la_SOURCES    = testext.c
testext_la_LDFLAGS    = $(MY_MODULE_FLAGS) -rpath /foo
testext_la_LIBADD     = $(MY_LIBS) $(LIBMPFR)

# N.B. Because we are not installing readdir_test, we must specify -rpath in
# LDFLAGS to get automake to build a shared library, since it needs
# an installation path.
readdir_test_la_SOURCES = readdir_test.c
readdir_test_la_LDFLAGS = $(MY_MODULE_FLAGS) -rpath /foo
readdir_test_la_LIBADD  = $(MY_LIBS)

install-data-hook:
	for i in $(pkgextension_LTLIBRARIES) ; do \
		$(RM) $(DESTDIR)$(pkgextensiondir)/$$i ; \
	done

# Keep the uninstall check working:
uninstall-so:
	$(RM) $(DESTDIR)$(pkgextensiondir)/*.so
	$(RM) $(DESTDIR)$(pkgextensiondir)/*.dll
	$(RM) $(DESTDIR)$(pkgextensiondir)/*.a
	$(RM) $(DESTDIR)$(pkgextensiondir)/*.lib

uninstall-recursive: uninstall-so

EXTRA_DIST =  \
	ChangeLog \
	ChangeLog.0 \
	ChangeLog.1 \
	ext_custom.h \
	fts.3 \
	README.fts

dist_man_MANS = \
	filefuncs.3am fnmatch.3am fork.3am inplace.3am \
	ordchr.3am readdir.3am readfile.3am revoutput.3am \
	revtwoway.3am rwarray.3am time.3am

# gettext requires this
SUBDIRS = po

distclean-local:
	rm -fr .deps