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