1 # Automakefile for GNU diffutils programs.
3 # Copyright (C) 2001-2002, 2006, 2009-2013, 2015-2018 Free Software Foundation,
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.
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.
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/>.
19 bin_PROGRAMS = cmp diff diff3 sdiff
21 localedir = $(datadir)/locale
23 AM_CPPFLAGS = -I../lib -I$(top_srcdir)/lib
24 AM_CFLAGS = $(WARN_CFLAGS) $(WERROR_CFLAGS)
28 ../lib/libdiffutils.a \
37 sdiff_LDADD = $(LDADD)
38 diff3_LDADD = $(LDADD)
41 diff3_SOURCES = diff3.c
42 sdiff_SOURCES = sdiff.c
44 analyze.c context.c diff.c dir.c ed.c ifdef.c io.c \
45 normal.c side.c util.c
51 MOSTLYCLEANFILES = paths.h paths.ht
53 cmp.$(OBJEXT) diff3.$(OBJEXT) diff.$(OBJEXT) sdiff.$(OBJEXT): paths.h
55 gdiff = `echo diff|sed '$(transform)'`
56 BUILT_SOURCES = paths.h
58 $(AM_V_GEN)(echo '#define DEFAULT_DIFF_PROGRAM "'$(gdiff)'"' && \
59 echo '#define LOCALEDIR "$(localedir)"') >$@t && mv $@t $@
61 noinst_LIBRARIES = libver.a
62 nodist_libver_a_SOURCES = version.c version.h
64 BUILT_SOURCES += version.c
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
72 BUILT_SOURCES += version.h
75 $(AM_V_at)printf 'extern char const *Version;\n' > $@t
76 $(AM_V_at)chmod a-w $@t
79 DISTCLEANFILES = version.c version.h
80 MAINTAINERCLEANFILES = $(BUILT_SOURCES)