linux: move a shared part of sys/ptrace.h to bits/ptrace-shared.h
[glibc.git] / sysdeps / unix / sysv / linux / Makefile
blob4af9c5661dd4ca4154e808cad24e5fede402099a
1 ifeq ($(subdir),csu)
2 sysdep_routines += errno-loc
3 endif
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
10 ifeq ($(subdir),malloc)
11 CFLAGS-malloc.c += -DMORECORE_CLEARS=2
12 endif
14 ifeq ($(subdir),misc)
15 include $(firstword $(wildcard $(sysdirs:=/sysctl.mk)))
17 sysdep_routines += clone umount umount2 readahead \
18 setfsuid setfsgid epoll_pwait signalfd \
19 eventfd eventfd_read eventfd_write prlimit \
20 personality epoll_wait tee vmsplice splice \
21 open_by_handle_at mlock2 pkey_mprotect pkey_set pkey_get
23 CFLAGS-gethostid.c = -fexceptions
24 CFLAGS-tee.c = -fexceptions -fasynchronous-unwind-tables
25 CFLAGS-vmsplice.c = -fexceptions -fasynchronous-unwind-tables
26 CFLAGS-splice.c = -fexceptions -fasynchronous-unwind-tables
27 CFLAGS-open_by_handle_at.c = -fexceptions -fasynchronous-unwind-tables
28 CFLAGS-sync_file_range.c = -fexceptions -fasynchronous-unwind-tables
29 CFLAGS-tst-writev.c += "-DARTIFICIAL_LIMIT=(0x80000000-sysconf(_SC_PAGESIZE))"
31 sysdep_headers += sys/mount.h sys/acct.h sys/sysctl.h \
32 sys/klog.h \
33 sys/user.h sys/prctl.h \
34 sys/kd.h sys/soundcard.h sys/vt.h \
35 sys/quota.h sys/fsuid.h \
36 scsi/sg.h scsi/scsi.h scsi/scsi_ioctl.h sys/pci.h \
37 sys/raw.h sys/personality.h sys/epoll.h \
38 bits/a.out.h sys/inotify.h sys/signalfd.h sys/eventfd.h \
39 sys/timerfd.h sys/fanotify.h bits/eventfd.h bits/inotify.h \
40 bits/signalfd.h bits/timerfd.h bits/epoll.h \
41 bits/socket_type.h bits/syscall.h bits/sysctl.h \
42 bits/mman-linux.h bits/mman-shared.h bits/ptrace-shared.h \
43 bits/siginfo-arch.h bits/siginfo-consts-arch.h
45 tests += tst-clone tst-clone2 tst-clone3 tst-fanotify tst-personality \
46 tst-quota tst-sync_file_range tst-sysconf-iov_max tst-ttyname \
47 test-errno-linux tst-memfd_create tst-mlock2 tst-pkey
49 # Generate the list of SYS_* macros for the system calls (__NR_*
50 # macros). The file syscall-names.list contains all possible system
51 # call names, and the generated header file produces SYS_* macros for
52 # the __NR_* macros which are actually defined.
54 generated += bits/syscall.h
55 $(objpfx)bits/syscall.h: \
56 ../sysdeps/unix/sysv/linux/gen-syscall-h.awk \
57 ../sysdeps/unix/sysv/linux/syscall-names.list
58 $(make-target-directory)
59 LC_ALL=C $(AWK) -f $^ > $@-tmp
60 $(move-if-change) $@-tmp $@
61 before-compile += $(objpfx)bits/syscall.h
63 # All macros defined by <sys/syscall.h>. Include <bits/syscall.h>
64 # explicitly because <sys/sycall.h> skips it if _LIBC is defined.
65 $(objpfx)tst-syscall-list-macros.list: \
66 $(objpfx)bits/syscall.h ../sysdeps/unix/sysv/linux/sys/syscall.h
67 printf '#include <linux/version.h>\n\
68 #include <sys/syscall.h>\n#include <bits/syscall.h>\n' | \
69 $(CC) -E -o $@-tmp $(CFLAGS) $(CPPFLAGS) -x c - -dM
70 $(move-if-change) $@-tmp $@
72 # __NR_* system call names. Used by the test below.
73 $(objpfx)tst-syscall-list-nr.list: \
74 ../sysdeps/unix/sysv/linux/filter-nr-syscalls.awk \
75 $(objpfx)tst-syscall-list-macros.list
76 LC_ALL=C $(AWK) -f $^ > $@-tmp
77 $(move-if-change) $@-tmp $@
79 # SYS_* system call names. Used by the test below.
80 $(objpfx)tst-syscall-list-sys.list: $(objpfx)tst-syscall-list-macros.list
81 LC_ALL=C $(AWK) '/^#define SYS_/ { print substr($$2, 5) }' $< > $@-tmp
82 $(move-if-change) $@-tmp $@
84 tests-special += $(objpfx)tst-syscall-list.out
85 $(objpfx)tst-syscall-list.out: \
86 ../sysdeps/unix/sysv/linux/tst-syscall-list.sh \
87 $(objpfx)tst-syscall-list-macros.list \
88 $(objpfx)tst-syscall-list-nr.list \
89 $(objpfx)tst-syscall-list-sys.list
90 $(BASH) $^ $(AWK) > $@; $(evaluate-test)
92 # Separate object file for access to the constant from the UAPI header.
93 $(objpfx)tst-sysconf-iov_max: $(objpfx)tst-sysconf-iov_max-uapi.o
95 $(objpfx)tst-pkey: $(shared-thread-library)
97 endif # $(subdir) == misc
99 ifeq ($(subdir),time)
100 sysdep_headers += sys/timex.h bits/timex.h
102 sysdep_routines += ntp_gettime ntp_gettimex
103 endif
105 ifeq ($(subdir),signal)
106 tests-special += $(objpfx)tst-signal-numbers.out
107 # Depending on signal.o* is a hack. What we actually want is a dependency
108 # on signal.h and everything it includes. That's impractical to write
109 # in this context, but signal.c includes signal.h and not much else so it'll
110 # be conservatively correct.
111 $(objpfx)tst-signal-numbers.out: \
112 ../sysdeps/unix/sysv/linux/tst-signal-numbers.sh \
113 $(objpfx)signal.o*
114 AWK=$(AWK) $(SHELL) ../sysdeps/unix/sysv/linux/tst-signal-numbers.sh \
115 $(CC) $(patsubst -DMODULE_NAME=%,-DMODULE_NAME=testsuite,$(CPPFLAGS)) \
116 < /dev/null > $@; $(evaluate-test)
117 endif
119 ifeq ($(subdir),socket)
120 sysdep_headers += net/if_ppp.h net/ppp-comp.h \
121 net/ppp_defs.h net/if_arp.h net/route.h net/ethernet.h \
122 net/if_slip.h net/if_packet.h net/if_shaper.h
123 sysdep_routines += cmsg_nxthdr
124 CFLAGS-recvmmsg.c = -fexceptions -fasynchronous-unwind-tables
125 CFLAGS-sendmmsg.c = -fexceptions -fasynchronous-unwind-tables
126 endif
128 ifeq ($(subdir),sunrpc)
129 sysdep_headers += nfs/nfs.h
130 endif
132 ifeq ($(subdir),termios)
133 sysdep_headers += termio.h
134 endif
136 ifeq ($(subdir),posix)
137 sysdep_headers += bits/initspin.h
139 sysdep_routines += sched_getcpu oldglob
141 tests += tst-affinity tst-affinity-pid
143 CFLAGS-fork.c = $(libio-mtsafe)
144 CFLAGS-getpid.o = -fomit-frame-pointer
145 CFLAGS-getpid.os = -fomit-frame-pointer
146 endif
148 ifeq ($(subdir),inet)
149 sysdep_headers += netinet/if_fddi.h netinet/if_tr.h \
150 netipx/ipx.h netash/ash.h netax25/ax25.h netatalk/at.h \
151 netrom/netrom.h netpacket/packet.h netrose/rose.h \
152 neteconet/ec.h netiucv/iucv.h
153 sysdep_routines += netlink_assert_response
154 endif
156 # Don't compile the ctype glue code, since there is no old non-GNU C library.
157 inhibit-glue = yes
159 ifeq ($(subdir),dirent)
160 sysdep_routines += getdirentries getdirentries64
161 endif
163 ifeq ($(subdir),nis)
164 CFLAGS-ypclnt.c = -DUSE_BINDINGDIR=1
165 endif
167 ifeq ($(subdir),io)
168 sysdep_routines += xstatconv internal_statvfs internal_statvfs64 \
169 sync_file_range fallocate fallocate64
170 sysdep_headers += bits/fcntl-linux.h
172 tests += tst-fallocate tst-fallocate64
173 endif
175 ifeq ($(subdir),elf)
176 sysdep-rtld-routines += dl-brk dl-sbrk dl-getcwd dl-openat64 dl-opendir \
177 dl-fxstatat64
179 libof-lddlibc4 = lddlibc4
181 others += pldd
182 install-bin += pldd
183 $(objpfx)pldd: $(objpfx)xmalloc.o
184 endif
186 ifeq ($(subdir),rt)
187 CFLAGS-mq_send.c += -fexceptions
188 CFLAGS-mq_receive.c += -fexceptions
189 endif
191 ifeq ($(subdir),nscd)
192 sysdep-CFLAGS += -DHAVE_EPOLL -DHAVE_SENDFILE -DHAVE_INOTIFY -DHAVE_NETLINK
193 CFLAGS-gai.c += -DNEED_NETLINK
194 endif
196 ifeq ($(subdir),nptl)
197 tests += tst-align-clone tst-getpid1 \
198 tst-thread-affinity-pthread tst-thread-affinity-pthread2 \
199 tst-thread-affinity-sched
200 tests-internal += tst-setgetname
201 endif