1 # Copyright (C) 1991, 1992, 1993, 1994, 1995 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.
23 # Some things below (but before including Rules) use configuration variables.
27 headers
= hurd.h
$(interface-headers
) \
28 $(addprefix hurd
/,fd.h id.h port.h signal.h userlink.h \
29 resource.h threadvar.h
)
31 distribute
:= hurdstartup.h hurdfault.h intr-rpc.awk intr-rpc.defs STATUS
33 # The RPC interfaces go in a separate library.
34 interface-library
:= libhurduser
35 user-interfaces
:= $(addprefix hurd
/,\
36 auth process startup \
37 msg msg_reply msg_request \
39 fs fsys io term socket ifsock
)
40 server-interfaces
:= hurd
/msg
42 routines
= hurdstartup hurdinit \
43 hurdid hurdlookup hurdpid hurdrlimit hurdprio hurdexec \
46 getuids setuids getumask fchroot \
47 hurdsock hurdauth invoke-trans \
52 ports-get ports-set hurdports hurdmsg \
53 $(sig
) $(dtable
) hurdinline port-cleanup
54 sig
= hurdsig hurdfault faultexc siginfo hurd-raise preempt-sig \
55 trampoline longjmp-ts catch-exc exc2signal hurdkill sigunwind \
57 dtable
= dtable port2fd new-fd alloc-fd intern-fd \
59 fd-close fd-read fd-write hurdioctl ctty-input ctty-output
61 # XXX this is a temporary hack; see hurdmalloc.h
62 routines
+= hurdmalloc
63 distribute
+= hurdmalloc.h
65 # Get the proper definition of `hurd-srcdir'.
66 include ..
/sysdeps
/mach
/hurd
/Makefile
68 # Use and install the Hurd header files directly out of the Hurd source.
70 # Find the MiG defs files in the Hurd source.
71 vpath
%.defs
$(hurd-srcdir
)
73 # Install all .h and .defs files we find in the Hurd's hurd/ directory.
74 hurd-headers
:= $(patsubst $(hurd-srcdir
)/%,%,\
75 $(wildcard $(addprefix $(hurd-srcdir
)/hurd
/,\
79 # Don't distribute the Hurd headers; they are in the Hurd distribution.
80 dont_distribute
= $(hurd-headers
)
82 # DO NOT try to remake these in any way!!!
83 $(addprefix $(hurd-srcdir
)/,$(hurd-headers
)) : ;
84 install-others
+= $(addprefix $(includedir)/,$(hurd-headers
))
85 $(includedir)/hurd
/%: $(hurd-srcdir
)/hurd
/%; $(do-install
)
87 include ..
/mach
/Machrules
90 # intr-rpc.defs defines the INTR_INTERFACE macro to make the generated RPC
91 # stubs send-interruptible, and to prefix them with `hurd_intr_rpc_'.
92 user-MIGFLAGS
+= -imacros intr-rpc.defs
94 # Run each generated user stub through intr-rpc.awk, which will detect
95 # stubs __hurd_intr_rpc_% and generate the user-callable function for the
96 # stub: this is a wrapper which calls __hurd_intr_rpc_% inside
98 define transform-user-stub
99 gawk
-v call
=$${call} -f
$(word 2,$^
) \
100 $(objpfx
)tmp_
$${call}.c
> $(objpfx
)tmpi_
$${call}.c
; \
101 rm -f
$(objpfx
)tmp_
$${call}.c
;
103 transform-user-stub-output
= tmpi
105 $(foreach if
,$(user-interfaces
),$($(if
)-calls
:%=$(objpfx
)RPC_
%.o
))): \
108 $(user-interfaces
:%=$(objpfx
)%.ustamp
): intr-rpc.awk
110 $(objpfx
)fault
%.c
$(objpfx
)fault
%.h
: $(mach-srcdir
)/mach
/%.defs
111 $(MIG
) $(MIGFLAGS
) -prefix _hurdsig_fault_ \
112 -server
$(@
:.h
=.c
) -sheader
$(@
:.c
=.h
) \
113 -user
/dev
/null
-header
/dev
/null \
115 generated
+= faultexc.c faultexc.h
117 # We need this static dependency to get faultexc.h generated the first time.
118 $(objpfx
)hurdfault.o
$(objpfx
)hurdfault.d
: \
119 $(objpfx
)faultexc.h
$(objpfx
)faultexc.c