Debian Codegraph @

src/Makefile.am

raw
1 # Automakefile for GNU diffutils programs.
2
3 # Copyright (C) 2001-2002, 2006, 2009-2013, 2015-2025 Free Software Foundation,
4 # Inc.
5
6 # This program is free software: you can redistribute it and/or modify
7 # it under the terms of the GNU General Public License as published by
8 # the Free Software Foundation, either version 3 of the License, or
9 # (at your option) any later version.
10
11 # This program is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 # GNU General Public License for more details.
15
16 # You should have received a copy of the GNU General Public License
17 # along with this program. If not, see <http://www.gnu.org/licenses/>.
18
19 bin_PROGRAMS = cmp diff diff3 sdiff
20
21 localedir = $(datadir)/locale
22
23 AM_CPPFLAGS = -I../lib -I$(top_srcdir)/lib
24 AM_CFLAGS = $(WARN_CFLAGS) $(WERROR_CFLAGS)
25
26 LDADD = \
27 libver.a \
28 ../lib/libdiffutils.a \
29 $(CLOCK_TIME_LIB) \
30 $(HARD_LOCALE_LIB) \
31 $(LIBTHREAD) \
32 $(LIBCSTACK) \
33 $(LIBINTL) \
34 $(LIBSIGSEGV) \
35 $(LIBUNISTRING) \
36 $(MBRTOWC_LIB) \
37 $(LIBC32CONV) \
38 $(SETLOCALE_NULL_LIB)
39
40 diff_LDADD = $(LDADD)
41 cmp_LDADD = $(LDADD)
42 sdiff_LDADD = $(LDADD) $(GETRANDOM_LIB)
43 diff3_LDADD = $(LDADD)
44
45 cmp_SOURCES = cmp.c system.c
46 diff3_SOURCES = diff3.c system.c
47 sdiff_SOURCES = sdiff.c system.c
48 diff_SOURCES = \
49 analyze.c context.c diff.c dir.c ed.c ifdef.c io.c \
50 normal.c side.c system.c util.c
51 noinst_HEADERS = diff.h system.h
52
53 MOSTLYCLEANFILES = paths.h paths.ht
54
55 cmp.$(OBJEXT) diff3.$(OBJEXT) diff.$(OBJEXT) sdiff.$(OBJEXT): paths.h version.h
56
57 gdiff = `echo diff|sed '$(transform)'`
58 BUILT_SOURCES = paths.h
59 paths.h: Makefile.am
60 $(AM_V_GEN)(echo '#define DEFAULT_DIFF_PROGRAM "'$(gdiff)'"' && \
61 echo '#define LOCALEDIR "$(localedir)"') >$@t && mv $@t $@
62
63 noinst_LIBRARIES = libver.a
64 nodist_libver_a_SOURCES = version.c version.h
65
66 BUILT_SOURCES += version.c
67 version.c: Makefile
68 $(AM_V_GEN)rm -f $@
69 $(AM_V_at)printf '#include <config.h>\n' > $@t
70 $(AM_V_at)printf '#include <version.h>\n' >> $@t
71 $(AM_V_at)printf 'char const *Version = "$(PACKAGE_VERSION)";\n' >> $@t
72 $(AM_V_at)chmod a-w $@t
73 $(AM_V_at)mv $@t $@
74
75 BUILT_SOURCES += version.h
76 version.h: Makefile
77 $(AM_V_GEN)rm -f $@
78 $(AM_V_at)printf 'extern char const *Version;\n' > $@t
79 $(AM_V_at)chmod a-w $@t
80 $(AM_V_at)mv $@t $@
81
82 DISTCLEANFILES = version.c version.h
83 MAINTAINERCLEANFILES = $(BUILT_SOURCES)