]> sourceware.org Git - glibc.git/blame - Rules
* posix/glob/configure.in: Put AC_ISC_POSIX before AC_CONST.
[glibc.git] / Rules
CommitLineData
28f540f4
RM
1# Copyright (C) 1991, 1992, 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 as
6# published by the Free Software Foundation; either version 2 of the
7# 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#
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
29include ../Makeconfig
30
31ifndef subdir
32Each subdirectory makefile must define the `subdir' variable.
33endif
34# This is benign and useless in GNU make before 3.63.
35export subdir := $(subdir)
36\f
37# This is the default target; it makes the library and auxiliary programs.
38.PHONY: all
96f873b9 39all: objs lib others
28f540f4
RM
40
41ifneq "$(findstring env,$(origin headers))" ""
42headers :=
43endif
44
45ifneq "$(findstring env,$(origin generated))" ""
46generated :=
47endif
48
49ifeq "$(strip $(headers))" ""
50ifneq "$(wildcard $(subdir).h)" ""
51override headers := $(subdir).h
52endif
53endif
54
55include ../Makerules
56
57.PHONY: subdir_lib
96f873b9 58subdir_lib: objs lib-noranlib
28f540f4
RM
59
60# Some subdirs need to install a dummy library.
61# They can use "$(objpfx)libfnord.a: $(dep-dummy-lib); $(make-dummy-lib)".
62dep-dummy-lib = $(objpfx)dummy.o
63define make-dummy-lib
64$(AR) cr$(verbose) $@ $<
65endef
66$(objpfx)dummy.o:
67 @rm -f $(@:.o=.c)
68 echo 'void __dummy__ () { }' > $(@:.o=.c)
69 $(CC) -c $(@:.o=.c) -o $@
70\f
71# This makes all the auxilliary and test programs.
72
73.PHONY: others tests
74others: $(addprefix $(objpfx),$(others))
75ifeq ($(cross-compiling),yes)
76tests: $(addprefix $(objpfx),$(tests))
77else
78tests: $(tests:%=$(objpfx)%.out)
79endif
80
81ifneq "$(strip $(others) $(tests))" ""
82$(addprefix $(objpfx),$(others) $(tests)): %: %.o $(libc.a)
83 $(+link)
84endif
85
86ifneq "$(strip $(tests))" ""
87# These are the implicit rules for making test outputs
88# from the test programs and whatever input files are present.
89$(objpfx)%.out: $(objpfx)% %.args %.input
90 $(dir $<)$(notdir $<) `cat $(word 2,$^)` < $(word 3,$^) > $@
91$(objpfx)%.out: $(objpfx)% %.args
92 $(dir $<)$(notdir $<) `cat $(word 2,$^)` > $@
93$(objpfx)%.out: $(objpfx)% %.input
94 $(dir $<)$(notdir $<) < $(word 2,$^) > $@
95$(objpfx)%.out: $(objpfx)%
96 $(dir $<)$(notdir $<) > $@
97endif # tests
98\f
99.PHONY: distclean realclean subdir_distclean subdir_realclean \
100 subdir_clean subdir_mostlyclean
101subdir_mostlyclean: mostlyclean
102subdir_clean: clean
103subdir_distclean: distclean
104subdir_realclean: realclean
105realclean: distclean
106distclean: clean
107
108.PHONY: subdir_echo-headers
109subdir_echo-headers: echo-headers
110
111.PHONY: subdir_echo-distinfo
112subdir_echo-distinfo:
113 @echo $(addprefix +header+,$(headers)) \
114 $(addprefix +nodist+,$(generated) $(dont_distribute))
115
116# We want to install everything except the library itself, but update all
117# our portions of the library because the parent make will install it later
118# (likewise the stubs file).
119.PHONY: subdir_install
120subdir_install: install-no-libc.a lib-noranlib stubs
121
122.PHONY: subdir_TAGS subdir_dist
123subdir_TAGS: TAGS
124subdir_dist: dist
125
126# Convenient target to update all the generated source files.
127.PHONY: generated
128generated: $(addprefix $(objpfx),$(generated))
This page took 0.036324 seconds and 5 git commands to generate.