X-Git-Url: http://git.csclub.uwaterloo.ca/?p=kopensolaris-gnu%2Fglibc.git;a=blobdiff_plain;f=Rules;h=b548d6a2c8bd1e944232c8a9f6f489054249ef46;hp=5f1b33a35ba71901a0609d0031b5a9cae44c5745;hb=dabceb591fb339501a0172df98bd69bc165197be;hpb=18e92637bdd28ed8d38338d56f7d1ef847b2ec37 diff --git a/Rules b/Rules index 5f1b33a35b..b548d6a2c8 100644 --- a/Rules +++ b/Rules @@ -1,4 +1,4 @@ -# Copyright (C) 1991, 1992 Free Software Foundation, Inc. +# Copyright (C) 1991, 1992, 1993, 1994 Free Software Foundation, Inc. # This file is part of the GNU C Library. # The GNU C Library is free software; you can redistribute it and/or @@ -17,12 +17,15 @@ # Cambridge, MA 02139, USA. # -# Propagated rules for making the GNU C library +# Rules for making a subdirectory in the GNU C library. +# Each subdirectory Makefile defines some variables and includes this. # ifneq (,) This makefile requires GNU Make. endif +all: # Don't let the default goal come from Makeconfig. + include ../Makeconfig ifndef subdir @@ -31,14 +34,18 @@ endif # This is benign and useless in GNU make before 3.63. export subdir := $(subdir) -# This is the default target; it makes the library. +# This is the default target; it makes the library and auxiliary programs. .PHONY: all -all: lib +all: lib others ifneq "$(findstring env,$(origin headers))" "" headers := endif +ifneq "$(findstring env,$(origin generated))" "" +generated := +endif + ifeq "$(strip $(headers))" "" ifneq "$(wildcard $(subdir).h)" "" override headers := $(subdir).h @@ -74,6 +81,12 @@ $(objpfx)%.out: $(objpfx)% $(dir $<)$(notdir $<) > $@ endif # tests +# Because the link above depends on libc.a, which I don't want built +# automatically, this is necessary. -mib +ifdef mib_hacks +others := +endif + export others := $(others) export tests := $(tests) @@ -81,15 +94,16 @@ export tests := $(tests) # except for the object files and the object-file library members. .PHONY: mostlyclean mostlyclean: - -rm -f $(addprefix $(objpfx),$(tests) $(others)) - -rm -f core TAGS depend + -rm -f $(addprefix $(objpfx),$(tests) $(others) \ + $(addsuffix .o,$(tests) $(others))) + -rm -f core TAGS $(objpfx)depend-$(subdir) # This removes absolutely everything that can be regenerated. .PHONY: subdir_clean clean realclean subdir_clean realclean: clean -+objs := $(objects) clean: mostlyclean - -rm -f $(+objs) $(+depfiles) + -rm -f $(objects) $(addprefix $(objpfx),$(extra-objs)) \ + $(+depfiles) $(generated) .PHONY: subdir_echo-headers subdir_echo-headers: echo-headers @@ -97,10 +111,13 @@ subdir_echo-headers: echo-headers .PHONY: subdir_echo-distinfo subdir_echo-distinfo: @echo $(addprefix +header+,$(headers)) \ - $(addprefix +nodist+,$(dont_distribute)) - + $(addprefix +nodist+,$(generated) $(dont_distribute)) + +# We want to install everything except the library itself, but update all +# our portions of the library because the parent make will install it later +# (likewise the stubs file). .PHONY: subdir_install -subdir_install: install +subdir_install: install-no-libc.a lib-noranlib stubs .PHONY: subdir_TAGS subdir_TAGS: TAGS @@ -108,7 +125,12 @@ subdir_TAGS: TAGS # Make the distribution tarfile for the parent makefile. export distribute := $(distribute) export dont_distribute := $(dont_distribute) +export generated := $(generated) .PHONY: subdir_dist dist subdir_dist: dist dist: ../Make-dist $(MAKE) -f $< $(Make-dist-args) + +# Convenient target to update all the generated source files. +.PHONY: generated +generated: $(generated)