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