Blame hurd/Makefile

Packit 6c4009
# Copyright (C) 1991-2018 Free Software Foundation, Inc.
Packit 6c4009
# This file is part of the GNU C Library.
Packit 6c4009
Packit 6c4009
# The GNU C Library is free software; you can redistribute it and/or
Packit 6c4009
# modify it under the terms of the GNU Lesser General Public
Packit 6c4009
# License as published by the Free Software Foundation; either
Packit 6c4009
# version 2.1 of the License, or (at your option) any later version.
Packit 6c4009
Packit 6c4009
# The GNU C Library is distributed in the hope that it will be useful,
Packit 6c4009
# but WITHOUT ANY WARRANTY; without even the implied warranty of
Packit 6c4009
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
Packit 6c4009
# Lesser General Public License for more details.
Packit 6c4009
Packit 6c4009
# You should have received a copy of the GNU Lesser General Public
Packit 6c4009
# License along with the GNU C Library; if not, see
Packit 6c4009
# <http://www.gnu.org/licenses/>.
Packit 6c4009
Packit 6c4009
subdir := hurd
Packit 6c4009
Packit 6c4009
include ../Makeconfig
Packit 6c4009
Packit 6c4009
headers = hurd.h $(interface-headers) \
Packit 6c4009
	  $(addprefix hurd/,fd.h id.h port.h signal.h sigpreempt.h ioctl.h\
Packit 6c4009
			    userlink.h resource.h lookup.h)
Packit 6c4009
Packit 6c4009
inline-headers = hurd.h $(addprefix hurd/,fd.h signal.h \
Packit 6c4009
					  userlink.h port.h)
Packit 6c4009
Packit 6c4009
# The RPC interfaces go in a separate library.
Packit 6c4009
interface-library := libhurduser
Packit 6c4009
user-interfaces		:= $(addprefix hurd/,\
Packit 6c4009
				       auth startup \
Packit 6c4009
				       process process_request \
Packit 6c4009
				       msg msg_reply msg_request \
Packit 6c4009
				       exec exec_startup crash interrupt \
Packit 6c4009
				       fs fsys io term tioctl socket ifsock \
Packit 6c4009
				       login password pfinet \
Packit 6c4009
				       )
Packit 6c4009
server-interfaces	:= hurd/msg faultexc
Packit 6c4009
Packit 6c4009
routines = hurdstartup hurdinit \
Packit 6c4009
	   hurdid hurdpid hurdrlimit hurdprio hurdexec hurdselect \
Packit 6c4009
	   hurdlookup lookup-retry lookup-at \
Packit 6c4009
	   get-host set-host \
Packit 6c4009
	   path-lookup \
Packit 6c4009
	   setauth \
Packit 6c4009
	   pid2task task2pid \
Packit 6c4009
	   geteuids seteuids getumask fchroot \
Packit 6c4009
	   hurdsock hurdauth \
Packit 6c4009
	   hurdchdir hurdfchdir \
Packit 6c4009
	   privports \
Packit 6c4009
	   msgportdemux \
Packit 6c4009
	   fopenport \
Packit 6c4009
	   vpprintf \
Packit 6c4009
	   ports-get ports-set hurdports hurdmsg \
Packit 6c4009
	   errno-loc \
Packit 6c4009
	   hurdlock \
Packit 6c4009
	   $(sig) $(dtable) $(inlines) port-cleanup report-wait xattr
Packit 6c4009
sig	= hurdsig hurdfault siginfo hurd-raise preempt-sig \
Packit 6c4009
	  trampoline longjmp-ts catch-exc exc2signal hurdkill sigunwind \
Packit 6c4009
	  thread-self thread-cancel intr-msg catch-signal
Packit 6c4009
dtable	= dtable port2fd new-fd alloc-fd intern-fd \
Packit 6c4009
	  getdport openport \
Packit 6c4009
	  fd-close fd-read fd-write hurdioctl ctty-input ctty-output
Packit 6c4009
inlines = $(inline-headers:%.h=%-inlines)
Packit 6c4009
Packit 6c4009
# XXX this is a temporary hack; see hurdmalloc.h
Packit 6c4009
routines += hurdmalloc
Packit 6c4009
Packit 6c4009
# Binary compatibility for libc.so.0.2[GLIBC_2.0].
Packit 6c4009
ifeq ($(build-shared),yes)
Packit 6c4009
routines += compat-20
Packit 6c4009
endif
Packit 6c4009
Packit 6c4009
shared-only-routines = compat-20
Packit 6c4009
Packit 6c4009
# For each of the $(inline-headers), generate a trivial source
Packit 6c4009
# file that will #include it to define its inline functions as real functions.
Packit 6c4009
$(inlines:%=$(objpfx)%.c): $(objpfx)%-inlines.c: %.h
Packit 6c4009
	(h="`echo $(subst /,_,$*) | tr '[a-z]' '[A-Z]'`"; \
Packit 6c4009
	 echo "#define _$${h}_H_EXTERN_INLINE /* Define real function.  */"; \
Packit 6c4009
	 echo "#define _$${h}_H_HIDDEN_DEF    /* Declare hidden definition.  */"; \
Packit 6c4009
	 echo '#include "$<"') > $@-new
Packit 6c4009
	mv -f $@-new $@
Packit 6c4009
generated += $(inlines:=.c)
Packit 6c4009
Packit 6c4009
# Avoid ssp before TLS is initialized.
Packit 6c4009
CFLAGS-hurdstartup.o = $(no-stack-protector)
Packit 6c4009
CFLAGS-RPC_exec_startup_get_info.o = $(no-stack-protector)
Packit 6c4009

Packit 6c4009
# Make generated headers compatible with all support standards
Packit 6c4009
migheaderpipe := | sed -e 's/\<ino64_t\>/__ino64_t/' -e 's/\<loff_t\>/__loff_t/'
Packit 6c4009
include ../mach/Machrules
Packit 6c4009
include ../Rules
Packit 6c4009

Packit 6c4009
# intr-rpc.defs defines the INTR_INTERFACE macro to make the generated RPC
Packit 6c4009
# stubs import <hurd/signal.h> and #define __mach_msg to
Packit 6c4009
# _hurd_intr_rpc_mach_msg.
Packit 6c4009
user-MIGFLAGS += -imacros intr-rpc.defs
Packit 6c4009
Packit 6c4009
# The special exc server for sigthread faults uses a special prefix.
Packit 6c4009
MIGFLAGS-faultexc = -prefix _hurdsig_fault_
Packit 6c4009
Packit 6c4009
# We need this static dependency to get faultexc.h generated the first time.
Packit 6c4009
$(objpfx)hurdfault.o $(objpfx)hurdfault.d: \
Packit 6c4009
	$(objpfx)faultexc_server.h $(objpfx)faultexc_server.c