]> git.ipfire.org Git - thirdparty/glibc.git/blame - sysdeps/mach/hurd/Makefile
* hurd/hurdsig.c: Use assert_perror for many calls which should
[thirdparty/glibc.git] / sysdeps / mach / hurd / Makefile
CommitLineData
28f540f4
RM
1# Copyright (C) 1993, 1994, 1995 Free Software Foundation, Inc.
2# This file is part of the GNU C Library.
3
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.
8
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.
13
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.
18
19# Get mach-srcdir defined.
20old-in-Makerules := $(in-Makerules)
21in-Makerules :=
22include $(..)sysdeps/mach/Makefile
23in-Makerules := $(old-in-Makerules)
24
25
26ifndef hurd-srcdir-computed
27hurd-srcdir-computed := yes
28
29# If we were configured with `--with-hurd=DIR', then config.make sets
30# hurd-srcdir to DIR. Otherwise guess we are in a big source tree.
31ifndef hurd-srcdir
32hurd-srcdir = ../hurd
33endif
34
35# hurd-srcdir is now set to the logical directory name. This name might be
36# relative to $(objdir), might be relative to the source directory $(..), or
37# might be absolute. We choose among these possibilities by looking for a
38# canonical file in each of those places (in that order).
39f := hurd/hurd_types.defs # Random file that identifies the Hurd source dir.
40f := $(strip $f)
41hurd-srcdir := $(firstword $(patsubst %/$f,%,$(wildcard $(addsuffix /$f,\
42 $(objpfx)$(hurd-srcdir) $(..)$(hurd-srcdir)))) $(hurd-srcdir))
43
44endif # ! hurd-srcdir-computed
45\f
46ifdef in-Makerules
47
48# For the time being, elide directories where nothing at all works.
49subdirs := $(filter-out sunrpc manual,$(subdirs)) # XXX
50
51# Look for header files in hurd/ under the top-level library source directory.
52includes += -I$(..)hurd
53
54# When compiling, use the Hurd header files directly from the sources.
55includes += -I$(hurd-srcdir)
56
57# When compiling, find cthreads.h in the Hurd cthreads source.
58# This directory has some other (private) header file with
59# conflicting names, so we put it last.
60last-includes += -I$(hurd-srcdir)/libthreads
61
62# Find the Hurd header files in the Hurd source.
63vpath hurd/%.h $(hurd-srcdir)
64
65# Do not use any assembly code from sysdeps/unix (and subdirectories).
66# This bypasses all the system call stubs and uses any existing posix or
67# generic C files instead.
68inhibit-sysdep-asm += unix*
69
70# Don't try to generate anything from the installed Unix system and its
71# libraries. That is only of use when building for a Unix system, so as to
72# be compatible with some existing binaries for that system.
73inhibit-glue = yes
74
75
76ifeq (,$(filter mach hurd,$(subdir)))
77# Subdirectories other than hurd/ might use the generated Hurd headers.
78# So make sure we get a chance to run in hurd/ to make them before all else.
79# (But we don't want to do this in mach/, because hurd/ needs some things
80# there, and we know mach/ doesn't need anything from hurd/.)
81
82ifdef objpfx
83hurd-objpfx = $(objpfx)
84else
85hurd-objpfx = $(..)hurd/
86endif
87
88# These are all the generated headers that <hurd.h> includes.
89before-compile += $(patsubst %,$(hurd-objpfx)hurd/%.h,io fs process)
90$(patsubst %,$(hurd-objpfx)hurd/%.%,io fs process):
91 $(MAKE) -C $(..)hurd generated no_deps=t
92endif
93\f
94# Generate errnos.h and sys_errlist.c from the section of the manual that
95# lists all the errno codes.
96
97errno.texinfo = $(..)manual/errno.texi
98
99hurd = $(..)sysdeps/mach/hurd
100
101$(hurd)/errnos.h: $(objpfx)stamp-errnos ;
102$(objpfx)stamp-errnos: $(hurd)/errnos.awk $(errno.texinfo) \
103 $(mach-srcdir)/mach/message.h \
104 $(mach-srcdir)/mach/kern_return.h \
105 $(mach-srcdir)/mach/mig_errors.h \
106 $(mach-srcdir)/device/device_types.h
107 gawk -f $^ > $(hurd)/errnos.h-tmp
108# Make it unwritable so noone will edit it by mistake.
109 -chmod a-w $(hurd)/errnos.h-tmp
110 ./$(..)move-if-change $(hurd)/errnos.h-tmp $(hurd)/errnos.h
0923c7a5
RM
111 test -d CVS && \
112 (cd $(hurd); cvs commit -m'Regenerated from $^' errnos.h)
28f540f4
RM
113 touch $@
114
115$(hurd)/errlist.c: $(hurd)/errlist.awk $(errno.texinfo)
116 gawk -f $^ > $@-tmp
117# Make it unwritable so noone will edit it by mistake.
118 -chmod a-w $@-tmp
119 mv -f $@-tmp $@
120 test -d CVS && cvs commit -m'Regenerated from $^' $@
121\f
122# We install the real libc.a as libcrt.a and as libc.a we install a linker
123# script which does -( -lcrt -lmachuser -lhurduser -).
124
125libc-name = crt
126
127ifeq (,$(subdir))
128install-others += $(libdir)/libc.a
129$(libdir)/libc.a: $(hurd)/libc-ldscript; $(do-install)
130endif
131\f
132
133endif # in-Makerules