]> git.ipfire.org Git - thirdparty/glibc.git/blame - Rules
Fix float range reduction problems (bug 14283).
[thirdparty/glibc.git] / Rules
CommitLineData
da62f81b 1# Copyright (C) 1991-2000,2002,2003,2004,2005,2006,2011
9de06f3c 2# Free Software Foundation, Inc.
28f540f4
RM
3# This file is part of the GNU C Library.
4
5# The GNU C Library is free software; you can redistribute it and/or
41bdb6e2
AJ
6# modify it under the terms of the GNU Lesser General Public
7# License as published by the Free Software Foundation; either
8# version 2.1 of the License, or (at your option) any later version.
28f540f4
RM
9
10# The GNU C Library is distributed in the hope that it will be useful,
11# but WITHOUT ANY WARRANTY; without even the implied warranty of
12# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
41bdb6e2 13# Lesser General Public License for more details.
28f540f4 14
41bdb6e2 15# You should have received a copy of the GNU Lesser General Public
59ba27a6
PE
16# License along with the GNU C Library; if not, see
17# <http://www.gnu.org/licenses/>.
28f540f4
RM
18
19#
20# Rules for making a subdirectory in the GNU C library.
21# Each subdirectory Makefile defines some variables and includes this.
22#
23ifneq (,)
24This makefile requires GNU Make.
25endif
26
27all: # Don't let the default goal come from Makeconfig.
28
e0a3ed4f 29include $(firstword $(..) ../)Makeconfig
28f540f4
RM
30
31ifndef subdir
32Each subdirectory makefile must define the `subdir' variable.
33endif
c7562c74 34# This ` unconfuses emacs.
28f540f4
RM
35# This is benign and useless in GNU make before 3.63.
36export subdir := $(subdir)
37\f
38# This is the default target; it makes the library and auxiliary programs.
39.PHONY: all
96f873b9 40all: objs lib others
28f540f4 41
0413b54c 42ifeq ($(build-programs),yes)
a182affd 43others: $(addprefix $(objpfx),$(extra-objs) \
6c3ebebd
UD
44 $(install-lib) \
45 $(install-bin) $(install-bin-script) \
1ef32c3d 46 $(install-rootsbin) $(install-sbin))
0413b54c
UD
47else
48others: $(addprefix $(objpfx),$(extra-objs) \
49 $(install-lib))
50endif
a182affd 51
28f540f4
RM
52ifneq "$(findstring env,$(origin headers))" ""
53headers :=
54endif
55
56ifneq "$(findstring env,$(origin generated))" ""
57generated :=
58endif
59
924840c5
TBB
60ifneq "$(findstring env,$(origin common-generated))" ""
61common-generated :=
62endif
63
adee0e1f
RM
64# See below. This must be set before Makerules processes it.
65before-compile += $(common-objpfx)bits/stdio_lim.h
66
e0a3ed4f 67include $(..)Makerules
28f540f4
RM
68
69.PHONY: subdir_lib
3bbceb12 70subdir_lib: lib-noranlib
28f540f4
RM
71
72# Some subdirs need to install a dummy library.
73# They can use "$(objpfx)libfnord.a: $(dep-dummy-lib); $(make-dummy-lib)".
6e953631 74dep-dummy-lib = $(common-objpfx)dummy.o
28f540f4
RM
75define make-dummy-lib
76$(AR) cr$(verbose) $@ $<
77endef
74015205 78
6e953631 79$(common-objpfx)dummy.c:
f0097fa0 80 rm -f $@
27ee0a55
AJ
81 (echo 'extern void __dummy__ (void);'; \
82 echo 'void __dummy__ (void) { }') > $@
464d646f 83common-generated += dummy.o dummy.c
28f540f4 84\f
6d52618b 85# This makes all the auxiliary and test programs.
28f540f4
RM
86
87.PHONY: others tests
0413b54c 88ifeq ($(build-programs),yes)
414fd335 89others: $(addprefix $(objpfx),$(others) $(sysdep-others) $(extra-objs))
0413b54c
UD
90else
91others: $(addprefix $(objpfx),$(extra-objs))
92endif
28f540f4 93ifeq ($(cross-compiling),yes)
7cabd57c 94tests: $(addprefix $(objpfx),$(tests) $(test-srcs))
c238ecf7 95xtests: tests
28f540f4 96else
ac556388
GM
97ifeq ($(build-bounded),yes)
98tests-bp.out = $(tests:%=$(objpfx)%-bp.out)
cc24242d 99xtests-bp.out = $(xtests:%=$(objpfx)%-bp.out)
ac556388
GM
100endif
101tests: $(tests:%=$(objpfx)%.out) $(tests-bp.out)
cc24242d 102xtests: tests $(xtests:%=$(objpfx)%.out) $(xtests-bp.out)
786a5421 103endif
28f540f4 104
0413b54c 105ifeq ($(build-programs),yes)
c238ecf7 106binaries-all = $(others) $(sysdep-others) $(tests) $(xtests) $(test-srcs)
ccd8de9a 107binaries-static = $(others-static) $(tests-static) $(xtests-static)
da62f81b
AS
108ifeq (yesyes,$(have-fpie)$(build-shared))
109binaries-pie = $(others-pie) $(tests-pie) $(xtests-pie)
110else
111binaries-pie =
112endif
0413b54c 113else
c238ecf7 114binaries-all = $(tests) $(xtests) $(test-srcs)
3c5edd4d 115binaries-static =
da62f81b 116binaries-pie =
e1586792
UD
117endif
118
da62f81b
AS
119binaries-shared = $(filter-out $(binaries-pie) $(binaries-static), \
120 $(binaries-all))
e1586792
UD
121
122ifneq "$(strip $(binaries-shared))" ""
123$(addprefix $(objpfx),$(binaries-shared)): %: %.o \
9992e360 124 $(sort $(filter $(common-objpfx)lib%,$(link-libc))) \
0413b54c
UD
125 $(addprefix $(csu-objpfx),start.o) $(+preinit) $(+postinit)
126 $(+link)
127endif
e1586792 128
da62f81b
AS
129ifneq "$(strip $(binaries-pie))" ""
130$(addprefix $(objpfx),$(binaries-pie)): %: %.o \
131 $(sort $(filter $(common-objpfx)lib%,$(link-libc))) \
132 $(addprefix $(csu-objpfx),start.o) $(+preinit) $(+postinit)
133 $(+link-pie)
134endif
135
e1586792
UD
136ifneq "$(strip $(binaries-static))" ""
137$(addprefix $(objpfx),$(binaries-static)): %: %.o \
9992e360 138 $(sort $(filter $(common-objpfx)lib%,$(link-libc-static))) \
e1586792
UD
139 $(addprefix $(csu-objpfx),start.o) $(+preinit) $(+postinit)
140 $(+link-static)
0413b54c 141endif
28f540f4 142
ac556388 143ifeq ($(build-bounded),yes)
c238ecf7 144binaries-bounded = $(addsuffix -bp,$(tests) $(xtests) $(test-srcs))
ac556388
GM
145$(addprefix $(objpfx),$(binaries-bounded)): %-bp: %.ob \
146 $(sort $(filter $(common-objpfx)lib%,$(link-libc-bounded))) \
147 $(addprefix $(csu-objpfx),start.ob) $(+preinit) $(+postinit)
148 $(+link-bounded)
149endif
150
c238ecf7 151ifneq "$(strip $(tests) $(xtests) $(test-srcs))" ""
28f540f4
RM
152# These are the implicit rules for making test outputs
153# from the test programs and whatever input files are present.
41d998a6
GM
154
155make-test-out = GCONV_PATH=$(common-objpfx)iconvdata LC_ALL=C \
156 $($*-ENV) $(built-program-cmd) $($*-ARGS)
157$(objpfx)%-bp.out: %.input $(objpfx)%-bp
158 $(make-test-out) > $@ < $(word 1,$^)
196980f5 159$(objpfx)%.out: %.input $(objpfx)%
41d998a6 160 $(make-test-out) > $@ < $(word 1,$^)
196980f5 161$(objpfx)%.out: /dev/null $(objpfx)% # Make it 2nd arg for canned sequence.
41d998a6
GM
162 $(make-test-out) > $@
163
28f540f4
RM
164endif # tests
165\f
166.PHONY: distclean realclean subdir_distclean subdir_realclean \
3c5edd4d 167 subdir_clean subdir_mostlyclean subdir_testclean
28f540f4
RM
168subdir_mostlyclean: mostlyclean
169subdir_clean: clean
170subdir_distclean: distclean
171subdir_realclean: realclean
3c5edd4d 172subdir_testclean: do-tests-clean
28f540f4
RM
173realclean: distclean
174distclean: clean
175
28f540f4
RM
176# We want to install everything except the library itself, but update all
177# our portions of the library because the parent make will install it later
178# (likewise the stubs file).
179.PHONY: subdir_install
613a76ff 180subdir_install: install-no-libc.a lib-noranlib stubs
28f540f4 181
9de06f3c 182.PHONY: subdir_objs subdir_stubs
5d9e8991
RM
183subdir_objs: objs
184subdir_stubs: stubs
28f540f4 185
bd78530f
UD
186# Target required by the Hurd to ensure that all the MiG-generated
187# headers are in place before building a subdirectory.
188.PHONY: before-compile
189before-compile: $(before-compile)
190
3c5edd4d
UD
191$(common-objpfx)dummy.o: $(common-objpfx)dummy.c $(before-compile);
192 $(compile-command.c)
7ef90c15 193
c238ecf7
UD
194# Local Variables:
195# mode: makefile
196# End: