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