* sysdeps/unix/sysv/linux/m68k/semtimedop.S: New file.
[glibc/pb-stable.git] / elf / rtld-Rules
blob98bb24af9bdb17b9bc4d7af4fa7c160f3b7d8524
1 # Subroutine makefile for compiling libc modules linked into dynamic linker.
3 # Copyright (C) 2002 Free Software Foundation, Inc.
4 # This file is part of the GNU C Library.
6 # The GNU C Library is free software; you can redistribute it and/or
7 # modify it under the terms of the GNU Lesser General Public
8 # License as published by the Free Software Foundation; either
9 # version 2.1 of the License, or (at your option) any later version.
11 # The GNU C Library is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14 # Lesser General Public License for more details.
16 # You should have received a copy of the GNU Lesser General Public
17 # License along with the GNU C Library; if not, write to the Free
18 # Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
19 # 02111-1307 USA.
21 # This makefile is never used by itself, but only from the rtld-libc.a
22 # rule in Makefile, which does make -f librtld.mk -f rtld-Rules.
23 # librtld.mk is the generated file containing variable definitions for
24 # `rtld-subdirs', a subset of the top-level $(subdirs) list; and for each
25 # SUBDIR in $(rtld-subdirs), `rtld-SUBDIR' listing `module.os' file names.
27 .PHONY: rtld-all
28 rtld-all:
30 # When run from the elf/Makefile to build rtld-libc.a, $(subdir) is elf.
31 ifeq ($(subdir),elf)
33 ifndef rtld-subdirs
34 error This is makefile is a subroutine of elf/Makefile not to be used directly
35 endif
37 include ../Makeconfig
39 rtld-all: $(objpfx)rtld-libc.a
41 $(objpfx)rtld-libc.a: $(foreach dir,$(rtld-subdirs),\
42                                 $(addprefix $(common-objpfx)$(dir)/rtld-,\
43                                             $(rtld-$(dir))))
44         @-rm -f $@T
45         $(AR) cq$(verbose) $@T $^
46         $(RANLIB) $@T
47         mv -f $@T $@
49 # Use the verbose option of ar and tar when not running silently.
50 ifeq    "$(findstring s,$(MAKEFLAGS))" ""       # if not -s
51 verbose := v
52 else                                            # -s
53 verbose :=
54 endif                                           # not -s
57 # For each subdirectory, define a pattern rule that makes all of that
58 # subdirectory's modules at once with one recursive make command.
59 object-suffixes-left := $(rtld-subdirs)
60 define o-iterator-doit
61 $(foreach obj,$(rtld-$o),$(common-objpfx)%/rtld-$(obj)): FORCE ; \
62         +$$(rtld-subdir-make)
63 endef
64 include $(patsubst %,../o-iterator.mk,$(object-suffixes-left))
66 # This is how we descend into each subdirectory.  See below.
67 define rtld-subdir-make
68 $(MAKE) -C ../$* objdir=$(objdir) -f Makefile -f ../elf/rtld-Rules rtld-all \
69         rtld-modules='$(addprefix rtld-,$(rtld-$*))'
70 endef
72 FORCE:
74 else
76 # In this case we are being run by $(rtld-subdir-make), above.
77 # Some other subdir's Makefile has provided all its normal rules,
78 # and we just provide some additional definitions.
80 # These are the basic compilation rules corresponding to the Makerules ones.
81 # The sysd-rules generated makefile already defines pattern rules for rtld-%
82 # targets built from sysdeps source files.
83 $(objpfx)rtld-%.os: %.S $(before-compile); $(compile-command.S)
84 $(objpfx)rtld-%.d: %.S $(before-compile); $(+make-deps)
85 $(objpfx)rtld-%.os: %.s $(before-compile); $(compile-command.s)
86 $(objpfx)rtld-%.d: %.s $(before-compile); $(+make-deps)
87 $(objpfx)rtld-%.os: %.c $(before-compile); $(compile-command.c)
88 $(objpfx)rtld-%.d: %.c $(before-compile); $(+make-deps)
90 # The rules for generated source files.
91 $(objpfx)rtld-%.os: $(objpfx)%.S $(before-compile); $(compile-command.S)
92 $(objpfx)rtld-%.d: $(objpfx)%.S $(before-compile); $(+make-deps)
93 $(objpfx)rtld-%.os: $(objpfx)%.s $(before-compile); $(compile-command.s)
94 $(objpfx)rtld-%.d: $(objpfx)%.s $(before-compile); $(+make-deps)
95 $(objpfx)rtld-%.os: $(objpfx)%.c $(before-compile); $(compile-command.c)
96 $(objpfx)rtld-%.d: $(objpfx)%.c $(before-compile); $(+make-deps)
98 # The command line setting of rtld-modules (see above) tells us
99 # what we need to build, and that tells us what dependency files we need.
100 rtld-all: $(addprefix $(objpfx),$(rtld-modules))
102 # Figure out the dependency files we need.  After respecting the $(omit-deps)
103 # list as applied to the names without the `rtld-', there may be none left.
104 rtld-depfiles := $(patsubst %,$(objpfx)rtld-%.d,\
105                             $(filter-out $(omit-deps),\
106                                          $(rtld-modules:rtld-%.os=%)))
107 ifdef rtld-depfiles
108 -include $(rtld-depfiles)
109 endif
111 # Just in case we wind up e.g. regenerating dependencies for non-rtld objects,
112 # we don't unconditionally modify the flags.  For rtld-% targets, use the
113 # special flags set below.
114 CFLAGS   += $(if $(filter rtld-%,$(@F)),$(CFLAGS-rtld))
115 CPPFLAGS += $(if $(filter rtld-%,$(@F)),$(CPPFLAGS-rtld))
118 # This here is the whole point of all the shenanigans.
119 CPPFLAGS-rtld := -DNOT_IN_libc=1 -DIS_IN_rtld=1
120 CFLAGS-rtld := # blah
123 endif