1 # Make coreutils programs. -*-Makefile-*-
2 # This is included by the top-level Makefile.am.
4 ## Copyright (C) 1990-2024 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 \
76 CLEANFILES
+= $(SCRIPTS
)
78 # Also remove these sometimes-built programs.
79 # For example, even when excluded, they're built via 'sc_check-AUTHORS'
81 CLEANFILES
+= $(no_install__progs
)
83 noinst_LIBRARIES
+= src
/libver.a
84 nodist_src_libver_a_SOURCES
= src
/version.c src
/version.h
86 # Tell the linker to omit references to unused shared libraries.
87 AM_LDFLAGS
= $(IGNORE_UNUSED_LIBRARIES_CFLAGS
)
89 # Extra libraries needed by more than one program. Will be updated later.
93 # Sometimes, the expansion of $(LIBINTL) includes -lc which may
94 # include modules defining variables like 'optind', so libcoreutils.a
95 # must precede $(LIBINTL) in order to ensure we use GNU getopt.
96 # But libcoreutils.a must also follow $(LIBINTL), since libintl uses
97 # replacement functions defined in libcoreutils.a.
98 # Similarly for $(MBRTOWC_LIB).
99 LDADD
= src
/libver.a lib
/libcoreutils.a
$(LIBINTL
) $(MBRTOWC_LIB
) \
102 # First, list all programs, to make listing per-program libraries easier.
104 src_arch_LDADD
= $(LDADD
)
105 src_base64_LDADD
= $(LDADD
)
106 src_base32_LDADD
= $(LDADD
)
107 src_basenc_LDADD
= $(LDADD
)
108 src_basename_LDADD
= $(LDADD
)
109 src_cat_LDADD
= $(LDADD
)
110 src_chcon_LDADD
= $(LDADD
)
111 # See chgrp_LDADD below
112 src_chmod_LDADD
= $(LDADD
)
113 src_chown_LDADD
= $(LDADD
)
114 src_chroot_LDADD
= $(LDADD
)
115 src_cksum_LDADD
= $(LDADD
)
116 src_comm_LDADD
= $(LDADD
)
117 src_nproc_LDADD
= $(LDADD
)
118 src_cp_LDADD
= $(LDADD
)
120 src_coreutils_LDADD
= $(LDADD
)
122 src_csplit_LDADD
= $(LDADD
)
123 src_cut_LDADD
= $(LDADD
)
124 src_date_LDADD
= $(LDADD
)
125 src_dd_LDADD
= $(LDADD
)
126 src_df_LDADD
= $(LDADD
)
127 # See dir_LDADD below
128 src_dircolors_LDADD
= $(LDADD
)
129 src_dirname_LDADD
= $(LDADD
)
130 src_du_LDADD
= $(LDADD
)
131 src_echo_LDADD
= $(LDADD
)
132 src_env_LDADD
= $(LDADD
)
133 src_expand_LDADD
= $(LDADD
)
134 src_expr_LDADD
= $(LDADD
)
135 src_factor_LDADD
= $(LDADD
)
136 src_false_LDADD
= $(LDADD
)
137 src_fmt_LDADD
= $(LDADD
)
138 src_fold_LDADD
= $(LDADD
)
139 src_getlimits_LDADD
= $(LDADD
)
140 src_ginstall_LDADD
= $(LDADD
)
141 src_groups_LDADD
= $(LDADD
)
142 src_head_LDADD
= $(LDADD
)
143 src_hostid_LDADD
= $(LDADD
)
144 src_hostname_LDADD
= $(LDADD
)
145 src_id_LDADD
= $(LDADD
)
146 src_join_LDADD
= $(LDADD
)
147 src_kill_LDADD
= $(LDADD
)
148 src_link_LDADD
= $(LDADD
)
149 src_ln_LDADD
= $(LDADD
)
150 src_logname_LDADD
= $(LDADD
)
151 src_ls_LDADD
= $(LDADD
)
153 # This must *not* depend on anything in lib/, since it is used to generate
154 # src/primes.h. If it depended on libcoreutils.a, that would pull all lib/*.c
155 # into BUILT_SOURCES.
156 src_make_prime_list_LDADD
=
158 src_md5sum_LDADD
= $(LDADD
)
159 src_mkdir_LDADD
= $(LDADD
)
160 src_mkfifo_LDADD
= $(LDADD
)
161 src_mknod_LDADD
= $(LDADD
)
162 src_mktemp_LDADD
= $(LDADD
)
163 src_mv_LDADD
= $(LDADD
)
164 src_nice_LDADD
= $(LDADD
)
165 src_nl_LDADD
= $(LDADD
)
166 src_nohup_LDADD
= $(LDADD
)
167 src_numfmt_LDADD
= $(LDADD
)
168 src_od_LDADD
= $(LDADD
)
169 src_paste_LDADD
= $(LDADD
)
170 src_pathchk_LDADD
= $(LDADD
)
171 src_pinky_LDADD
= $(LDADD
)
172 src_pr_LDADD
= $(LDADD
)
173 src_printenv_LDADD
= $(LDADD
)
174 src_printf_LDADD
= $(LDADD
)
175 src_ptx_LDADD
= $(LDADD
)
176 src_pwd_LDADD
= $(LDADD
)
177 src_readlink_LDADD
= $(LDADD
)
178 src_realpath_LDADD
= $(LDADD
)
179 src_rm_LDADD
= $(LDADD
)
180 src_rmdir_LDADD
= $(LDADD
)
181 src_runcon_LDADD
= $(LDADD
)
182 src_seq_LDADD
= $(LDADD
)
183 src_sha1sum_LDADD
= $(LDADD
)
184 src_sha224sum_LDADD
= $(LDADD
)
185 src_sha256sum_LDADD
= $(LDADD
)
186 src_sha384sum_LDADD
= $(LDADD
)
187 src_sha512sum_LDADD
= $(LDADD
)
188 src_shred_LDADD
= $(LDADD
)
189 src_shuf_LDADD
= $(LDADD
)
190 src_sleep_LDADD
= $(LDADD
)
191 src_sort_LDADD
= $(LDADD
)
192 src_split_LDADD
= $(LDADD
)
193 src_stat_LDADD
= $(LDADD
)
194 src_stdbuf_LDADD
= $(LDADD
)
195 src_stty_LDADD
= $(LDADD
)
196 src_sum_LDADD
= $(LDADD
)
197 src_sync_LDADD
= $(LDADD
)
198 src_tac_LDADD
= $(LDADD
)
199 src_tail_LDADD
= $(LDADD
)
200 src_tee_LDADD
= $(LDADD
)
201 src_test_LDADD
= $(LDADD
)
202 src_timeout_LDADD
= $(LDADD
)
203 src_touch_LDADD
= $(LDADD
)
204 src_tr_LDADD
= $(LDADD
)
205 src_true_LDADD
= $(LDADD
)
206 src_truncate_LDADD
= $(LDADD
)
207 src_tsort_LDADD
= $(LDADD
)
208 src_tty_LDADD
= $(LDADD
)
209 src_uname_LDADD
= $(LDADD
)
210 src_unexpand_LDADD
= $(LDADD
)
211 src_uniq_LDADD
= $(LDADD
)
212 src_unlink_LDADD
= $(LDADD
)
213 src_uptime_LDADD
= $(LDADD
)
214 src_users_LDADD
= $(LDADD
)
215 # See vdir_LDADD below
216 src_wc_LDADD
= $(LDADD
)
217 src_who_LDADD
= $(LDADD
)
218 src_whoami_LDADD
= $(LDADD
)
219 src_yes_LDADD
= $(LDADD
)
221 # Synonyms. Recall that Automake transliterates '[' and '/' to '_'.
222 src___LDADD
= $(src_test_LDADD
)
223 src_dir_LDADD
= $(src_ls_LDADD
)
224 src_vdir_LDADD
= $(src_ls_LDADD
)
225 src_chgrp_LDADD
= $(src_chown_LDADD
)
227 src_cp_LDADD
+= $(copy_ldadd
)
228 src_ginstall_LDADD
+= $(copy_ldadd
)
229 src_mv_LDADD
+= $(copy_ldadd
)
231 src_mv_LDADD
+= $(remove_ldadd
)
232 src_rm_LDADD
+= $(remove_ldadd
)
234 # for eaccess, euidaccess
235 copy_ldadd
+= $(EUIDACCESS_LIBGEN
)
236 remove_ldadd
+= $(EUIDACCESS_LIBGEN
)
237 src_sort_LDADD
+= $(EUIDACCESS_LIBGEN
)
238 src_test_LDADD
+= $(EUIDACCESS_LIBGEN
)
241 copy_ldadd
+= $(LIB_SELINUX
)
242 src_chcon_LDADD
+= $(LIB_SELINUX
)
243 src_ginstall_LDADD
+= $(LIB_SELINUX
)
244 src_id_LDADD
+= $(LIB_SELINUX
)
245 src_id_LDADD
+= $(LIB_SMACK
)
246 src_ls_LDADD
+= $(LIB_SELINUX
)
247 src_ls_LDADD
+= $(LIB_SMACK
)
248 src_mkdir_LDADD
+= $(LIB_SELINUX
)
249 src_mkdir_LDADD
+= $(LIB_SMACK
)
250 src_mkfifo_LDADD
+= $(LIB_SELINUX
)
251 src_mkfifo_LDADD
+= $(LIB_SMACK
)
252 src_mknod_LDADD
+= $(LIB_SELINUX
)
253 src_mknod_LDADD
+= $(LIB_SMACK
)
254 src_runcon_LDADD
+= $(LIB_SELINUX
)
255 src_stat_LDADD
+= $(LIB_SELINUX
)
257 # for nvlist_lookup_uint64_array
258 src_stat_LDADD
+= $(LIB_NVPAIR
)
260 # for gettime, settime, tempname, utimecmp, utimens
261 copy_ldadd
+= $(CLOCK_TIME_LIB
)
262 src_date_LDADD
+= $(CLOCK_TIME_LIB
)
263 src_ginstall_LDADD
+= $(CLOCK_TIME_LIB
)
264 src_ln_LDADD
+= $(CLOCK_TIME_LIB
)
265 src_ls_LDADD
+= $(CLOCK_TIME_LIB
)
266 src_mktemp_LDADD
+= $(CLOCK_TIME_LIB
)
267 src_pr_LDADD
+= $(CLOCK_TIME_LIB
)
268 src_sort_LDADD
+= $(CLOCK_TIME_LIB
)
269 src_split_LDADD
+= $(CLOCK_TIME_LIB
)
270 src_tac_LDADD
+= $(CLOCK_TIME_LIB
)
271 src_timeout_LDADD
+= $(TIMER_TIME_LIB
)
272 src_touch_LDADD
+= $(CLOCK_TIME_LIB
)
275 src_dd_LDADD
+= $(GETHRXTIME_LIB
)
278 src_ls_LDADD
+= $(LIB_CAP
)
281 src_dd_LDADD
+= $(FDATASYNC_LIB
)
282 src_shred_LDADD
+= $(FDATASYNC_LIB
)
283 src_sync_LDADD
+= $(FDATASYNC_LIB
)
286 src_sleep_LDADD
+= $(NANOSLEEP_LIB
)
287 src_sort_LDADD
+= $(NANOSLEEP_LIB
)
288 src_tail_LDADD
+= $(NANOSLEEP_LIB
)
290 # for various GMP functions
291 src_expr_LDADD
+= $(LIBGMP
)
292 src_factor_LDADD
+= $(LIBGMP
)
295 src_uptime_LDADD
+= $(GETLOADAVG_LIBS
)
297 # for various ACL functions
298 copy_ldadd
+= $(LIB_ACL
)
299 src_ls_LDADD
+= $(FILE_HAS_ACL_LIB
)
301 # for various xattr functions
302 copy_ldadd
+= $(LIB_XATTR
)
304 # for print_unicode_char
305 src_printf_LDADD
+= $(LIBICONV
)
307 # for libcrypto hash routines
308 src_md5sum_LDADD
+= $(LIB_CRYPTO
)
309 src_sort_LDADD
+= $(LIB_DL
) $(LIB_CRYPTO
)
310 src_sha1sum_LDADD
+= $(LIB_CRYPTO
)
311 src_sha224sum_LDADD
+= $(LIB_CRYPTO
)
312 src_sha256sum_LDADD
+= $(LIB_CRYPTO
)
313 src_sha384sum_LDADD
+= $(LIB_CRYPTO
)
314 src_sha512sum_LDADD
+= $(LIB_CRYPTO
)
315 src_cksum_LDADD
+= $(LIB_CRYPTO
)
318 src_pinky_LDADD
+= $(GETADDRINFO_LIB
)
319 src_who_LDADD
+= $(GETADDRINFO_LIB
)
321 # for gethostname, uname
322 src_hostname_LDADD
+= $(GETHOSTNAME_LIB
)
323 src_uname_LDADD
+= $(GETHOSTNAME_LIB
)
326 src_pinky_LDADD
+= $(READUTMP_LIB
)
327 src_uptime_LDADD
+= $(READUTMP_LIB
)
328 src_users_LDADD
+= $(READUTMP_LIB
)
329 src_who_LDADD
+= $(READUTMP_LIB
)
332 src_kill_LDADD
+= $(LIBTHREAD
)
334 # for pthread-cond, pthread-mutex, pthread-thread
335 src_sort_LDADD
+= $(LIBPMULTITHREAD
)
337 # for pthread_sigmask
338 src_sort_LDADD
+= $(PTHREAD_SIGMASK_LIB
)
340 # Get the release year from lib/version-etc.c.
342 `sed -n '/.*COPYRIGHT_YEAR = \([0-9][0-9][0-9][0-9]\) };/s//\1/p' \
343 $(top_srcdir)/lib/version-etc.c`
355 # Use 'ginstall' in the definition of PROGRAMS and in dependencies to avoid
356 # confusion with the 'install' target. The install rule transforms 'ginstall'
357 # to install before applying any user-specified name transformations.
359 # Don't apply prefix transformations to libstdbuf shared lib
360 # as that's not generally needed, and we need to reference the
361 # name directly in LD_PRELOAD etc. In general it's surprising
362 # that $(transform) is applied to libexec at all given that is
363 # for internal package naming, not privy to $(transform).
365 transform
= s
/ginstall
/install/;/libstdbuf
/!$(program_transform_name
)
367 src_ginstall_SOURCES
= src
/install.c src
/prog-fprintf.c
$(copy_sources
) \
370 # This is for the '[' program. Automake transliterates '[' and '/' to '_'.
371 src___SOURCES
= src
/lbracket.c
373 nodist_src_coreutils_SOURCES
= src
/coreutils.h
374 src_coreutils_SOURCES
= src
/coreutils.c
376 src_cp_SOURCES
= src
/cp.c
$(copy_sources
) $(selinux_sources
)
377 src_date_SOURCES
= src
/date.c src
/show-date.c
378 src_dir_SOURCES
= src
/ls.c src
/ls-dir.c
379 src_du_SOURCES
= src
/du.c src
/show-date.c
380 src_env_SOURCES
= src
/env.c src
/operand2sig.c
381 src_vdir_SOURCES
= src
/ls.c src
/ls-vdir.c
382 src_id_SOURCES
= src
/id.c src
/group-list.c
383 src_groups_SOURCES
= src
/groups.c src
/group-list.c
384 src_ls_SOURCES
= src
/ls.c src
/ls-ls.c
385 src_ln_SOURCES
= src
/ln.c \
386 src
/force-link.c src
/force-link.h \
387 src
/relpath.c src
/relpath.h
388 src_chown_SOURCES
= src
/chown.c src
/chown-core.c src
/chown-chown.c
389 src_chgrp_SOURCES
= src
/chown.c src
/chown-core.c src
/chown-chgrp.c
390 src_kill_SOURCES
= src
/kill.c src
/operand2sig.c
391 src_realpath_SOURCES
= src
/realpath.c src
/relpath.c src
/relpath.h
392 src_timeout_SOURCES
= src
/timeout.c src
/operand2sig.c
394 src_mv_SOURCES
= src
/mv.c src
/remove.c
$(copy_sources
) $(selinux_sources
)
395 src_rm_SOURCES
= src
/rm.c src
/remove.c
397 src_mkdir_SOURCES
= src
/mkdir.c src
/prog-fprintf.c
$(selinux_sources
)
398 src_rmdir_SOURCES
= src
/rmdir.c src
/prog-fprintf.c
400 src_mkfifo_SOURCES
= src
/mkfifo.c
$(selinux_sources
)
401 src_mknod_SOURCES
= src
/mknod.c
$(selinux_sources
)
403 src_df_SOURCES
= src
/df.c src
/find-mount-point.c
404 src_stat_SOURCES
= src
/stat.c src
/find-mount-point.c
406 src_uname_SOURCES
= src
/uname.c src
/uname-uname.c
407 src_arch_SOURCES
= src
/uname.c src
/uname-arch.c
409 src_cut_SOURCES
= src
/cut.c src
/set-fields.c
410 src_numfmt_SOURCES
= src
/numfmt.c src
/set-fields.c
412 src_split_SOURCES
= src
/split.c src
/temp-stream.c
413 src_tac_SOURCES
= src
/tac.c src
/temp-stream.c
415 src_tail_SOURCES
= src
/tail.c src
/iopoll.c
416 src_tee_SOURCES
= src
/tee.c src
/iopoll.c
418 src_sum_SOURCES
= src
/sum.c src
/sum.h src
/digest.c
419 src_sum_CPPFLAGS
= -DHASH_ALGO_SUM
=1 $(AM_CPPFLAGS
)
421 src_md5sum_SOURCES
= src
/digest.c
422 src_md5sum_CPPFLAGS
= -DHASH_ALGO_MD5
=1 $(AM_CPPFLAGS
)
423 src_sha1sum_SOURCES
= src
/digest.c
424 src_sha1sum_CPPFLAGS
= -DHASH_ALGO_SHA1
=1 $(AM_CPPFLAGS
)
425 src_sha224sum_SOURCES
= src
/digest.c
426 src_sha224sum_CPPFLAGS
= -DHASH_ALGO_SHA224
=1 $(AM_CPPFLAGS
)
427 src_sha256sum_SOURCES
= src
/digest.c
428 src_sha256sum_CPPFLAGS
= -DHASH_ALGO_SHA256
=1 $(AM_CPPFLAGS
)
429 src_sha384sum_SOURCES
= src
/digest.c
430 src_sha384sum_CPPFLAGS
= -DHASH_ALGO_SHA384
=1 $(AM_CPPFLAGS
)
431 src_sha512sum_SOURCES
= src
/digest.c
432 src_sha512sum_CPPFLAGS
= -DHASH_ALGO_SHA512
=1 $(AM_CPPFLAGS
)
433 src_b2sum_CPPFLAGS
= -DHASH_ALGO_BLAKE2
=1 -DHAVE_CONFIG_H
$(AM_CPPFLAGS
)
434 src_b2sum_SOURCES
= src
/digest.c \
435 src
/blake2
/blake2.h src
/blake2
/blake2-impl.h \
436 src
/blake2
/blake2b-ref.c \
437 src
/blake2
/b2sum.c src
/blake2
/b2sum.h
439 src_cksum_SOURCES
= $(src_b2sum_SOURCES
) src
/sum.c src
/sum.h \
440 src
/cksum.c src
/cksum.h src
/crctab.c
441 src_cksum_CPPFLAGS
= -DHASH_ALGO_CKSUM
=1 -DHAVE_CONFIG_H
$(AM_CPPFLAGS
)
443 noinst_LIBRARIES
+= src
/libcksum_pclmul.a
444 src_libcksum_pclmul_a_SOURCES
= src
/cksum_pclmul.c src
/cksum.h
445 cksum_pclmul_ldadd
= src
/libcksum_pclmul.a
446 src_cksum_LDADD
+= $(cksum_pclmul_ldadd
)
447 src_libcksum_pclmul_a_CFLAGS
= -mavx
-mpclmul
$(AM_CFLAGS
)
450 src_base64_SOURCES
= src
/basenc.c
451 src_base64_CPPFLAGS
= -DBASE_TYPE
=64 $(AM_CPPFLAGS
)
452 src_base32_SOURCES
= src
/basenc.c
453 src_base32_CPPFLAGS
= -DBASE_TYPE
=32 $(AM_CPPFLAGS
)
454 src_basenc_SOURCES
= src
/basenc.c
455 src_basenc_CPPFLAGS
= -DBASE_TYPE
=42 $(AM_CPPFLAGS
)
457 src_expand_SOURCES
= src
/expand.c src
/expand-common.c
458 src_unexpand_SOURCES
= src
/unexpand.c src
/expand-common.c
460 src_wc_SOURCES
= src
/wc.c
461 if USE_AVX2_WC_LINECOUNT
462 noinst_LIBRARIES
+= src
/libwc_avx2.a
463 src_libwc_avx2_a_SOURCES
= src
/wc_avx2.c
464 wc_avx2_ldadd
= src
/libwc_avx2.a
465 src_wc_LDADD
+= $(wc_avx2_ldadd
)
466 src_libwc_avx2_a_CFLAGS
= -mavx2
$(AM_CFLAGS
)
469 # Ensure we don't link against libcoreutils.a as that lib is
470 # not compiled with -fPIC which causes issues on 64 bit at least
471 src_libstdbuf_so_LDADD
= $(LIBINTL
)
473 # Note libstdbuf is only compiled if GCC is available
474 # (as per the check in configure.ac), so these flags should be available.
475 # libtool is probably required to relax this dependency.
476 src_libstdbuf_so_LDFLAGS
= -shared
477 src_libstdbuf_so_CFLAGS
= -fPIC
$(AM_CFLAGS
)
479 BUILT_SOURCES
+= src
/coreutils.h
481 # Single binary dependencies
482 src_coreutils_CFLAGS
= -DSINGLE_BINARY
$(AM_CFLAGS
)
483 #src_coreutils_LDFLAGS = $(AM_LDFLAGS)
484 src_coreutils_LDADD
= $(single_binary_deps
) $(LDADD
) $(single_binary_libs
)
485 EXTRA_src_coreutils_DEPENDENCIES
= $(single_binary_deps
)
487 include $(top_srcdir
)/src
/single-binary.mk
489 # Creates symlinks or shebangs to the installed programs when building
490 # coreutils single binary.
491 EXTRA_src_coreutils_DEPENDENCIES
+= src
/coreutils_
$(single_binary_install_type
)
494 CLEANFILES
+= src
/coreutils_symlinks
495 src
/coreutils_symlinks
: Makefile
497 $(AM_V_at
)${MKDIR_P} src
498 $(AM_V_at
)for i in x
$(single_binary_progs
); do \
499 test $$i = x
&& continue
; \
500 rm -f src
/$$i$(EXEEXT
) || exit
$$?
; \
501 $(LN_S
) -s coreutils
$(EXEEXT
) src
/$$i$(EXEEXT
) || exit
$$?
; \
504 CLEANFILES
+= src
/coreutils_shebangs
505 src
/coreutils_shebangs
: Makefile
507 $(AM_V_at
)${MKDIR_P} src
508 $(AM_V_at
)for i in x
$(single_binary_progs
); do \
509 test $$i = x
&& continue
; \
510 rm -f src
/$$i$(EXEEXT
) || exit
$$?
; \
511 printf
'#!%s --coreutils-prog-shebang=%s\n' \
512 $(abs_top_builddir
)/src
/coreutils
$(EXEEXT
) $$i \
513 >src
/$$i$(EXEEXT
) || exit
$$?
; \
514 chmod a
+x
,a-w src
/$$i$(EXEEXT
) || exit
$$?
; \
518 $(AM_V_at
)for i in x
$(single_binary_progs
); do \
519 test $$i = x
&& continue
; \
520 rm -f src
/$$i$(EXEEXT
) || exit
$$?
; \
524 BUILT_SOURCES
+= src
/dircolors.h
525 src
/dircolors.h
: src
/dcgen src
/dircolors.hin
526 $(AM_V_GEN
)rm -f
$@
$@
-t
527 $(AM_V_at
)${MKDIR_P} src
528 $(AM_V_at
)$(PERL
) -w
-- $(srcdir)/src
/dcgen \
529 $(srcdir)/src
/dircolors.hin
> $@
-t
530 $(AM_V_at
)chmod a-w
$@
-t
533 # This file is built by maintainers. It's architecture-independent,
534 # and it needs to be built on a widest-known-int architecture, so it's
535 # built only if absent. It is not cleaned because we don't want to
536 # insist that maintainers must build on hosts that support the widest
537 # known ints (currently 128-bit).
538 BUILT_SOURCES
+= $(top_srcdir
)/src
/primes.h
539 $(top_srcdir
)/src
/primes.h
:
540 $(AM_V_at
)${MKDIR_P} src
541 $(MAKE
) src
/make-prime-list
$(EXEEXT
)
542 $(AM_V_GEN
)rm -f
$@
$@
-t
543 $(AM_V_at
)src
/make-prime-list
$(EXEEXT
) 5000 > $@
-t
544 $(AM_V_at
)chmod a-w
$@
-t
547 # false exits nonzero even with --help or --version.
548 # test doesn't support --help or --version.
549 # Tell automake to exempt then from that installcheck test.
550 AM_INSTALLCHECK_STD_OPTIONS_EXEMPT
= src
/false src
/test
552 # Compare fs.h with the list of file system names/magic-numbers in the
553 # Linux statfs man page. This target prints any new name/number pairs.
554 # Also compare against /usr/include/linux/magic.h
555 .PHONY
: src
/fs-magic-compare
556 src
/fs-magic-compare
: src
/fs-magic src
/fs-kernel-magic src
/fs-def
557 @
join -v1
-t@ src
/fs-magic src
/fs-def
558 @
join -v1
-t@ src
/fs-kernel-magic src
/fs-def
560 CLEANFILES
+= src
/fs-def
562 @grep
'^# *define ' src
/fs.h |
$(ASSORT
) > $@
-t
&& mv
$@
-t
$@
564 # Massage bits of the statfs man page and definitions from
565 # /usr/include/linux/magic.h to be in a form consistent with what's in fs.h.
566 fs_normalize_perl_subst
= \
567 -e
's/MINIX_SUPER_MAGIC\b/MINIX/;' \
568 -e
's/MINIX_SUPER_MAGIC2\b/MINIX_30/;' \
569 -e
's/MINIX2_SUPER_MAGIC\b/MINIX_V2/;' \
570 -e
's/MINIX2_SUPER_MAGIC2\b/MINIX_V2_30/;' \
571 -e
's/MINIX3_SUPER_MAGIC\b/MINIX_V3/;' \
572 -e
's/CIFS_MAGIC_NUMBER/CIFS/;' \
573 -e
's/AFS_FS/KAFS/;' \
574 -e
's/(_SUPER)?_MAGIC//;' \
575 -e
's/\s+0x(\S+)/" 0x" . uc $$1/e;' \
576 -e
's/(\s+0x)(\X{2})\b/$${1}00$$2/;' \
577 -e
's/(\s+0x)(\X{3})\b/$${1}0$$2/;' \
578 -e
's/(\s+0x)(\X{6})\b/$${1}00$$2/;' \
579 -e
's/(\s+0x)(\X{7})\b/$${1}0$$2/;' \
581 -e
's/^\043define\s+//;' \
582 -e
's/^_(XIAFS)/$$1/;' \
583 -e
's/^USBDEVICE/USBDEVFS/;' \
584 -e
's/NTFS_SB/NTFS/;' \
585 -e
's/^/\043 define S_MAGIC_/;' \
586 -e
's,\s*/\* .*? \*/,,;'
588 CLEANFILES
+= src
/fs-magic
589 src
/fs-magic
: Makefile
590 @MANPAGER
= man statfs \
591 |perl
-ne
'/File system types:/.../Nobody kno/ and print' \
593 $(fs_normalize_perl_subst
) \
594 | grep
-Ev
'S_MAGIC_EXT[34]|STACK_END' \
598 DISTCLEANFILES
+= src
/fs-latest-magic.h
599 # This rule currently gets the latest header, but probably isn't general
600 # enough to enable by default.
601 # @kgit='https://git.kernel.org/cgit/linux/kernel/git'; \
602 # wget -q $$kgit/torvalds/linux.git/plain/include/uapi/linux/magic.h \
604 src
/fs-latest-magic.h
:
607 CLEANFILES
+= src
/fs-kernel-magic
608 src
/fs-kernel-magic
: Makefile src
/fs-latest-magic.h
609 @perl
-ne
'/^#define.*0x/ and print' \
610 /usr
/include/linux
/magic.h src
/fs-latest-magic.h \
612 $(fs_normalize_perl_subst
) \
613 | grep
-Ev
'S_MAGIC_EXT[34]|STACK_END' \
617 BUILT_SOURCES
+= src
/fs-is-local.h
618 src
/fs-is-local.h
: src
/stat.c src
/extract-magic
620 $(AM_V_at
)${MKDIR_P} src
621 $(AM_V_at
)$(PERL
) $(srcdir)/src
/extract-magic \
622 --local
$(srcdir)/src
/stat.c
> $@t
623 $(AM_V_at
)chmod a-w
$@t
626 BUILT_SOURCES
+= src
/fs.h
627 src
/fs.h
: src
/stat.c src
/extract-magic
629 $(AM_V_at
)${MKDIR_P} src
630 $(AM_V_at
)$(PERL
) $(srcdir)/src
/extract-magic \
631 $(srcdir)/src
/stat.c
> $@t
632 $(AM_V_at
)chmod a-w
$@t
635 BUILT_SOURCES
+= src
/version.c
636 src
/version.c
: Makefile
638 $(AM_V_at
)${MKDIR_P} src
639 $(AM_V_at
)printf
'#include <config.h>\n' > $@t
640 $(AM_V_at
)printf
'#include "version.h"\n' >> $@t
641 $(AM_V_at
)printf
'char const *Version = "$(PACKAGE_VERSION)";\n' >> $@t
642 $(AM_V_at
)chmod a-w
$@t
645 BUILT_SOURCES
+= src
/version.h
646 src
/version.h
: Makefile
648 $(AM_V_at
)${MKDIR_P} src
649 $(AM_V_at
)printf
'extern char const *Version;\n' > $@t
650 $(AM_V_at
)chmod a-w
$@t
653 # Generates a list of macro invocations like:
654 # SINGLE_BINARY_PROGRAM(program_name_str, main_name)
655 # once for each program list on $(single_binary_progs). Note that
656 # for [ the macro invocation is:
657 # SINGLE_BINARY_PROGRAM("[", _)
658 DISTCLEANFILES
+= src
/coreutils.h
659 src
/coreutils.h
: Makefile
661 $(AM_V_at
)${MKDIR_P} src
662 $(AM_V_at
)for prog in x
$(single_binary_progs
); do \
663 test $$prog = x
&& continue
; \
664 prog
=`basename $$prog`; \
665 main
=`echo $$prog | tr '[' '_'`; \
666 echo
"SINGLE_BINARY_PROGRAM(\"$$prog\", $$main)"; \
668 $(AM_V_at
)chmod a-w
$@t
671 DISTCLEANFILES
+= src
/version.c src
/version.h
672 MAINTAINERCLEANFILES
+= $(BUILT_SOURCES
)
681 # Ensure that the list of programs in README matches the list
682 # of programs we can build.
683 check-local
: check-README check-duplicate-no-install
686 $(AM_V_GEN
)rm -rf
$(pr
) $(pm
)
687 $(AM_V_at
)echo
$(all_programs
) \
689 | sed
-e
's,$(EXEEXT)$$,,' \
691 -e
's/^ginstall$$/install/' \
693 |
$(ASSORT
) -u
> $(pm
) && \
694 sed
-n
'/^The programs .* are:/,/^[a-zA-Z]/p' $(top_srcdir
)/README \
695 | sed
-n
'/^ */s///p' | tr
-s
' ' '\n' > $(pr
)
696 $(AM_V_at
)diff
$(pm
) $(pr
) && rm -rf
$(pr
) $(pm
)
698 # Ensure that a by-default-not-installed program (listed in
699 # $(no_install__progs) is not also listed as another $(EXTRA_PROGRAMS)
700 # entry, because if that were to happen, it *would* be installed
702 .PHONY
: check-duplicate-no-install
703 check-duplicate-no-install
:
704 $(AM_V_GEN
)test -z
"`echo '$(EXTRA_PROGRAMS)' | tr ' ' '\n' | uniq -d`"
706 # Use the just-built 'ginstall', when not cross-compiling.
708 cu_install_program
= @INSTALL@
710 cu_install_program
= src
/ginstall
712 INSTALL
= $(cu_install_program
) -c