Update.
[glibc.git] / sysdeps / unix / sysv / linux / Makefile
blobffd446d9f8ca2921f367f5af0f2f6a2eb186bb0c
1 ifeq ($(subdir),csu)
2 CFLAGS-init-first.c = -fkeep-inline-functions
4 sysdep_routines += errno-loc
5 endif
7 ifeq ($(subdir),db2)
8 CPPFLAGS += -DHAVE_LLSEEK=1
9 endif
11 ifeq ($(subdir),misc)
12 sysdep_routines += sysctl clone llseek getresuid getresgid sys_setresuid \
13 umount umount2
15 sysdep_headers += sys/mount.h sys/acct.h sys/sysctl.h sys/mtio.h \
16 sys/io.h sys/klog.h sys/kdaemon.h \
17 sys/user.h sys/sysmacros.h sys/procfs.h sys/prctl.h \
18 sys/debugreg.h sys/kd.h sys/soundcard.h sys/vt.h \
19 sys/quota.h sys/fsuid.h bits/mman.h \
20 scsi/sg.h scsi/scsi.h sys/pci.h sys/ultrasound.h \
21 sys/sendfile.h
23 install-others += $(inst_includedir)/bits/syscall.h
25 # Generate the list of SYS_* macros for the system calls (__NR_* macros).
26 $(objpfx)syscall-%.h $(objpfx)syscall-%.d: ../sysdeps/unix/sysv/linux/sys/syscall.h
27 rm -f $(@:.h=.d)
28 { \
29 echo '/* Generated at libc build time from kernel syscall list. */';\
30 echo ''; \
31 echo '#ifndef _SYSCALL_H'; \
32 echo '# error "Never use <bits/syscall.h> directly; include <sys/syscall.h> instead."'; \
33 echo '#endif'; \
34 echo ''; \
35 SUNPRO_DEPENDENCIES='$(@:.h=.d) $(patsubst $(objpfx)%,$$(objpfx)%,\
36 $(@:.d=.h) $(@:.h=.d))' \
37 $(CC) -E -x c $< -D_LIBC -dM | \
38 sed -n 's@^#define __NR_\([^ ]*\) .*$$@#define SYS_\1 __NR_\1@p'; \
39 } > $(@:.d=.h).new
40 mv -f $(@:.d=.h).new $(@:.d=.h)
42 $(inst_includedir)/bits/syscall.h: $(objpfx)syscall-list.h $(+force)
43 $(make-target-directory)
44 if test -r $@ && cmp -s $< $@; \
45 then echo 'bits/syscall.h unchanged'; \
46 else $(INSTALL_DATA) $< $@; fi
48 ifndef no_deps
49 # Get the generated list of dependencies (probably /usr/include/asm/unistd.h).
50 -include $(objpfx)syscall-list.d
51 endif
52 generated += syscall-list.h syscall-list.d
53 endif
55 ifeq ($(subdir),time)
56 sysdep_headers += sys/timex.h
57 endif
59 ifeq ($(subdir),socket)
60 sysdep_headers += net/if.h net/if_ppp.h net/ppp-comp.h \
61 net/ppp_defs.h net/if_arp.h net/route.h net/ethernet.h \
62 net/if_slip.h net/if_packet.h
63 sysdep_routines += cmsg_nxthdr sa_len
64 endif
66 ifeq ($(subdir),sunrpc)
67 sysdep_headers += nfs/nfs.h
68 endif
70 ifeq ($(subdir),termios)
71 sysdep_headers += termio.h
72 endif
74 ifeq ($(subdir),stdio-common)
75 # Just disable the auto generation in sysdeps/generic
76 inhibit-siglist := yes
77 endif
79 ifeq ($(subdir),posix)
80 sysdep_headers += bits/pthreadtypes.h
81 endif
83 ifeq ($(subdir),inet)
84 sysdep_headers += netinet/in_systm.h netinet/udp.h \
85 netinet/if_fddi.h netinet/if_tr.h netinet/igmp.h \
86 netinet/ip_fw.h netinet/ip_icmp.h netipx/ipx.h \
87 sys/socketvar.h netash/ash.h netax25/ax25.h netatalk/at.h \
88 netrom/netrom.h netpacket/packet.h netrose/rose.h
89 endif
91 # Don't compile the ctype glue code, since there is no old non-GNU C library.
92 inhibit-glue = yes
94 # Tell sysdeps/posix/Makefile that we create stdio_lim.h differently.
95 inhibit-stdio_lim = yes
97 $(common-objpfx)bits/stdio_%.h $(common-objpfx)bits/stdio_%.d: \
98 $(..)sysdeps/unix/sysv/linux/stdio_%.h.in
99 rm -f $(@:.h=.d) $(@:.d=.h)-t
100 echo '#include <linux/limits.h>' | \
101 SUNPRO_DEPENDENCIES='$(@:.h=.d) \
102 $(patsubst $(common-objpfx)%,$$(common-objpfx)%,\
103 $(@:.d=.h) $(@:.h=.d))' \
104 $(CC) -E -dM - > $(@:.d=.h)-t
105 fopen_max=`sed -n 's/^#define OPEN_MAX //p' $(@:.d=.h)-t`; \
106 filename_max=`sed -n 's/^#define PATH_MAX //p' $(@:.d=.h)-t`; \
107 if test -n "$$fopen_max" && test -n "$$filename_max"; then \
108 sed -e "s/DEFAULT_FOPEN_MAX/$$fopen_max/" \
109 -e "s/DEFAULT_FILENAME_MAX/$$filename_max/" $< \
110 > $(@:.d=.h).new && \
111 mv -f $(@:.d=.h).new $(@:.d=.h); \
112 else exit 1; fi
113 # Remove this last so that it can be examined if something went wrong.
114 rm -f $(@:.d=.h)-t
115 ifndef no_deps
116 # Get the list of dependencies (probably /usr/include/linux/limits.h).
117 -include $(common-objpfx)bits/stdio_lim.d
118 endif
120 ifeq ($(subdir),signal)
121 sysdep_routines += rt_sigsuspend rt_sigprocmask rt_sigtimedwait \
122 rt_sigqueueinfo rt_sigaction rt_sigpending
123 endif
125 ifeq ($(subdir),dirent)
126 sysdep_routines += getdents64
127 endif
129 ifeq ($(subdir),nis)
130 CFLAGS-ypclnt.c = -DUSE_BINDINGDIR=1
131 endif
133 common-generated += bits/stdio_lim.h bits/stdio_lim.d