1 # Make coreutils programs. -*-Makefile-*-
2 # This is included by the top-level Makefile.am.
4 ## Copyright (C) 1990-2022 Free Software Foundation, Inc.
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 <https://www.gnu.org/licenses/>.
19 # FIXME: once lib/ and gnulib-tests/ are also converted, hoist to Makefile.am
20 AM_CFLAGS
= $(WERROR_CFLAGS
)
22 # The list of all programs (separated in different variables to express
23 # the how and when they should be installed) is defined in this makefile
24 # fragment, autogenerated by the 'gen-lists-of-programs.sh' auxiliary
26 include $(srcdir)/src
/cu-progs.mk
29 $(no_install__progs
) \
30 $(build_if_possible__progs
) \
33 # The user can tweak these lists at configure time.
34 bin_PROGRAMS
= @bin_PROGRAMS@
35 pkglibexec_PROGRAMS
= @pkglibexec_PROGRAMS@
37 # Needed by the testsuite.
49 src
/find-mount-point.h \
71 CLEANFILES
+= $(SCRIPTS
)
73 # Also remove these sometimes-built programs.
74 # For example, even when excluded, they're built via 'sc_check-AUTHORS'
76 CLEANFILES
+= $(no_install__progs
)
78 noinst_LIBRARIES
+= src
/libver.a
79 nodist_src_libver_a_SOURCES
= src
/version.c src
/version.h
81 # Tell the linker to omit references to unused shared libraries.
82 AM_LDFLAGS
= $(IGNORE_UNUSED_LIBRARIES_CFLAGS
)
84 # Extra libraries needed by more than one program. Will be updated later.
88 # Sometimes, the expansion of $(LIBINTL) includes -lc which may
89 # include modules defining variables like 'optind', so libcoreutils.a
90 # must precede $(LIBINTL) in order to ensure we use GNU getopt.
91 # But libcoreutils.a must also follow $(LIBINTL), since libintl uses
92 # replacement functions defined in libcoreutils.a.
93 # Similarly for $(LIB_MBRTOWC).
94 LDADD
= src
/libver.a lib
/libcoreutils.a
$(LIBINTL
) $(LIB_MBRTOWC
) \
97 # First, list all programs, to make listing per-program libraries easier.
99 src_arch_LDADD
= $(LDADD
)
100 src_base64_LDADD
= $(LDADD
)
101 src_base32_LDADD
= $(LDADD
)
102 src_basenc_LDADD
= $(LDADD
)
103 src_basename_LDADD
= $(LDADD
)
104 src_cat_LDADD
= $(LDADD
)
105 src_chcon_LDADD
= $(LDADD
)
106 src_chgrp_LDADD
= $(LDADD
)
107 src_chmod_LDADD
= $(LDADD
)
108 src_chown_LDADD
= $(LDADD
)
109 src_chroot_LDADD
= $(LDADD
)
110 src_cksum_LDADD
= $(LDADD
)
111 src_comm_LDADD
= $(LDADD
)
112 src_nproc_LDADD
= $(LDADD
)
113 src_cp_LDADD
= $(LDADD
)
115 src_coreutils_LDADD
= $(LDADD
)
117 src_csplit_LDADD
= $(LDADD
)
118 src_cut_LDADD
= $(LDADD
)
119 src_date_LDADD
= $(LDADD
)
120 src_dd_LDADD
= $(LDADD
)
121 src_df_LDADD
= $(LDADD
)
122 # See dir_LDADD below
123 src_dircolors_LDADD
= $(LDADD
)
124 src_dirname_LDADD
= $(LDADD
)
125 src_du_LDADD
= $(LDADD
)
126 src_echo_LDADD
= $(LDADD
)
127 src_env_LDADD
= $(LDADD
)
128 src_expand_LDADD
= $(LDADD
)
129 src_expr_LDADD
= $(LDADD
)
130 src_factor_LDADD
= $(LDADD
)
131 src_false_LDADD
= $(LDADD
)
132 src_fmt_LDADD
= $(LDADD
)
133 src_fold_LDADD
= $(LDADD
)
134 src_getlimits_LDADD
= $(LDADD
)
135 src_ginstall_LDADD
= $(LDADD
)
136 src_groups_LDADD
= $(LDADD
)
137 src_head_LDADD
= $(LDADD
)
138 src_hostid_LDADD
= $(LDADD
)
139 src_hostname_LDADD
= $(LDADD
)
140 src_id_LDADD
= $(LDADD
)
141 src_join_LDADD
= $(LDADD
)
142 src_kill_LDADD
= $(LDADD
)
143 src_link_LDADD
= $(LDADD
)
144 src_ln_LDADD
= $(LDADD
)
145 src_logname_LDADD
= $(LDADD
)
146 src_ls_LDADD
= $(LDADD
)
148 # This must *not* depend on anything in lib/, since it is used to generate
149 # src/primes.h. If it depended on libcoreutils.a, that would pull all lib/*.c
150 # into BUILT_SOURCES.
151 src_make_prime_list_LDADD
=
153 src_md5sum_LDADD
= $(LDADD
)
154 src_mkdir_LDADD
= $(LDADD
)
155 src_mkfifo_LDADD
= $(LDADD
)
156 src_mknod_LDADD
= $(LDADD
)
157 src_mktemp_LDADD
= $(LDADD
)
158 src_mv_LDADD
= $(LDADD
)
159 src_nice_LDADD
= $(LDADD
)
160 src_nl_LDADD
= $(LDADD
)
161 src_nohup_LDADD
= $(LDADD
)
162 src_numfmt_LDADD
= $(LDADD
)
163 src_od_LDADD
= $(LDADD
)
164 src_paste_LDADD
= $(LDADD
)
165 src_pathchk_LDADD
= $(LDADD
)
166 src_pinky_LDADD
= $(LDADD
)
167 src_pr_LDADD
= $(LDADD
)
168 src_printenv_LDADD
= $(LDADD
)
169 src_printf_LDADD
= $(LDADD
)
170 src_ptx_LDADD
= $(LDADD
)
171 src_pwd_LDADD
= $(LDADD
)
172 src_readlink_LDADD
= $(LDADD
)
173 src_realpath_LDADD
= $(LDADD
)
174 src_rm_LDADD
= $(LDADD
)
175 src_rmdir_LDADD
= $(LDADD
)
176 src_runcon_LDADD
= $(LDADD
)
177 src_seq_LDADD
= $(LDADD
)
178 src_sha1sum_LDADD
= $(LDADD
)
179 src_sha224sum_LDADD
= $(LDADD
)
180 src_sha256sum_LDADD
= $(LDADD
)
181 src_sha384sum_LDADD
= $(LDADD
)
182 src_sha512sum_LDADD
= $(LDADD
)
183 src_shred_LDADD
= $(LDADD
)
184 src_shuf_LDADD
= $(LDADD
)
185 src_sleep_LDADD
= $(LDADD
)
186 src_sort_LDADD
= $(LDADD
)
187 src_split_LDADD
= $(LDADD
)
188 src_stat_LDADD
= $(LDADD
)
189 src_stdbuf_LDADD
= $(LDADD
)
190 src_stty_LDADD
= $(LDADD
)
191 src_sum_LDADD
= $(LDADD
)
192 src_sync_LDADD
= $(LDADD
)
193 src_tac_LDADD
= $(LDADD
)
194 src_tail_LDADD
= $(LDADD
)
195 src_tee_LDADD
= $(LDADD
)
196 src_test_LDADD
= $(LDADD
)
197 src_timeout_LDADD
= $(LDADD
)
198 src_touch_LDADD
= $(LDADD
)
199 src_tr_LDADD
= $(LDADD
)
200 src_true_LDADD
= $(LDADD
)
201 src_truncate_LDADD
= $(LDADD
)
202 src_tsort_LDADD
= $(LDADD
)
203 src_tty_LDADD
= $(LDADD
)
204 src_uname_LDADD
= $(LDADD
)
205 src_unexpand_LDADD
= $(LDADD
)
206 src_uniq_LDADD
= $(LDADD
)
207 src_unlink_LDADD
= $(LDADD
)
208 src_uptime_LDADD
= $(LDADD
)
209 src_users_LDADD
= $(LDADD
)
210 # See vdir_LDADD below
211 src_wc_LDADD
= $(LDADD
)
212 src_who_LDADD
= $(LDADD
)
213 src_whoami_LDADD
= $(LDADD
)
214 src_yes_LDADD
= $(LDADD
)
216 # Synonyms. Recall that Automake transliterates '[' and '/' to '_'.
217 src___LDADD
= $(src_test_LDADD
)
218 src_dir_LDADD
= $(src_ls_LDADD
)
219 src_vdir_LDADD
= $(src_ls_LDADD
)
221 src_cp_LDADD
+= $(copy_ldadd
)
222 src_ginstall_LDADD
+= $(copy_ldadd
)
223 src_mv_LDADD
+= $(copy_ldadd
)
225 src_mv_LDADD
+= $(remove_ldadd
)
226 src_rm_LDADD
+= $(remove_ldadd
)
228 # for eaccess, euidaccess
229 copy_ldadd
+= $(LIB_EACCESS
)
230 remove_ldadd
+= $(LIB_EACCESS
)
231 src_sort_LDADD
+= $(LIB_EACCESS
)
232 src_test_LDADD
+= $(LIB_EACCESS
)
235 copy_ldadd
+= $(LIB_SELINUX
)
236 src_chcon_LDADD
+= $(LIB_SELINUX
)
237 src_ginstall_LDADD
+= $(LIB_SELINUX
)
238 src_id_LDADD
+= $(LIB_SELINUX
)
239 src_id_LDADD
+= $(LIB_SMACK
)
240 src_ls_LDADD
+= $(LIB_SELINUX
)
241 src_ls_LDADD
+= $(LIB_SMACK
)
242 src_mkdir_LDADD
+= $(LIB_SELINUX
)
243 src_mkdir_LDADD
+= $(LIB_SMACK
)
244 src_mkfifo_LDADD
+= $(LIB_SELINUX
)
245 src_mkfifo_LDADD
+= $(LIB_SMACK
)
246 src_mknod_LDADD
+= $(LIB_SELINUX
)
247 src_mknod_LDADD
+= $(LIB_SMACK
)
248 src_runcon_LDADD
+= $(LIB_SELINUX
)
249 src_stat_LDADD
+= $(LIB_SELINUX
)
251 # for nvlist_lookup_uint64_array
252 src_stat_LDADD
+= $(LIB_NVPAIR
)
254 # for gettime, settime, tempname, utimecmp, utimens
255 copy_ldadd
+= $(LIB_CLOCK_GETTIME
)
256 src_date_LDADD
+= $(LIB_CLOCK_GETTIME
)
257 src_ginstall_LDADD
+= $(LIB_CLOCK_GETTIME
)
258 src_ln_LDADD
+= $(LIB_CLOCK_GETTIME
)
259 src_ls_LDADD
+= $(LIB_CLOCK_GETTIME
)
260 src_mktemp_LDADD
+= $(LIB_CLOCK_GETTIME
)
261 src_pr_LDADD
+= $(LIB_CLOCK_GETTIME
)
262 src_tac_LDADD
+= $(LIB_CLOCK_GETTIME
)
263 src_timeout_LDADD
+= $(LIB_TIMER_TIME
)
264 src_touch_LDADD
+= $(LIB_CLOCK_GETTIME
)
267 src_dd_LDADD
+= $(LIB_GETHRXTIME
)
270 src_ls_LDADD
+= $(LIB_CAP
)
273 src_dd_LDADD
+= $(LIB_FDATASYNC
)
274 src_shred_LDADD
+= $(LIB_FDATASYNC
)
275 src_sync_LDADD
+= $(LIB_FDATASYNC
)
278 src_sleep_LDADD
+= $(LIB_NANOSLEEP
)
279 src_sort_LDADD
+= $(LIB_NANOSLEEP
)
280 src_tail_LDADD
+= $(LIB_NANOSLEEP
)
282 # for various GMP functions
283 src_expr_LDADD
+= $(LIBGMP
)
284 src_factor_LDADD
+= $(LIBGMP
)
287 src_uptime_LDADD
+= $(GETLOADAVG_LIBS
)
289 # for various ACL functions
290 copy_ldadd
+= $(LIB_ACL
)
291 src_ls_LDADD
+= $(LIB_HAS_ACL
)
293 # for various xattr functions
294 copy_ldadd
+= $(LIB_XATTR
)
296 # for print_unicode_char, proper_name_utf8
297 src_factor_LDADD
+= $(LIBICONV
)
298 src_printf_LDADD
+= $(LIBICONV
)
299 src_ptx_LDADD
+= $(LIBICONV
)
301 # for libcrypto hash routines
302 src_md5sum_LDADD
+= $(LIB_CRYPTO
)
303 src_sort_LDADD
+= $(LIB_CRYPTO
)
304 src_sha1sum_LDADD
+= $(LIB_CRYPTO
)
305 src_sha224sum_LDADD
+= $(LIB_CRYPTO
)
306 src_sha256sum_LDADD
+= $(LIB_CRYPTO
)
307 src_sha384sum_LDADD
+= $(LIB_CRYPTO
)
308 src_sha512sum_LDADD
+= $(LIB_CRYPTO
)
309 src_cksum_LDADD
+= $(LIB_CRYPTO
)
312 src_pinky_LDADD
+= $(GETADDRINFO_LIB
)
313 src_who_LDADD
+= $(GETADDRINFO_LIB
)
315 # for gethostname, uname
316 src_hostname_LDADD
+= $(GETHOSTNAME_LIB
)
317 src_uname_LDADD
+= $(GETHOSTNAME_LIB
)
320 src_kill_LDADD
+= $(LIBTHREAD
)
322 # for pthread-cond, pthread-mutex, pthread-thread
323 src_sort_LDADD
+= $(LIBPMULTITHREAD
)
325 # for pthread_sigmask
326 src_sort_LDADD
+= $(LIB_PTHREAD_SIGMASK
)
328 # Get the release year from lib/version-etc.c.
330 `sed -n '/.*COPYRIGHT_YEAR = \([0-9][0-9][0-9][0-9]\) };/s//\1/p' \
331 $(top_srcdir)/lib/version-etc.c`
343 # Use 'ginstall' in the definition of PROGRAMS and in dependencies to avoid
344 # confusion with the 'install' target. The install rule transforms 'ginstall'
345 # to install before applying any user-specified name transformations.
347 # Don't apply prefix transformations to libstdbuf shared lib
348 # as that's not generally needed, and we need to reference the
349 # name directly in LD_PRELOAD etc. In general it's surprising
350 # that $(transform) is applied to libexec at all given that is
351 # for internal package naming, not privy to $(transform).
353 transform
= s
/ginstall
/install/;/libstdbuf
/!$(program_transform_name
)
355 src_ginstall_SOURCES
= src
/install.c src
/prog-fprintf.c
$(copy_sources
) \
358 # This is for the '[' program. Automake transliterates '[' and '/' to '_'.
359 src___SOURCES
= src
/lbracket.c
361 nodist_src_coreutils_SOURCES
= src
/coreutils.h
362 src_coreutils_SOURCES
= src
/coreutils.c
364 src_cp_SOURCES
= src
/cp.c
$(copy_sources
) $(selinux_sources
)
365 src_dir_SOURCES
= src
/ls.c src
/ls-dir.c
366 src_env_SOURCES
= src
/env.c src
/operand2sig.c
367 src_vdir_SOURCES
= src
/ls.c src
/ls-vdir.c
368 src_id_SOURCES
= src
/id.c src
/group-list.c
369 src_groups_SOURCES
= src
/groups.c src
/group-list.c
370 src_ls_SOURCES
= src
/ls.c src
/ls-ls.c
371 src_ln_SOURCES
= src
/ln.c \
372 src
/force-link.c src
/force-link.h \
373 src
/relpath.c src
/relpath.h
374 src_chown_SOURCES
= src
/chown.c src
/chown-core.c
375 src_chgrp_SOURCES
= src
/chgrp.c src
/chown-core.c
376 src_kill_SOURCES
= src
/kill.c src
/operand2sig.c
377 src_realpath_SOURCES
= src
/realpath.c src
/relpath.c src
/relpath.h
378 src_timeout_SOURCES
= src
/timeout.c src
/operand2sig.c
380 src_mv_SOURCES
= src
/mv.c src
/remove.c
$(copy_sources
) $(selinux_sources
)
381 src_rm_SOURCES
= src
/rm.c src
/remove.c
383 src_mkdir_SOURCES
= src
/mkdir.c src
/prog-fprintf.c
$(selinux_sources
)
384 src_rmdir_SOURCES
= src
/rmdir.c src
/prog-fprintf.c
386 src_mkfifo_SOURCES
= src
/mkfifo.c
$(selinux_sources
)
387 src_mknod_SOURCES
= src
/mknod.c
$(selinux_sources
)
389 src_df_SOURCES
= src
/df.c src
/find-mount-point.c
390 src_stat_SOURCES
= src
/stat.c src
/find-mount-point.c
392 src_uname_SOURCES
= src
/uname.c src
/uname-uname.c
393 src_arch_SOURCES
= src
/uname.c src
/uname-arch.c
395 src_cut_SOURCES
= src
/cut.c src
/set-fields.c
396 src_numfmt_SOURCES
= src
/numfmt.c src
/set-fields.c
398 src_sum_SOURCES
= src
/sum.c src
/sum.h src
/digest.c
399 src_sum_CPPFLAGS
= -DHASH_ALGO_SUM
=1 $(AM_CPPFLAGS
)
401 src_md5sum_SOURCES
= src
/digest.c
402 src_md5sum_CPPFLAGS
= -DHASH_ALGO_MD5
=1 $(AM_CPPFLAGS
)
403 src_sha1sum_SOURCES
= src
/digest.c
404 src_sha1sum_CPPFLAGS
= -DHASH_ALGO_SHA1
=1 $(AM_CPPFLAGS
)
405 src_sha224sum_SOURCES
= src
/digest.c
406 src_sha224sum_CPPFLAGS
= -DHASH_ALGO_SHA224
=1 $(AM_CPPFLAGS
)
407 src_sha256sum_SOURCES
= src
/digest.c
408 src_sha256sum_CPPFLAGS
= -DHASH_ALGO_SHA256
=1 $(AM_CPPFLAGS
)
409 src_sha384sum_SOURCES
= src
/digest.c
410 src_sha384sum_CPPFLAGS
= -DHASH_ALGO_SHA384
=1 $(AM_CPPFLAGS
)
411 src_sha512sum_SOURCES
= src
/digest.c
412 src_sha512sum_CPPFLAGS
= -DHASH_ALGO_SHA512
=1 $(AM_CPPFLAGS
)
413 src_b2sum_CPPFLAGS
= -DHASH_ALGO_BLAKE2
=1 -DHAVE_CONFIG_H
$(AM_CPPFLAGS
)
414 src_b2sum_SOURCES
= src
/digest.c \
415 src
/blake2
/blake2.h src
/blake2
/blake2-impl.h \
416 src
/blake2
/blake2b-ref.c \
417 src
/blake2
/b2sum.c src
/blake2
/b2sum.h
419 src_cksum_SOURCES
= $(src_b2sum_SOURCES
) src
/sum.c src
/sum.h \
420 src
/cksum.c src
/cksum.h src
/crctab.c
421 src_cksum_CPPFLAGS
= -DHASH_ALGO_CKSUM
=1 -DHAVE_CONFIG_H
$(AM_CPPFLAGS
)
423 noinst_LIBRARIES
+= src
/libcksum_pclmul.a
424 src_libcksum_pclmul_a_SOURCES
= src
/cksum_pclmul.c src
/cksum.h
425 cksum_pclmul_ldadd
= src
/libcksum_pclmul.a
426 src_cksum_LDADD
+= $(cksum_pclmul_ldadd
)
427 src_libcksum_pclmul_a_CFLAGS
= -mavx
-mpclmul
$(AM_CFLAGS
)
430 src_base64_SOURCES
= src
/basenc.c
431 src_base64_CPPFLAGS
= -DBASE_TYPE
=64 $(AM_CPPFLAGS
)
432 src_base32_SOURCES
= src
/basenc.c
433 src_base32_CPPFLAGS
= -DBASE_TYPE
=32 $(AM_CPPFLAGS
)
434 src_basenc_SOURCES
= src
/basenc.c
435 src_basenc_CPPFLAGS
= -DBASE_TYPE
=42 $(AM_CPPFLAGS
)
437 src_expand_SOURCES
= src
/expand.c src
/expand-common.c
438 src_unexpand_SOURCES
= src
/unexpand.c src
/expand-common.c
440 src_wc_SOURCES
= src
/wc.c
441 if USE_AVX2_WC_LINECOUNT
442 noinst_LIBRARIES
+= src
/libwc_avx2.a
443 src_libwc_avx2_a_SOURCES
= src
/wc_avx2.c
444 wc_avx2_ldadd
= src
/libwc_avx2.a
445 src_wc_LDADD
+= $(wc_avx2_ldadd
)
446 src_libwc_avx2_a_CFLAGS
= -mavx2
$(AM_CFLAGS
)
449 # Ensure we don't link against libcoreutils.a as that lib is
450 # not compiled with -fPIC which causes issues on 64 bit at least
451 src_libstdbuf_so_LDADD
= $(LIBINTL
)
453 # Note libstdbuf is only compiled if GCC is available
454 # (as per the check in configure.ac), so these flags should be available.
455 # libtool is probably required to relax this dependency.
456 src_libstdbuf_so_LDFLAGS
= -shared
457 src_libstdbuf_so_CFLAGS
= -fPIC
$(AM_CFLAGS
)
459 BUILT_SOURCES
+= src
/coreutils.h
461 # Single binary dependencies
462 src_coreutils_CFLAGS
= -DSINGLE_BINARY
$(AM_CFLAGS
)
463 #src_coreutils_LDFLAGS = $(AM_LDFLAGS)
464 src_coreutils_LDADD
= $(single_binary_deps
) $(LDADD
) $(single_binary_libs
)
465 src_coreutils_DEPENDENCIES
= $(LDADD
) $(single_binary_deps
)
467 include $(top_srcdir
)/src
/single-binary.mk
469 # Creates symlinks or shebangs to the installed programs when building
470 # coreutils single binary.
471 EXTRA_src_coreutils_DEPENDENCIES
= src
/coreutils_
$(single_binary_install_type
)
474 CLEANFILES
+= src
/coreutils_symlinks
475 src
/coreutils_symlinks
: Makefile
477 $(AM_V_at
)${MKDIR_P} src
478 $(AM_V_at
)for i in x
$(single_binary_progs
); do \
479 test $$i = x
&& continue
; \
480 rm -f src
/$$i$(EXEEXT
) || exit
$$?
; \
481 $(LN_S
) -s coreutils
$(EXEEXT
) src
/$$i$(EXEEXT
) || exit
$$?
; \
484 CLEANFILES
+= src
/coreutils_shebangs
485 src
/coreutils_shebangs
: Makefile
487 $(AM_V_at
)${MKDIR_P} src
488 $(AM_V_at
)for i in x
$(single_binary_progs
); do \
489 test $$i = x
&& continue
; \
490 rm -f src
/$$i$(EXEEXT
) || exit
$$?
; \
491 printf
'#!%s --coreutils-prog-shebang=%s\n' \
492 $(abs_top_builddir
)/src
/coreutils
$(EXEEXT
) $$i \
493 >src
/$$i$(EXEEXT
) || exit
$$?
; \
494 chmod a
+x
,a-w src
/$$i$(EXEEXT
) || exit
$$?
; \
498 $(AM_V_at
)for i in x
$(single_binary_progs
); do \
499 test $$i = x
&& continue
; \
500 rm -f src
/$$i$(EXEEXT
) || exit
$$?
; \
504 BUILT_SOURCES
+= src
/dircolors.h
505 src
/dircolors.h
: src
/dcgen src
/dircolors.hin
506 $(AM_V_GEN
)rm -f
$@
$@
-t
507 $(AM_V_at
)${MKDIR_P} src
508 $(AM_V_at
)$(PERL
) -w
-- $(srcdir)/src
/dcgen \
509 $(srcdir)/src
/dircolors.hin
> $@
-t
510 $(AM_V_at
)chmod a-w
$@
-t
513 # This file is built by maintainers. It's architecture-independent,
514 # and it needs to be built on a widest-known-int architecture, so it's
515 # built only if absent. It is not cleaned because we don't want to
516 # insist that maintainers must build on hosts that support the widest
517 # known ints (currently 128-bit).
518 BUILT_SOURCES
+= $(top_srcdir
)/src
/primes.h
519 $(top_srcdir
)/src
/primes.h
:
520 $(AM_V_at
)${MKDIR_P} src
521 $(MAKE
) src
/make-prime-list
$(EXEEXT
)
522 $(AM_V_GEN
)rm -f
$@
$@
-t
523 $(AM_V_at
)src
/make-prime-list
$(EXEEXT
) 5000 > $@
-t
524 $(AM_V_at
)chmod a-w
$@
-t
527 # false exits nonzero even with --help or --version.
528 # test doesn't support --help or --version.
529 # Tell automake to exempt then from that installcheck test.
530 AM_INSTALLCHECK_STD_OPTIONS_EXEMPT
= src
/false src
/test
532 # Compare fs.h with the list of file system names/magic-numbers in the
533 # Linux statfs man page. This target prints any new name/number pairs.
534 # Also compare against /usr/include/linux/magic.h
535 .PHONY
: src
/fs-magic-compare
536 src
/fs-magic-compare
: src
/fs-magic src
/fs-kernel-magic src
/fs-def
537 @
join -v1
-t@ src
/fs-magic src
/fs-def
538 @
join -v1
-t@ src
/fs-kernel-magic src
/fs-def
540 CLEANFILES
+= src
/fs-def
542 @grep
'^# *define ' src
/fs.h |
$(ASSORT
) > $@
-t
&& mv
$@
-t
$@
544 # Massage bits of the statfs man page and definitions from
545 # /usr/include/linux/magic.h to be in a form consistent with what's in fs.h.
546 fs_normalize_perl_subst
= \
547 -e
's/MINIX_SUPER_MAGIC\b/MINIX/;' \
548 -e
's/MINIX_SUPER_MAGIC2\b/MINIX_30/;' \
549 -e
's/MINIX2_SUPER_MAGIC\b/MINIX_V2/;' \
550 -e
's/MINIX2_SUPER_MAGIC2\b/MINIX_V2_30/;' \
551 -e
's/MINIX3_SUPER_MAGIC\b/MINIX_V3/;' \
552 -e
's/CIFS_MAGIC_NUMBER/CIFS/;' \
553 -e
's/AFS_FS/KAFS/;' \
554 -e
's/(_SUPER)?_MAGIC//;' \
555 -e
's/\s+0x(\S+)/" 0x" . uc $$1/e;' \
556 -e
's/(\s+0x)(\X{2})\b/$${1}00$$2/;' \
557 -e
's/(\s+0x)(\X{3})\b/$${1}0$$2/;' \
558 -e
's/(\s+0x)(\X{6})\b/$${1}00$$2/;' \
559 -e
's/(\s+0x)(\X{7})\b/$${1}0$$2/;' \
561 -e
's/^\043define\s+//;' \
562 -e
's/^_(XIAFS)/$$1/;' \
563 -e
's/^USBDEVICE/USBDEVFS/;' \
564 -e
's/NTFS_SB/NTFS/;' \
565 -e
's/^/\043 define S_MAGIC_/;' \
566 -e
's,\s*/\* .*? \*/,,;'
568 CLEANFILES
+= src
/fs-magic
569 src
/fs-magic
: Makefile
570 @MANPAGER
= man statfs \
571 |perl
-ne
'/File system types:/.../Nobody kno/ and print' \
573 $(fs_normalize_perl_subst
) \
574 | grep
-Ev
'S_MAGIC_EXT[34]|STACK_END' \
578 DISTCLEANFILES
+= src
/fs-latest-magic.h
579 # This rule currently gets the latest header, but probably isn't general
580 # enough to enable by default.
581 # @kgit='https://git.kernel.org/cgit/linux/kernel/git'; \
582 # wget -q $$kgit/torvalds/linux.git/plain/include/uapi/linux/magic.h \
584 src
/fs-latest-magic.h
:
587 CLEANFILES
+= src
/fs-kernel-magic
588 src
/fs-kernel-magic
: Makefile src
/fs-latest-magic.h
589 @perl
-ne
'/^#define.*0x/ and print' \
590 /usr
/include/linux
/magic.h src
/fs-latest-magic.h \
592 $(fs_normalize_perl_subst
) \
593 | grep
-Ev
'S_MAGIC_EXT[34]|STACK_END' \
597 BUILT_SOURCES
+= src
/fs-is-local.h
598 src
/fs-is-local.h
: src
/stat.c src
/extract-magic
600 $(AM_V_at
)${MKDIR_P} src
601 $(AM_V_at
)$(PERL
) $(srcdir)/src
/extract-magic \
602 --local
$(srcdir)/src
/stat.c
> $@t
603 $(AM_V_at
)chmod a-w
$@t
606 BUILT_SOURCES
+= src
/fs.h
607 src
/fs.h
: src
/stat.c src
/extract-magic
609 $(AM_V_at
)${MKDIR_P} src
610 $(AM_V_at
)$(PERL
) $(srcdir)/src
/extract-magic \
611 $(srcdir)/src
/stat.c
> $@t
612 $(AM_V_at
)chmod a-w
$@t
615 BUILT_SOURCES
+= src
/version.c
616 src
/version.c
: Makefile
618 $(AM_V_at
)${MKDIR_P} src
619 $(AM_V_at
)printf
'#include <config.h>\n' > $@t
620 $(AM_V_at
)printf
'char const *Version = "$(PACKAGE_VERSION)";\n' >> $@t
621 $(AM_V_at
)chmod a-w
$@t
624 BUILT_SOURCES
+= src
/version.h
625 src
/version.h
: Makefile
627 $(AM_V_at
)${MKDIR_P} src
628 $(AM_V_at
)printf
'extern char const *Version;\n' > $@t
629 $(AM_V_at
)chmod a-w
$@t
632 # Generates a list of macro invocations like:
633 # SINGLE_BINARY_PROGRAM(program_name_str, main_name)
634 # once for each program list on $(single_binary_progs). Note that
635 # for [ the macro invocation is:
636 # SINGLE_BINARY_PROGRAM("[", _)
637 DISTCLEANFILES
+= src
/coreutils.h
638 src
/coreutils.h
: Makefile
640 $(AM_V_at
)${MKDIR_P} src
641 $(AM_V_at
)for prog in x
$(single_binary_progs
); do \
642 test $$prog = x
&& continue
; \
643 prog
=`basename $$prog`; \
644 main
=`echo $$prog | tr '[' '_'`; \
645 echo
"SINGLE_BINARY_PROGRAM(\"$$prog\", $$main)"; \
647 $(AM_V_at
)chmod a-w
$@t
650 DISTCLEANFILES
+= src
/version.c src
/version.h
651 MAINTAINERCLEANFILES
+= $(BUILT_SOURCES
)
660 # Ensure that the list of programs in README matches the list
661 # of programs we can build.
662 check-local
: check-README check-duplicate-no-install
665 $(AM_V_GEN
)rm -rf
$(pr
) $(pm
)
666 $(AM_V_at
)echo
$(all_programs
) \
668 | sed
-e
's,$(EXEEXT)$$,,' \
670 -e
's/^ginstall$$/install/' \
672 |
$(ASSORT
) -u
> $(pm
) && \
673 sed
-n
'/^The programs .* are:/,/^[a-zA-Z]/p' $(top_srcdir
)/README \
674 | sed
-n
'/^ */s///p' | tr
-s
' ' '\n' > $(pr
)
675 $(AM_V_at
)diff
$(pm
) $(pr
) && rm -rf
$(pr
) $(pm
)
677 # Ensure that a by-default-not-installed program (listed in
678 # $(no_install__progs) is not also listed as another $(EXTRA_PROGRAMS)
679 # entry, because if that were to happen, it *would* be installed
681 .PHONY
: check-duplicate-no-install
682 check-duplicate-no-install
:
683 $(AM_V_GEN
)test -z
"`echo '$(EXTRA_PROGRAMS)' | tr ' ' '\n' | uniq -d`"
685 # Use the just-built 'ginstall', when not cross-compiling.
687 cu_install_program
= @INSTALL@
689 cu_install_program
= src
/ginstall
691 INSTALL
= $(cu_install_program
) -c