Install bits/timex.h header.
[glibc.git] / sysdeps / unix / sysv / linux / Makefile
blob7066ffe6da33e371504ce1b4cbc36464d83a806d
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),socket)
15 sysdep_routines += internal_accept4 recvmmsg internal_recvmmsg
16 endif
18 ifeq ($(subdir),misc)
19 sysdep_routines += sysctl clone llseek umount umount2 readahead \
20 setfsuid setfsgid makedev epoll_pwait signalfd \
21 eventfd eventfd_read eventfd_write prlimit
23 CFLAGS-gethostid.c = -fexceptions
25 sysdep_headers += sys/mount.h sys/acct.h sys/sysctl.h \
26 sys/klog.h sys/kdaemon.h \
27 sys/user.h sys/procfs.h sys/prctl.h \
28 sys/kd.h sys/soundcard.h sys/vt.h \
29 sys/quota.h sys/fsuid.h \
30 scsi/sg.h scsi/scsi.h scsi/scsi_ioctl.h sys/pci.h \
31 sys/ultrasound.h sys/raw.h sys/personality.h sys/epoll.h \
32 bits/a.out.h sys/inotify.h sys/signalfd.h sys/eventfd.h \
33 sys/timerfd.h sys/fanotify.h
35 install-others += $(inst_includedir)/bits/syscall.h
37 tests += tst-clone
39 # Generate the list of SYS_* macros for the system calls (__NR_* macros).
40 # For bi-arch platforms, the CPU/Makefile defines {32,64}bit-predefine and
41 # we generate a file that uses <bits/wordsize.h>.
42 $(objpfx)syscall-%.h $(objpfx)syscall-%.d: ../sysdeps/unix/sysv/linux/sys/syscall.h
43 $(make-target-directory)
44 { \
45 echo '/* Generated at libc build time from kernel syscall list. */';\
46 echo ''; \
47 echo '#ifndef _SYSCALL_H'; \
48 echo '# error "Never use <bits/syscall.h> directly; include <sys/syscall.h> instead."'; \
49 echo '#endif'; \
50 echo ''; \
51 $(CC) -E -MD -MP -MF $(@:.h=.d)-t1 -MT '$(@:.d=.h) $(@:.h=.d)' \
52 -x c $(sysincludes) $< $(addprefix -U,$(64bit-predefine)) \
53 $(addprefix -D,$(32bit-predefine)) -D_LIBC -dM | \
54 sed -n 's@^#define __NR_\([^ ]*\) .*$$@#define SYS_\1 __NR_\1@p' | \
55 LC_ALL=C sort > $(@:.d=.h).new32; \
56 $(CC) -E -MD -MP -MF $(@:.h=.d)-t2 -MT '$(@:.d=.h) $(@:.h=.d)' \
57 -x c $(sysincludes) $< $(addprefix -U,$(32bit-predefine)) \
58 $(addprefix -D,$(64bit-predefine)) -D_LIBC -dM | \
59 sed -n 's@^#define __NR_\([^ ]*\) .*$$@#define SYS_\1 __NR_\1@p' | \
60 LC_ALL=C sort > $(@:.d=.h).new64; \
61 if cmp -s $(@:.d=.h).new32 $(@:.d=.h).new64; then \
62 cat $(@:.d=.h).new32; \
63 else \
64 echo '#include <bits/wordsize.h>'; \
65 echo ''; \
66 LC_ALL=C comm -12 $(@:.d=.h).new32 $(@:.d=.h).new64; \
67 echo '#if __WORDSIZE == 64'; \
68 LC_ALL=C comm -13 $(@:.d=.h).new32 $(@:.d=.h).new64; \
69 echo '#else'; \
70 LC_ALL=C comm -23 $(@:.d=.h).new32 $(@:.d=.h).new64; \
71 echo '#endif'; \
72 fi; \
73 rm -f $(@:.d=.h).new32 $(@:.d=.h).new64; \
74 } > $(@:.d=.h).new
75 mv -f $(@:.d=.h).new $(@:.d=.h)
76 ifneq (,$(objpfx))
77 sed $(sed-remove-objpfx) $(@:.h=.d)-t1 $(@:.h=.d)-t2 > $(@:.h=.d)-t3
78 else
79 cat $(@:.h=.d)-t1 $(@:.h=.d)-t2 > $(@:.h=.d)-t3
80 endif
81 rm -f $(@:.h=.d)-t1 $(@:.h=.d)-t2
82 mv -f $(@:.h=.d)-t3 $(@:.h=.d)
84 $(inst_includedir)/bits/syscall.h: $(objpfx)syscall-list.h $(+force)
85 $(make-target-directory)
86 if test -r $@ && cmp -s $< $@; \
87 then echo 'bits/syscall.h unchanged'; \
88 else $(INSTALL_DATA) $< $@; fi
90 ifndef no_deps
91 # Get the generated list of dependencies (probably /usr/include/asm/unistd.h).
92 -include $(objpfx)syscall-list.d
93 endif
94 generated += syscall-list.h syscall-list.d
95 endif
97 ifeq ($(subdir),time)
98 sysdep_headers += sys/timex.h bits/timex.h
100 sysdep_routines += ntp_gettime ntp_gettimex
101 endif
103 ifeq ($(subdir),socket)
104 sysdep_headers += net/if_ppp.h net/ppp-comp.h \
105 net/ppp_defs.h net/if_arp.h net/route.h net/ethernet.h \
106 net/if_slip.h net/if_packet.h net/if_shaper.h
107 sysdep_routines += cmsg_nxthdr sa_len
108 endif
110 ifeq ($(subdir),sunrpc)
111 sysdep_headers += nfs/nfs.h
112 endif
114 ifeq ($(subdir),termios)
115 sysdep_headers += termio.h
116 endif
118 ifeq ($(subdir),posix)
119 sysdep_headers += bits/initspin.h
121 sysdep_routines += exit-thread sched_getcpu
123 tests += tst-getcpu
124 endif
126 ifeq ($(subdir),inet)
127 sysdep_headers += netinet/if_fddi.h netinet/if_tr.h \
128 netipx/ipx.h netash/ash.h netax25/ax25.h netatalk/at.h \
129 netrom/netrom.h netpacket/packet.h netrose/rose.h \
130 neteconet/ec.h netiucv/iucv.h
131 endif
133 # Don't compile the ctype glue code, since there is no old non-GNU C library.
134 inhibit-glue = yes
136 ifeq ($(subdir),dirent)
137 sysdep_routines += getdirentries getdirentries64
138 endif
140 ifeq ($(subdir),nis)
141 CFLAGS-ypclnt.c = -DUSE_BINDINGDIR=1
142 endif
144 ifeq ($(subdir),io)
145 sysdep_routines += xstatconv internal_statvfs internal_statvfs64 \
146 sync_file_range open_2 open64_2 fallocate fallocate64
147 endif
149 ifeq ($(subdir),elf)
150 sysdep-rtld-routines += dl-brk dl-sbrk
152 CPPFLAGS-lddlibc4 += -DNOT_IN_libc
153 endif
155 ifeq ($(subdir),rt)
156 CFLAGS-mq_send.c += -fexceptions
157 CFLAGS-mq_receive.c += -fexceptions
158 endif
160 ifeq ($(subdir),nscd)
161 CFLAGS-connections.c += -DHAVE_EPOLL -DHAVE_SENDFILE -DHAVE_INOTIFY
162 CFLAGS-pwdcache.c += -DHAVE_SENDFILE
163 CFLAGS-grpcache.c += -DHAVE_SENDFILE
164 CFLAGS-hstcache.c += -DHAVE_SENDFILE
165 CFLAGS-aicache.c += -DHAVE_SENDFILE
166 CFLAGS-initgrcache.c += -DHAVE_SENDFILE
167 CFLAGS-gai.c += -DNEED_NETLINK
168 endif