]> git.ipfire.org Git - thirdparty/glibc.git/blame - io/Makefile
io: Fix record locking contants on 32 bit arch with 64 bit default time_t (BZ#30477)
[thirdparty/glibc.git] / io / Makefile
CommitLineData
6d7e8eda 1# Copyright (C) 1992-2023 Free Software Foundation, Inc.
28f540f4
RM
2# This file is part of the GNU C Library.
3
4# The GNU C Library is free software; you can redistribute it and/or
41bdb6e2
AJ
5# modify it under the terms of the GNU Lesser General Public
6# License as published by the Free Software Foundation; either
7# version 2.1 of the License, or (at your option) any later version.
28f540f4
RM
8
9# The GNU C Library is distributed in the hope that it will be useful,
10# but WITHOUT ANY WARRANTY; without even the implied warranty of
11# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
41bdb6e2 12# Lesser General Public License for more details.
28f540f4 13
41bdb6e2 14# You should have received a copy of the GNU Lesser General Public
59ba27a6 15# License along with the GNU C Library; if not, see
5a82c748 16# <https://www.gnu.org/licenses/>.
28f540f4
RM
17
18#
19# Sub-makefile for I/O portion of the library.
20#
15125996 21subdir := io
28f540f4 22
a5f891ac
JM
23include ../Makeconfig
24
a118dc31
AZ
25headers := \
26 bits/fcntl.h \
27 bits/fcntl2.h \
28 bits/poll.h \
29 bits/poll2.h \
30 bits/stat.h \
31 bits/statfs.h \
32 bits/statvfs.h \
33 bits/statx-generic.h \
34 bits/statx.h \
35 bits/types/struct_statx.h \
36 bits/types/struct_statx_timestamp.h \
37 fcntl.h \
38 fts.h \
39 ftw.h \
40 poll.h \
41 sys/fcntl.h \
42 sys/poll.h \
43 sys/sendfile.h \
44 sys/stat.h \
45 sys/statfs.h \
46 sys/statvfs.h \
47 sys/vfs.h \
48 utime.h \
49 # headers
50
51routines := \
52 access \
53 chdir \
54 chmod \
55 chown \
56 close \
57 close_range \
58 closefrom \
59 copy_file_range \
60 creat \
61 creat64 \
62 dup \
63 dup2 \
64 dup3 \
65 euidaccess \
66 faccessat \
67 fchdir \
68 fchmod \
69 fchmodat \
70 fchown \
71 fchownat \
72 fcntl \
73 fcntl64 \
74 file_change_detection \
75 flock \
76 fstat \
77 fstat64 \
78 fstatat \
79 fstatat64 \
80 fstatfs \
81 fstatfs64 \
82 fstatvfs \
83 fstatvfs64 \
84 fts \
85 fts64 \
86 fts64-time64 \
87 ftw \
88 ftw64 \
89 ftw64-time64 \
90 futimens \
91 getcwd \
92 getdirname \
93 getwd \
94 isatty \
95 lchmod \
96 lchown \
97 link \
98 linkat \
99 lockf \
100 lockf64 \
101 lseek \
102 lseek64 \
103 lstat \
104 lstat64 \
105 mkdir \
106 mkdirat \
107 mkfifo \
108 mkfifoat \
109 mknod \
110 mknodat \
111 open \
112 open64 \
113 open64_2 \
114 open_2 \
115 openat \
116 openat64 \
117 openat64_2 \
118 openat_2 \
119 pipe \
120 pipe2 \
121 poll \
122 posix_fadvise \
123 posix_fadvise64 \
124 posix_fallocate \
125 posix_fallocate64 \
126 ppoll \
127 read \
128 readlink \
129 readlinkat \
130 rmdir \
131 sendfile \
132 sendfile64 \
133 stat \
134 stat64 \
135 statfs \
136 statfs64 \
137 statvfs \
138 statvfs64 \
139 statx \
140 symlink \
141 symlinkat \
142 ttyname \
143 ttyname_r \
144 umask \
145 unlink \
146 unlinkat \
147 utime \
148 utimensat \
149 write \
150 # routines
151
152others := \
153 pwd \
154 # others
155
156test-srcs := \
157 ftwtest \
158 ftwtest-time64 \
159 # test-srcs
160
161tests := \
162 bug-ftw1 \
163 bug-ftw2 \
164 bug-ftw3 \
165 bug-ftw4 \
166 bug-ftw5 \
167 test-lfs \
168 test-stat \
169 test-stat2 \
170 test-utime \
171 tst-close_range \
172 tst-closefrom \
173 tst-copy_file_range \
174 tst-faccessat \
175 tst-fchmodat \
176 tst-fchownat \
177 tst-fcntl \
4d0fe291 178 tst-fcntl-lock \
a118dc31
AZ
179 tst-fstatat \
180 tst-fts \
181 tst-fts-lfs \
182 tst-ftw-bz26353 \
183 tst-ftw-bz28126 \
184 tst-ftw-lnk \
185 tst-futimens \
186 tst-futimes \
187 tst-futimesat \
188 tst-getcwd \
189 tst-getcwd-abspath \
190 tst-lchmod \
191 tst-linkat \
192 tst-lockf \
193 tst-lutimes \
194 tst-mkdirat \
195 tst-mkfifoat \
196 tst-mknodat \
197 tst-open-tmpfile \
198 tst-openat \
199 tst-posix_fallocate \
200 tst-posix_fallocate64 \
201 tst-readlinkat \
202 tst-renameat \
203 tst-stat \
204 tst-stat-lfs \
205 tst-statvfs \
206 tst-symlinkat \
207 tst-ttyname_r \
208 tst-unlinkat \
209 tst-utime \
210 tst-utimensat \
211 tst-utimes \
212 # tests
bad7a0c8 213
088d3291 214tests-time64 := \
118a2aee
AZ
215 tst-fcntl-time64 \
216 tst-fts-time64 \
088d3291
AZ
217 tst-futimens-time64 \
218 tst-futimes-time64\
118a2aee
AZ
219 tst-futimesat-time64 \
220 tst-lchmod-time64 \
088d3291
AZ
221 tst-lutimes-time64 \
222 tst-stat-time64 \
088d3291
AZ
223 tst-utime-time64 \
224 tst-utimensat-time64 \
225 tst-utimes-time64 \
8a40aff8 226 # tests-time64
088d3291 227
fd70af45 228# Likewise for statx, but we do not need static linking here.
a118dc31
AZ
229tests-internal += \
230 tst-file_change_detection \
231 tst-statx \
232 # tests-internal
233
234tests-static += \
235 tst-statx \
236 # tests-static
fd70af45 237
f214606a 238ifeq ($(run-built-tests),yes)
a118dc31
AZ
239tests-special += \
240 $(objpfx)ftwtest-time64.out \
241 $(objpfx)ftwtest.out \
242 # tests-special
f214606a
JM
243endif
244
28f540f4 245include ../Rules
0793d348 246
8d98c7c0
AZ
247CFLAGS-open.c += -fexceptions -fasynchronous-unwind-tables $(config-cflags-wno-ignored-attributes)
248CFLAGS-openat.c += $(config-cflags-wno-ignored-attributes)
36975e8e
L
249CFLAGS-open64.c += -fexceptions -fasynchronous-unwind-tables
250CFLAGS-creat.c += -fexceptions -fasynchronous-unwind-tables
251CFLAGS-creat64.c += -fexceptions -fasynchronous-unwind-tables
8d98c7c0
AZ
252CFLAGS-fcntl.c += -fexceptions -fasynchronous-unwind-tables $(config-cflags-wno-ignored-attributes)
253CFLAGS-fcntl64.c += -fexceptions -fasynchronous-unwind-tables $(config-cflags-wno-ignored-attributes)
36975e8e
L
254CFLAGS-poll.c += -fexceptions -fasynchronous-unwind-tables
255CFLAGS-ppoll.c += -fexceptions -fasynchronous-unwind-tables
addff78f 256CFLAGS-lockf.c += -fexceptions -fasynchronous-unwind-tables
8d98c7c0 257CFLAGS-lockf64.c += -fexceptions -fasynchronous-unwind-tables $(config-cflags-wno-ignored-attributes)
36975e8e
L
258CFLAGS-statfs.c += -fexceptions
259CFLAGS-fstatfs.c += -fexceptions
8d98c7c0
AZ
260CFLAGS-statvfs.c += -fexceptions $(config-cflags-wno-ignored-attributes)
261CFLAGS-fstatvfs.c += -fexceptions $(config-cflags-wno-ignored-attributes)
36975e8e
L
262CFLAGS-fts.c += -Wno-uninitialized $(uses-callbacks) -fexceptions
263CFLAGS-fts64.c += -Wno-uninitialized $(uses-callbacks) -fexceptions
70961aee 264CFLAGS-fts64-time64.c += -Wno-uninitialized $(uses-callbacks) -fexceptions
36975e8e
L
265CFLAGS-ftw.c += $(uses-callbacks) -fexceptions
266CFLAGS-ftw64.c += $(uses-callbacks) -fexceptions
19873b18 267CFLAGS-ftw64-time64.c += $(uses-callbacks) -fexceptions
36975e8e
L
268CFLAGS-posix_fallocate.c += -fexceptions
269CFLAGS-posix_fallocate64.c += -fexceptions
270CFLAGS-fallocate.c += -fexceptions
271CFLAGS-fallocate64.c += -fexceptions
8d98c7c0
AZ
272CFLAGS-read.c += -fexceptions -fasynchronous-unwind-tables $(config-cflags-wno-ignored-attributes)
273CFLAGS-write.c += -fexceptions -fasynchronous-unwind-tables $(config-cflags-wno-ignored-attributes)
bdfed2e2 274CFLAGS-close.c += -fexceptions -fasynchronous-unwind-tables
8d98c7c0 275CFLAGS-lseek64.c += $(config-cflags-wno-ignored-attributes)
36975e8e
L
276
277CFLAGS-test-stat.c += -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE
278CFLAGS-test-lfs.c += -D_LARGEFILE64_SOURCE
118a2aee 279CFLAGS-tst-lchmod.c += -D_FILE_OFFSET_BITS=64
d951286f 280
25851835
UD
281test-stat2-ARGS = Makefile . $(objpfx)test-stat2
282
a14f121d
UD
283tst-statvfs-ARGS = $(objpfx)tst-statvfs tst-statvfs.c /tmp
284
95511aab
JM
285tst-open-tmpfile-ARGS = --test-dir=$(objpfx)
286
088d3291
AZ
287CFLAGS-ftwtest-time64.c += -D_TIME_BITS=64 -D_FILE_OFFSET_BITS=64
288
03ac099f 289ifeq ($(run-built-tests),yes)
89f1c388 290$(objpfx)ftwtest.out: ftwtest-sh $(objpfx)ftwtest
f0881698
JM
291 $(SHELL) $< $(common-objpfx) '$(test-program-cmd)' > $@; \
292 $(evaluate-test)
088d3291
AZ
293
294$(objpfx)ftwtest-time64.out: ftwtest-sh $(objpfx)ftwtest-time64
295 $(SHELL) $< $(common-objpfx) '$(test-program-cmd)' > $@; \
296 $(evaluate-test)
e7a95dc6 297endif