Update copyright notices with scripts/update-copyrights
[glibc.git] / sysdeps / gnu / Makefile
blobc05708d4796ec5a461b951777c097c04958148a7
1 # Copyright (C) 1996-2014 Free Software Foundation, Inc.
2 # This file is part of the GNU C Library.
4 # The GNU C Library is free software; you can redistribute it and/or
5 # modify it under the terms of the GNU Lesser General Public
6 # License as published by the Free Software Foundation; either
7 # version 2.1 of the License, or (at your option) any later version.
9 # The GNU C Library is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 # Lesser General Public License for more details.
14 # You should have received a copy of the GNU Lesser General Public
15 # License along with the GNU C Library; if not, see
16 # <http://www.gnu.org/licenses/>.
18 # Generate the list of strings for errno codes from the section of the
19 # manual which documents the codes.
21 $(..)sysdeps/gnu/errlist.c: $(..)sysdeps/gnu/errlist.awk \
22 $(..)manual/errno.texi
23 $(AWK) -f $^ > $@-tmp
24 # Make it unwritable so noone will edit it by mistake.
25 -chmod a-w $@-tmp
26 mv -f $@-tmp $@
28 ifeq ($(subdir),stdio-common)
30 errlist-c = $(firstword $(wildcard $(addsuffix /errlist.c,$(sysdirs) .)))
32 ifeq ($(build-shared),yes)
33 $(objpfx)errlist-compat.c: $(errlist-c) $(..)sysdeps/gnu/errlist-compat.awk \
34 $(common-objpfx)Versions.v.i $(before-compile)
35 else
36 $(objpfx)errlist-compat.c: $(errlist-c) $(..)sysdeps/gnu/errlist-compat.awk \
37 $(before-compile)
38 endif
39 $(make-target-directory)
40 $(AWK) -v maxerr=`\
41 $(CC) -S $(CPPFLAGS) $(CFLAGS) -DNOT_IN_libc -DEMIT_ERR_MAX $< -o - \
42 | sed -n 's/^.*@@@[^0-9]*\([0-9]*\)[^0-9]*@@@.*$$/\1/p'` \
43 -f $(..)sysdeps/gnu/errlist-compat.awk \
44 $(wildcard $(sysdirs:=/Versions)) > $@T
45 # Make it unwritable so noone will edit it by mistake.
46 -chmod a-w $@T
47 mv -f $@T $@
48 $(objpfx)errlist-compat.h: $(objpfx)errlist-compat.c
49 sed -n '1p;/ERR_MAX/p' $< > $@T
50 -chmod a-w $@T
51 mv -f $@T $@
52 generated += errlist-compat.c errlist-compat.h
54 # This will force the generation above to happy if need be.
55 $(foreach o,$(object-suffixes) $(object-suffixes:=.d),\
56 $(objpfx)errlist$o): $(objpfx)errlist-compat.h
57 endif
59 ifeq ($(subdir),login)
60 sysdep_routines += setutxent getutxent endutxent getutxid getutxline \
61 pututxline utmpxname updwtmpx getutmpx getutmp
63 sysdep_headers += utmpx.h bits/utmpx.h
64 endif
67 ifeq ($(subdir),inet)
68 sysdep_headers += netinet/udp.h netinet/ip_icmp.h
69 endif
72 ifeq ($(subdir),misc)
73 sysdep_headers += sys/mtio.h
74 endif
77 ifeq ($(subdir),csu)
78 routines += unwind-resume
79 shared-only-routines += unwind-resume
80 CFLAGS-unwind-resume.c += -fexceptions -fasynchronous-unwind-tables
81 endif
83 ifeq ($(subdir),rt)
84 librt-sysdep_routines += rt-unwind-resume
85 librt-shared-only-routines += rt-unwind-resume
86 CFLAGS-rt-unwind-resume.c += -fexceptions -fasynchronous-unwind-tables
87 endif