summaryrefslogtreecommitdiff
path: root/sed/local.mk
blob: bb949052a24ae86d5a9dede3710f47dd8c0004b9 (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
# Copyright (C) 2016-2023 Free Software Foundation, Inc.

# This program 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.

# This program 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, see <https://www.gnu.org/licenses/>.

bin_PROGRAMS += sed/sed

localedir = $(datadir)/locale

sed_sed_SOURCES =	\
  sed/compile.c		\
  sed/debug.c		\
  sed/execute.c		\
  sed/mbcs.c		\
  sed/regexp.c		\
  sed/sed.c		\
  sed/utils.c

noinst_HEADERS +=	\
  sed/sed.h		\
  sed/utils.h

sed_sed_CPPFLAGS = $(AM_CPPFLAGS) -DLOCALEDIR=\"$(localedir)\"
sed_sed_CFLAGS = $(AM_CFLAGS) $(WARN_CFLAGS) $(WERROR_CFLAGS)
sed_sed_LDADD = sed/libver.a lib/libsed.a \
  $(LIB_ACL) $(QCOPY_ACL_LIB) $(LIB_CLOCK_GETTIME) $(LIB_GETRANDOM) \
  $(LIB_HARD_LOCALE) $(LIB_MBRTOWC) $(LIB_SELINUX) $(LIB_SETLOCALE_NULL) \
  $(LIBINTL) $(LIBTHREAD)
sed_sed_DEPENDENCIES = lib/libsed.a sed/libver.a

$(sed_sed_OBJECTS): $(BUILT_SOURCES)

BUILT_SOURCES += sed/version.c
DISTCLEANFILES += sed/version.c
sed/version.c: Makefile
	$(AM_V_GEN)rm -f $@
	$(AM_V_at)printf '#include <config.h>\n' > $@t
	$(AM_V_at)printf 'char const *Version = "$(PACKAGE_VERSION)";\n' >> $@t
	$(AM_V_at)chmod a-w $@t
	$(AM_V_at)mv $@t $@

BUILT_SOURCES += sed/version.h
DISTCLEANFILES += sed/version.h
sed/version.h: Makefile
	$(AM_V_GEN)rm -f $@
	$(AM_V_at)printf 'extern char const *Version;\n' > $@t
	$(AM_V_at)chmod a-w $@t
	$(AM_V_at)mv $@t $@

noinst_LIBRARIES += sed/libver.a
nodist_sed_libver_a_SOURCES = sed/version.c sed/version.h