Tue Jun 4 00:16:03 1996 Roland McGrath <roland@delasyd.gnu.ai.mit.edu>
[glibc.git] / sysdeps / mach / hurd / Makefile
blobf4b590a06b51a027c8da389bc3a27edd253c3063
1 # Copyright (C) 1993, 1994, 1995, 1996 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 Library General Public License
6 # as published by the Free Software Foundation; either version 2 of
7 # 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 # Library General Public License for more details.
14 # You should have received a copy of the GNU Library General Public
15 # License along with the GNU C Library; see the file COPYING.LIB. If
16 # not, write to the Free Software Foundation, Inc., 675 Mass Ave,
17 # Cambridge, MA 02139, USA.
19 ifdef in-Makerules
21 subdirs := $(filter-out sunrpc,$(subdirs)) # XXX skip broken dirs
23 # Look for header files in hurd/ under the top-level library source directory.
24 includes += -I$(..)hurd
26 # Do not use any assembly code from sysdeps/unix (and subdirectories).
27 # This bypasses all the system call stubs and uses any existing posix or
28 # generic C files instead.
29 inhibit-sysdep-asm += unix*
30 inhibit-unix-syscalls = yes
32 # Don't try to generate anything from the installed Unix system and its
33 # libraries. That is only of use when building for a Unix system, so as to
34 # be compatible with some existing binaries for that system.
35 inhibit-glue = yes
38 ifeq (,$(filter mach hurd,$(subdir)))
39 # Subdirectories other than hurd/ might use the generated Hurd headers.
40 # So make sure we get a chance to run in hurd/ to make them before all else.
41 # (But we don't want to do this in mach/, because hurd/ needs some things
42 # there, and we know mach/ doesn't need anything from hurd/.)
44 ifdef objpfx
45 hurd-objpfx = $(objpfx)
46 else
47 hurd-objpfx = $(..)hurd/
48 endif
50 # These are all the generated headers that <hurd.h> includes.
51 before-compile += $(patsubst %,$(hurd-objpfx)hurd/%.h,io fs process)
52 $(patsubst %,$(hurd-objpfx)hurd/%.%,io fs process):
53 $(MAKE) -C $(..)hurd generated no_deps=t
54 endif
56 # Generate errnos.h from the section of the manual that lists all the errno
57 # codes.
59 errno.texinfo = $(..)manual/errno.texi
61 hurd = $(..)sysdeps/mach/hurd
63 define mach-errno-h
64 ($(foreach h,mach/message.h \
65 mach/kern_return.h \
66 mach/mig_errors.h \
67 device/device_types.h,\
68 echo '#include <$h>';\
70 endef
72 # We use the compiler to generate a list of absolute file names for
73 # the headers we want to search for Mach error codes, listed above (and
74 # incidentally, all other headers those include).
75 -include $(common-objpfx)errnos.d
76 $(common-objpfx)errnos.d: $(mach-errnos-deps)
77 $(mach-errno-h) | \
78 $(CC) $(CPPFLAGS) -M -x c - | \
79 sed $(sed-remove-objpfx) -e 's,- *:,mach-errnos-deps :=,' > $@t
80 mv -f $@t $@
82 $(hurd)/errnos.h: $(common-objpfx)stamp-errnos ;
83 $(common-objpfx)stamp-errnos: $(hurd)/errnos.awk $(errno.texinfo) \
84 $(mach-errnos-deps)
85 gawk -f $^ > $(hurd)/errnos.h-tmp
86 # Make it unwritable so noone will edit it by mistake.
87 -chmod a-w $(hurd)/errnos.h-tmp
88 ./$(..)move-if-change $(hurd)/errnos.h-tmp $(hurd)/errnos.h
89 # test ! -d CVS || \
90 # (cd $(hurd); cvs commit -m'Regenerated from $^' errnos.h)
91 touch $@
92 generated += errnos.d stamp-errnos
94 # We install the real libc.a as libcrt.a and as libc.a we install a linker
95 # script which does -( -lcrt -lmachuser -lhurduser -).
97 libc-name = crt
99 ifeq (,$(subdir))
100 install-others += $(libdir)/libc.a
101 $(libdir)/libc.a: $(hurd)/libc-ldscript; $(do-install)
102 endif
104 # For the shared library, we don't need to do the linker script machination.
105 # Instead, we specify the required libraries when building the shared object.
106 LDLIBS-c.so = -lmachuser -lhurduser
107 sysdep-LDFLAGS += -Wl,-rpath-link=$(..)mach:$(..)hurd
110 endif # in-Makerules