]> git.ipfire.org Git - thirdparty/glibc.git/blame - sysdeps/unix/sysv/linux/Makefile
Install <bits/mman-linux.h>
[thirdparty/glibc.git] / sysdeps / unix / sysv / linux / Makefile
CommitLineData
8d57beea 1ifeq ($(subdir),csu)
c6645251 2sysdep_routines += errno-loc
39778c6c
UD
3endif
4
2c008571
UD
5ifeq ($(subdir),assert)
6CFLAGS-assert.c += -DFATAL_PREPARE_INCLUDE='<fatal-prepare.h>'
7CFLAGS-assert-perr.c += -DFATAL_PREPARE_INCLUDE='<fatal-prepare.h>'
8endif
9
a1648746 10ifeq ($(subdir),malloc)
7c2842bf 11CFLAGS-malloc.c += -DMORECORE_CLEARS=2
a1648746
UD
12endif
13
1e1dc4e8 14ifeq ($(subdir),socket)
123be9de 15sysdep_routines += internal_accept4 internal_recvmmsg internal_sendmmsg
1e1dc4e8
JJ
16endif
17
8d57beea 18ifeq ($(subdir),misc)
c9009328
L
19include $(firstword $(wildcard $(sysdirs:=/sysctl.mk)))
20
cb191f23 21sysdep_routines += clone llseek umount umount2 readahead \
6789aaaa 22 setfsuid setfsgid makedev epoll_pwait signalfd \
c08fb0d7 23 eventfd eventfd_read eventfd_write prlimit
84724245 24
ce42435c 25CFLAGS-gethostid.c = -fexceptions
c27714f1 26CFLAGS-tst-writev.c += "-DARTIFICIAL_LIMIT=0x80000000-__getpagesize()"
ce42435c 27
67afae58 28sysdep_headers += sys/mount.h sys/acct.h sys/sysctl.h \
4974d2b2 29 sys/klog.h sys/kdaemon.h \
d1462d2e 30 sys/user.h sys/procfs.h sys/prctl.h \
39382b8b 31 sys/kd.h sys/soundcard.h sys/vt.h \
3d42e04d 32 sys/quota.h sys/fsuid.h \
844633d1 33 scsi/sg.h scsi/scsi.h scsi/scsi_ioctl.h sys/pci.h \
3e360d34 34 sys/ultrasound.h sys/raw.h sys/personality.h sys/epoll.h \
2e3e9ff1 35 bits/a.out.h sys/inotify.h sys/signalfd.h sys/eventfd.h \
8e475601 36 sys/timerfd.h sys/fanotify.h bits/eventfd.h bits/inotify.h \
02a6f887 37 bits/signalfd.h bits/timerfd.h bits/epoll.h \
4dd4e157
AJ
38 bits/socket_type.h bits/syscall.h bits/sysctl.h \
39 bits/mman-linux.h
cd6ede75 40
38027f90
UD
41tests += tst-clone
42
f127cd28 43# Generate the list of SYS_* macros for the system calls (__NR_* macros).
154bfc16
JM
44
45# If there is more than one syscall list for different architecture
0ab0291b
L
46# variants, the CPU/Makefile defines abi-variants to be a list of names
47# for those variants (e.g. 32 64), and, for each variant, defines
48# abi-$(variant)-options to be compiler options to cause <asm/unistd.h>
49# to define the desired list of syscalls and abi-$(variant)-condition to
50# be the condition for those options to use in a C #if condition.
51# abi-includes may be defined to a list of headers to include
154bfc16
JM
52# in the generated header, if the default does not suffice.
53
bd951ccb 54$(objpfx)bits/syscall%h $(objpfx)bits/syscall%d: ../sysdeps/unix/sysv/linux/sys/syscall.h
362f5ae2 55 $(make-target-directory)
9afc8a59
UD
56 { \
57 echo '/* Generated at libc build time from kernel syscall list. */';\
58 echo ''; \
59 echo '#ifndef _SYSCALL_H'; \
60 echo '# error "Never use <bits/syscall.h> directly; include <sys/syscall.h> instead."'; \
61 echo '#endif'; \
62 echo ''; \
0ab0291b 63 $(foreach h,$(abi-includes), echo '#include <$(h)>';) \
154bfc16 64 echo ''; \
0ab0291b
L
65 $(if $(abi-variants), \
66 $(foreach v,$(abi-variants),\
154bfc16 67 $(CC) -E -MD -MP -MF $(@:.h=.d)-t$(v) -MT '$(@:.d=.h) $(@:.h=.d)' \
0ab0291b 68 -x c $(sysincludes) $< $(abi-$(v)-options) \
154bfc16 69 -D_LIBC -dM | \
abe7b661 70 sed -n 's@^#define __NR_\([^ ]*\) .*$$@#define SYS_\1 __NR_\1@p' | \
154bfc16 71 LC_ALL=C sort > $(@:.d=.h).new$(v); \
0ab0291b
L
72 $(if $(abi-$(v)-condition),\
73 echo '#if $(abi-$(v)-condition)';) \
154bfc16 74 cat $(@:.d=.h).new$(v); \
0ab0291b 75 $(if $(abi-$(v)-condition),echo '#endif';) \
154bfc16 76 rm -f $(@:.d=.h).new$(v); \
0ab0291b
L
77 ), \
78 $(CC) -E -MD -MP -MF $(@:.h=.d)-t$(v) -MT '$(@:.d=.h) $(@:.h=.d)' \
79 -x c $(sysincludes) $< \
80 -D_LIBC -dM | \
81 sed -n 's@^#define __NR_\([^ ]*\) .*$$@#define SYS_\1 __NR_\1@p' | \
82 LC_ALL=C sort;) \
9afc8a59 83 } > $(@:.d=.h).new
f127cd28 84 mv -f $(@:.d=.h).new $(@:.d=.h)
0ab0291b 85ifdef abi-variants
7cd72ad3 86ifneq (,$(objpfx))
154bfc16 87 sed $(sed-remove-objpfx) \
0ab0291b 88 $(foreach v,$(abi-variants),$(@:.h=.d)-t$(v)) > $(@:.h=.d)-t3
7cd72ad3 89else
0ab0291b 90 cat $(foreach v,$(abi-variants),$(@:.h=.d)-t$(v)) \
154bfc16 91 > $(@:.h=.d)-t3
7cd72ad3 92endif
0ab0291b 93 rm -f $(foreach v,$(abi-variants),$(@:.h=.d)-t$(v))
7cd72ad3 94 mv -f $(@:.h=.d)-t3 $(@:.h=.d)
0ab0291b
L
95else
96 mv -f $(@:.h=.d)-t $(@:.h=.d)
97endif
cd6ede75 98
d705269e 99ifndef no_deps
f127cd28 100# Get the generated list of dependencies (probably /usr/include/asm/unistd.h).
bd951ccb 101-include $(objpfx)bits/syscall.d
d705269e 102endif
bd951ccb 103generated += bits/syscall.h bits/syscall.d
d2f5be2a
UD
104endif
105
8d57beea 106ifeq ($(subdir),time)
6e63d5e1 107sysdep_headers += sys/timex.h bits/timex.h
997d6467 108
eb415739 109sysdep_routines += ntp_gettime ntp_gettimex
d2f5be2a
UD
110endif
111
8d57beea 112ifeq ($(subdir),socket)
4f173e2c 113sysdep_headers += net/if_ppp.h net/ppp-comp.h \
d705269e 114 net/ppp_defs.h net/if_arp.h net/route.h net/ethernet.h \
999b2f6b 115 net/if_slip.h net/if_packet.h net/if_shaper.h
7ce241a0 116sysdep_routines += cmsg_nxthdr sa_len
8f5ca04b
RM
117endif
118
8d57beea 119ifeq ($(subdir),sunrpc)
dfe1754a 120sysdep_headers += nfs/nfs.h
57aefafe
RM
121endif
122
8d57beea 123ifeq ($(subdir),termios)
5107cf1d 124sysdep_headers += termio.h
80791291
RM
125endif
126
d64fae6a 127ifeq ($(subdir),posix)
13a571a7 128sysdep_headers += bits/initspin.h
7ae4abe9 129
bce20b9a 130sysdep_routines += exit-thread sched_getcpu
341c566f
UD
131
132tests += tst-getcpu
d64fae6a
UD
133endif
134
8d57beea 135ifeq ($(subdir),inet)
d9997a45 136sysdep_headers += netinet/if_fddi.h netinet/if_tr.h \
59cacc81 137 netipx/ipx.h netash/ash.h netax25/ax25.h netatalk/at.h \
09236fba 138 netrom/netrom.h netpacket/packet.h netrose/rose.h \
ea2c47b6 139 neteconet/ec.h netiucv/iucv.h
a401eea9
UD
140endif
141
93995795
RM
142# Don't compile the ctype glue code, since there is no old non-GNU C library.
143inhibit-glue = yes
d705269e 144
9756dfe1 145ifeq ($(subdir),dirent)
e5cd813b 146sysdep_routines += getdirentries getdirentries64
9756dfe1
UD
147endif
148
9931ba24
UD
149ifeq ($(subdir),nis)
150CFLAGS-ypclnt.c = -DUSE_BINDINGDIR=1
151endif
913a752b 152
9c7ff11a 153ifeq ($(subdir),io)
4e87573f 154sysdep_routines += xstatconv internal_statvfs internal_statvfs64 \
749f5cc9 155 sync_file_range open_2 open64_2 fallocate fallocate64
1728f92d 156sysdep_headers += bits/fcntl-linux.h
9c7ff11a
UD
157endif
158
913a752b 159ifeq ($(subdir),elf)
6fb2dde3
UD
160sysdep-rtld-routines += dl-brk dl-sbrk dl-getcwd dl-openat64 dl-opendir \
161 dl-fxstatat64
3ba06713
UD
162
163CPPFLAGS-lddlibc4 += -DNOT_IN_libc
913a752b 164endif
1fe42a2b
UD
165
166ifeq ($(subdir),rt)
167CFLAGS-mq_send.c += -fexceptions
168CFLAGS-mq_receive.c += -fexceptions
169endif
fc03df7a
UD
170
171ifeq ($(subdir),nscd)
3a2c0242 172sysdep-CFLAGS += -DHAVE_EPOLL -DHAVE_SENDFILE -DHAVE_INOTIFY -DHAVE_NETLINK
e14bbf53 173CFLAGS-gai.c += -DNEED_NETLINK
fc03df7a 174endif