home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Source Code 1993 July / THE_SOURCE_CODE_CD_ROM.iso / gnu / glibc-1.06 / Rules < prev    next >
Encoding:
Text File  |  1993-05-22  |  3.3 KB  |  118 lines

  1. # Copyright (C) 1991, 1992, 1993 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. #    Propagated rules for making the GNU C library
  21. #
  22. ifneq (,)
  23. This makefile requires GNU Make.
  24. endif
  25.  
  26. all: # Don't let the default goal come from Makeconfig.
  27.  
  28. include ../Makeconfig
  29.  
  30. ifndef    subdir
  31. Each subdirectory makefile must define the `subdir' variable.
  32. endif
  33. # This is benign and useless in GNU make before 3.63.
  34. export subdir := $(subdir)
  35.  
  36. # This is the default target; it makes the library and auxiliary programs.
  37. .PHONY: all
  38. all: lib others
  39.  
  40. ifneq    "$(findstring env,$(origin headers))" ""
  41. headers :=
  42. endif
  43.  
  44. ifeq "$(strip $(headers))" ""
  45. ifneq "$(wildcard $(subdir).h)" ""
  46. override headers := $(subdir).h
  47. endif
  48. endif
  49.  
  50. include ../Makerules
  51.  
  52. .PHONY: subdir_lib
  53. subdir_lib: lib-noranlib
  54.  
  55. # This makes all the auxilliary and test programs.
  56.  
  57. .PHONY: others tests
  58. others: $(addprefix $(objpfx),$(others))
  59. tests: $(tests:%=$(objpfx)%.out)
  60.  
  61. ifneq "$(strip $(others) $(tests))" ""
  62. $(addprefix $(objpfx),$(others) $(tests)): %: %.o $(libc.a)
  63.     $(+link)
  64. endif
  65.  
  66. ifneq "$(strip $(tests))" ""
  67. # These are the implicit rules for making test outputs
  68. # from the test programs and whatever input files are present.
  69. $(objpfx)%.out: $(objpfx)% %.args %.input
  70.     $(dir $<)$(notdir $<) `cat $(word 2,$^)` < $(word 3,$^) > $@
  71. $(objpfx)%.out: $(objpfx)% %.args
  72.     $(dir $<)$(notdir $<) `cat $(word 2,$^)` > $@
  73. $(objpfx)%.out: $(objpfx)% %.input
  74.     $(dir $<)$(notdir $<) < $(word 2,$^) > $@
  75. $(objpfx)%.out: $(objpfx)%
  76.     $(dir $<)$(notdir $<) > $@
  77. endif    # tests
  78.  
  79. export others := $(others)
  80. export tests := $(tests)
  81.  
  82. # This removes everything that can be regenerated
  83. # except for the object files and the object-file library members.
  84. .PHONY: mostlyclean
  85. mostlyclean:
  86.     -rm -f $(addprefix $(objpfx),$(tests) $(others) \
  87.                      $(addsuffix .o,$(tests) $(others)))
  88.     -rm -f core TAGS $(objpfx)depend-$(subdir)
  89.  
  90. # This removes absolutely everything that can be regenerated.
  91. .PHONY: subdir_clean clean realclean
  92. subdir_clean realclean: clean
  93. clean: mostlyclean
  94.     -rm -f $(objects) $(addprefix $(objpfx),$(extra-objs)) \
  95.            $(+depfiles) $(generated)
  96.  
  97. .PHONY: subdir_echo-headers
  98. subdir_echo-headers: echo-headers
  99.  
  100. .PHONY: subdir_echo-distinfo
  101. subdir_echo-distinfo:
  102.     @echo $(addprefix +header+,$(headers)) \
  103.           $(addprefix +nodist+,$(generated))
  104.  
  105. .PHONY: subdir_install
  106. subdir_install: install
  107.  
  108. .PHONY: subdir_TAGS
  109. subdir_TAGS: TAGS
  110.  
  111. # Make the distribution tarfile for the parent makefile.
  112. export distribute := $(distribute)
  113. export generated := $(generated)
  114. .PHONY: subdir_dist dist
  115. subdir_dist: dist
  116. dist: ../Make-dist
  117.     $(MAKE) -f $< $(Make-dist-args)
  118.