35ddefe2e385a13abd12d06c10d49ef831b24ae4
[platform/upstream/diffutils.git] / src / Makefile.am
1 # Automakefile for GNU diffutils programs.
2
3 # Copyright (C) 2001-2002, 2006, 2009-2013, 2015-2018 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   $(LIBCSTACK) \
30   $(LIBINTL) \
31   $(LIBICONV) \
32   $(LIBSIGSEGV) \
33   $(LIB_CLOCK_GETTIME)
34
35 diff_LDADD = $(LDADD)
36 cmp_LDADD = $(LDADD)
37 sdiff_LDADD = $(LDADD)
38 diff3_LDADD = $(LDADD)
39
40 cmp_SOURCES = cmp.c
41 diff3_SOURCES = diff3.c
42 sdiff_SOURCES = sdiff.c
43 diff_SOURCES = \
44   analyze.c context.c diff.c dir.c ed.c ifdef.c io.c \
45   normal.c side.c util.c
46 noinst_HEADERS =        \
47   die.h                 \
48   diff.h                \
49   system.h
50
51 MOSTLYCLEANFILES = paths.h paths.ht
52
53 cmp.$(OBJEXT) diff3.$(OBJEXT) diff.$(OBJEXT) sdiff.$(OBJEXT): paths.h
54
55 gdiff = `echo diff|sed '$(transform)'`
56 BUILT_SOURCES = paths.h
57 paths.h: Makefile.am
58         $(AM_V_GEN)(echo '#define DEFAULT_DIFF_PROGRAM "'$(gdiff)'"' && \
59           echo '#define LOCALEDIR "$(localedir)"') >$@t && mv $@t $@
60
61 noinst_LIBRARIES = libver.a
62 nodist_libver_a_SOURCES = version.c version.h
63
64 BUILT_SOURCES += version.c
65 version.c: Makefile
66         $(AM_V_GEN)rm -f $@
67         $(AM_V_at)printf '#include <config.h>\n' > $@t
68         $(AM_V_at)printf 'char const *Version = "$(PACKAGE_VERSION)";\n' >> $@t
69         $(AM_V_at)chmod a-w $@t
70         $(AM_V_at)mv $@t $@
71
72 BUILT_SOURCES += version.h
73 version.h: Makefile
74         $(AM_V_GEN)rm -f $@
75         $(AM_V_at)printf 'extern char const *Version;\n' > $@t
76         $(AM_V_at)chmod a-w $@t
77         $(AM_V_at)mv $@t $@
78
79 DISTCLEANFILES = version.c version.h
80 MAINTAINERCLEANFILES = $(BUILT_SOURCES)