~ubuntu-branches/ubuntu/utopic/coreutils/utopic-proposed

« back to all changes in this revision

Viewing changes to Makefile.am

  • Committer: Package Import Robot
  • Author(s): Colin Watson
  • Date: 2012-11-28 03:03:42 UTC
  • mfrom: (8.3.4 sid)
  • Revision ID: package-import@ubuntu.com-20121128030342-21zanj8354gas5gr
Tags: 8.20-3ubuntu1
* Resynchronise with Debian.  Remaining changes:
  - Make 'uname -i -p' return the real processor/hardware, instead of
    unknown.
  - Build-depend on gettext:any instead of on gettext, so that apt-get can
    properly resolve build-dependencies on the tool when cross-building.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
# Make coreutils.                                       -*-Makefile-*-
2
2
 
3
 
# Copyright (C) 1990, 1993-2011 Free Software Foundation, Inc.
 
3
# Copyright (C) 1990-2012 Free Software Foundation, Inc.
4
4
 
5
5
# This program is free software: you can redistribute it and/or modify
6
6
# it under the terms of the GNU General Public License as published by
17
17
 
18
18
ALL_RECURSIVE_TARGETS =
19
19
 
20
 
SUBDIRS = lib src doc man po tests gnulib-tests
 
20
SUBDIRS = po . gnulib-tests
21
21
 
22
22
changelog_etc =                         \
23
23
  ChangeLog-2005                        \
49
49
  THANKStt.in                           \
50
50
  bootstrap                             \
51
51
  bootstrap.conf                        \
52
 
  build-aux/cvsu                        \
 
52
  build-aux/gen-lists-of-programs.sh    \
53
53
  cfg.mk                                \
54
54
  dist-check.mk                         \
55
55
  maint.mk                              \
 
56
  tests/GNUmakefile                     \
56
57
  thanks-gen
57
58
 
58
 
ALL_RECURSIVE_TARGETS += install-root
59
 
install-root:
60
 
        cd src && $(MAKE) $@
 
59
gen_progs_lists = $(top_srcdir)/build-aux/gen-lists-of-programs.sh
 
60
 
 
61
# Keep these in sync with bootstrap.conf:bootstrap_post_import_hook().
 
62
# Use '$(top_srcdir)/m4' and '$(srcdir)/src' for the benefit of non-GNU
 
63
# makes: it is with those directories that 'cu-progs.m4' and 'cu-progs.mk'
 
64
# appear in our dependencies.
 
65
$(top_srcdir)/m4/cu-progs.m4: $(gen_progs_lists)
 
66
        $(AM_V_GEN)rm -f $@ $@-t \
 
67
          && $(SHELL) $(gen_progs_lists) --autoconf >$@-t \
 
68
          && chmod a-w $@-t && mv -f $@-t $@
 
69
$(srcdir)/src/cu-progs.mk: $(gen_progs_lists)
 
70
        $(AM_V_GEN)rm -f $@ $@-t \
 
71
          && $(SHELL) $(gen_progs_lists) --automake >$@-t \
 
72
          && chmod a-w $@-t && mv -f $@-t $@
61
73
 
62
74
ACLOCAL_AMFLAGS = -I m4
63
75
 
64
 
# Some tests always need root privileges, others need them only sometimes.
65
 
ALL_RECURSIVE_TARGETS += check-root
66
 
check-root:
67
 
        cd tests && $(MAKE) $@ SUBDIRS=
 
76
# Shortcut targets to make it easier to run (very) expensive tests.
 
77
check-expensive:
 
78
        $(MAKE) check RUN_EXPENSIVE_TESTS=yes
 
79
check-very-expensive:
 
80
        $(MAKE) check-expensive RUN_VERY_EXPENSIVE_TESTS=yes
68
81
 
69
82
# Just prior to distribution, ...
70
 
# transform the automake-generated rule that runs `rm -f rm'.
 
83
# transform the automake-generated rule that runs 'rm -f rm'.
71
84
# On some systems, that command would fail with a diagnostic like
72
 
# `rm: cannot unlink `rm': Text file busy' when `.' appears so early
73
 
# in the shell's search path that running `rm' would run the `rm'
 
85
# "rm: cannot unlink 'rm': Text file busy" when '.' appears so early
 
86
# in the shell's search path that running 'rm' would run the 'rm'
74
87
# executable in the current directory.
75
88
# Similarly, adjust the clean-binPROGRAMS rule.
76
89
rm_subst = \
80
93
.version:
81
94
        $(AM_V_GEN)echo $(VERSION) > $@-t && mv $@-t $@
82
95
 
 
96
# In general, we run help2man to build a man page from the binary's --help
 
97
# output, but when building from a just-unpacked distribution tarball, we
 
98
# must not do that, since help2man uses perl.  We don't want to depend on
 
99
# perl in that case.  In general, the .1 file does indeed depend on the
 
100
# binary.  I.e., for cat, we have this Makefile dependency:
 
101
#   man/cat.1: src/cat
 
102
# That means that once we build src/cat, we would trigger the .x.1
 
103
# rule which runs help2man.  The trick is simply to change the RHS to
 
104
# "src/cat.c" in the $(distdir) that we're about to tar and compress.
 
105
# Also handle the three exceptions corresponding to the three binaries
 
106
# for which there is no like-named .c file: dir, vdir, ginstall.
 
107
.PHONY: do-not-require-help2man
 
108
do-not-require-help2man:
 
109
        perl -pi -e 's,^(man/.+?\.1:\s*src/.+?)$$,$$1.c,;'              \
 
110
            -e  's,^(man/.+?\.1:\s*src)/ginstall\.c$$,$$1/install.c,;'  \
 
111
            -e  's,^(man/.+?\.1:\s*src)/v?dir\.c$$,$$1/ls.c,;'          \
 
112
          $(distdir)/Makefile.in
 
113
 
83
114
# Arrange so that .tarball-version appears only in the distribution
84
115
# tarball, and never in a checked-out repository.
85
116
# The perl substitution is to change some key uses of "rm" to "/bin/rm".
86
117
# See the rm_subst comment for details.
87
 
dist-hook: gen-ChangeLog
 
118
dist-hook: gen-ChangeLog do-not-require-help2man
88
119
        $(AM_V_GEN)echo $(VERSION) > $(distdir)/.tarball-version
89
 
        $(AM_V_at)perl -pi -e '$(rm_subst)' $(distdir)/src/Makefile.in
 
120
        $(AM_V_at)perl -pi -e '$(rm_subst)' $(distdir)/Makefile.in
90
121
 
91
122
gen_start_date = 2008-02-08
92
123
.PHONY: gen-ChangeLog
93
124
gen-ChangeLog:
94
125
        $(AM_V_GEN)if test -d .git; then                                \
95
126
          $(top_srcdir)/build-aux/gitlog-to-changelog                   \
 
127
            --amend=$(srcdir)/build-aux/git-log-fix                     \
96
128
            --since=$(gen_start_date) > $(distdir)/cl-t;                \
97
129
          rm -f $(distdir)/ChangeLog;                                   \
98
130
          mv $(distdir)/cl-t $(distdir)/ChangeLog;                      \
136
168
prologue = perl -ne '/^\#\#/ and exit; print' $(srcdir)/THANKS.in
137
169
 
138
170
THANKS: THANKS.in Makefile.am .mailmap thanks-gen .version
139
 
        $(AM_V_GEN)                                                     \
 
171
        $(AM_V_GEN)rm -f $@-t $@;                                       \
140
172
        {                                                               \
141
173
          $(prologue); echo;                                            \
142
174
          { perl -ne '/^$$/.../^$$/ and print' $(srcdir)/THANKS.in      \
147
179
            | LC_ALL=en_US.UTF-8 sort -f;                               \
148
180
          echo;                                                         \
149
181
          printf ';; %s\n' 'Local Variables:' 'coding: utf-8' End:;     \
150
 
        } > $@-t && mv $@-t $@
 
182
        } > $@-t && chmod a-w $@-t && mv $@-t $@
 
183
 
 
184
# Some of our git hook scripts are supposed to be identical to git's samples.
 
185
# See if they are still in sync.
 
186
.PHONY: check-git-hook-script-sync
 
187
check-git-hook-script-sync:
 
188
        @fail=0;                                                        \
 
189
        t=$$(mktemp -d)                                                 \
 
190
          && cd $$t && git init -q && cd .git/hooks                     \
 
191
          && for i in pre-commit pre-applypatch applypatch-msg; do      \
 
192
               diff $(abs_top_srcdir)/scripts/git-hooks/$$i $$i.sample  \
 
193
                 || fail=1;                                             \
 
194
             done;                                                      \
 
195
        rm -rf $$t;                                                     \
 
196
        test $$fail = 0
 
197
 
 
198
noinst_LIBRARIES =
 
199
MOSTLYCLEANFILES =
 
200
CLEANFILES =
 
201
MOSTLYCLEANDIRS =
 
202
 
 
203
AM_CPPFLAGS = -Ilib -I$(top_srcdir)/lib -Isrc -I$(top_srcdir)/src
 
204
 
 
205
include $(top_srcdir)/lib/local.mk
 
206
include $(top_srcdir)/src/local.mk
 
207
include $(top_srcdir)/doc/local.mk
 
208
include $(top_srcdir)/man/local.mk
 
209
include $(top_srcdir)/tests/local.mk