home *** CD-ROM | disk | FTP | other *** search
/ Fresh Fish 7 / FreshFishVol7.bin / bbs / gnu / libg++-2.6-fsf.lha / libg++-2.6 / libiberty / Makefile.in < prev    next >
Makefile  |  1994-05-18  |  8KB  |  269 lines

  1. #
  2. # Makefile
  3. #   Copyright (C) 1990, 1991, 1992 Free Software Foundation
  4. #
  5. # This file is part of the libiberty library.
  6. # Libiberty is free software; you can redistribute it and/or
  7. # modify it under the terms of the GNU Library General Public
  8. # License as published by the Free Software Foundation; either
  9. # version 2 of the License, or (at your option) any later version.
  10. #
  11. # Libiberty 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. # Library General Public License for more details.
  15. #
  16. # You should have received a copy of the GNU Library General Public
  17. # License along with libiberty; see the file COPYING.LIB.  If
  18. # not, write to the Free Software Foundation, Inc., 675 Mass Ave,
  19. # Cambridge, MA 02139, USA.
  20. #
  21.  
  22. # This file was written, and is maintained by K. Richard Pixley
  23. # <rich@cygnus.com>.
  24.  
  25. #
  26. # Makefile for libiberty directory
  27. #
  28.  
  29. srcdir = .
  30.  
  31. prefix = /usr/local
  32.  
  33. exec_prefix = $(prefix)
  34. bindir = $(exec_prefix)/bin
  35. libdir = $(exec_prefix)/lib
  36.  
  37. datadir = $(prefix)/lib
  38.  
  39. mandir = $(prefix)/man
  40. man1dir = $(mandir)/man1
  41. man2dir = $(mandir)/man2
  42. man3dir = $(mandir)/man3
  43. man4dir = $(mandir)/man4
  44. man5dir = $(mandir)/man5
  45. man6dir = $(mandir)/man6
  46. man7dir = $(mandir)/man7
  47. man8dir = $(mandir)/man8
  48. man9dir = $(mandir)/man9
  49. infodir = $(prefix)/info
  50. includedir = $(prefix)/include
  51. oldincludedir =
  52. docdir = $(datadir)/doc
  53.  
  54. SHELL = /bin/sh
  55.  
  56. INSTALL = install -c
  57. INSTALL_PROGRAM = $(INSTALL)
  58. INSTALL_DATA = $(INSTALL)
  59.  
  60. AR = ar
  61. AR_FLAGS = rc
  62.  
  63. CFLAGS = -g
  64. BISON = bison
  65. MAKEINFO = makeinfo
  66. RANLIB = ranlib
  67.  
  68. MAKEOVERRIDES =
  69.  
  70. TARGETLIB = libiberty.a
  71.  
  72. CONFIG_H = lconfig.h
  73. NEEDED_LIST = lneeded-list
  74.  
  75. # HOST_OFILES contains the list of objects that should be in the
  76. # library (in addition to the REQUIRED_OFILES and EXTRA_OFILES).
  77. # A configuration may override this with a fixed list a object files
  78. # names (hard to maintain), or some other way to generate a list.
  79. HOST_OFILES=`cat needed-list`
  80.  
  81. # Extra targets that the top-level target depends on.
  82. # Specifically, what needs to be made before HOST_OFILES can be used.
  83. # Can be empty if HOST_OFILES is just a list of file names.
  84. DO_ALSO = needed-list
  85.  
  86. # A configuration can specify extra .o files that should be included,
  87. # even if they are in libc. (Perhaps the libc version is buggy.)
  88. EXTRA_OFILES = 
  89.  
  90. all:    $(TARGETLIB)
  91. .PHONY: check installcheck
  92. check installcheck:
  93.  
  94.  
  95. #### Host, target, and site specific Makefile fragments come in here.
  96. ###
  97.  
  98. INCDIR=$(srcdir)/../include
  99.  
  100. .c.o:
  101.     $(CC) -c $(CFLAGS) -I. -I$(INCDIR) $(HDEFINES) $<
  102.  
  103. # The default target just invokes make recursively.
  104. # However, the automatic configuration (in config/mh_default).
  105. # first causes it to figure out the objects missing in libc.
  106. info install-info clean-info dvi:
  107.  
  108. # NOTE: If you add new files to the library, add them to this list
  109. # (alphabetical), and add them to REQUIRED_OFILES or 'functions.def'.
  110. CFILES = alloca.c argv.c basename.c bcmp.c bcopy.c bzero.c \
  111.      clock.c concat.c cplus-dem.c fdmatch.c \
  112.      getcwd.c getopt.c getopt1.c getpagesize.c getruntime.c \
  113.          floatformat.c index.c insque.c \
  114.      memchr.c memcmp.c memcpy.c memmove.c memset.c \
  115.          obstack.c random.c rename.c rindex.c sigsetmask.c spaces.c \
  116.      strcasecmp.c strncasecmp.c \
  117.          strchr.c strdup.c strerror.c strrchr.c strsignal.c \
  118.          strstr.c strtod.c strtol.c strtoul.c tmpnam.c \
  119.      vasprintf.c vfork.c vfprintf.c vprintf.c vsprintf.c waitpid.c \
  120.      xatexit.c xexit.c xmalloc.c
  121. # These are always included in the library.
  122. REQUIRED_OFILES = argv.o basename.o concat.o cplus-dem.o fdmatch.o \
  123.   getopt.o getopt1.o getruntime.o \
  124.   floatformat.o obstack.o spaces.o strerror.o strsignal.o \
  125.   xatexit.o xexit.o xmalloc.o 
  126.  
  127. # Do we want/need any config overrides?
  128. #     
  129.  
  130. STAGESTUFF = $(TARGETLIB) *.o
  131.  
  132. INSTALL_DEST = libdir
  133. install: install_to_$(INSTALL_DEST)
  134.  
  135. install_to_libdir: all
  136.     $(INSTALL_DATA) $(TARGETLIB) $(libdir)/$(TARGETLIB).n
  137.     ( cd $(libdir) ; $(RANLIB) $(libdir)/$(TARGETLIB).n )
  138.     mv -f $(libdir)/$(TARGETLIB).n $(libdir)/$(TARGETLIB)
  139.  
  140. install_to_tooldir: all
  141.     $(INSTALL_DATA) $(TARGETLIB) $(tooldir)/lib/$(TARGETLIB).n
  142.     ( cd $(tooldir) ; $(RANLIB) $(tooldir)/lib/$(TARGETLIB).n )
  143.     mv -f $(tooldir)/lib/$(TARGETLIB).n $(tooldir)/lib/$(TARGETLIB)
  144.  
  145. # The default configuration adds to libiberty all those functions that are
  146. # missing in libc.  More precisely, it includes whatever $(CC) fails to find.
  147. # Then a sed+awk combination translates the ld error messages into
  148. # a list of .o files.
  149.  
  150. needed-list: $(NEEDED_LIST)
  151.     cp $(NEEDED_LIST) needed-list
  152.  
  153. lneeded-list: $(EXTRA_OFILES) needed.awk errors
  154.     rm -f lneeded-list
  155.     f=""; \
  156.     for i in `awk -f needed.awk <errors` $(EXTRA_OFILES) ; do \
  157.       case " $$f " in \
  158.         *" $$i "*) ;; \
  159.         *) f="$$f $$i" ;; \
  160.       esac ; \
  161.     done ; \
  162.     echo $$f >>lneeded-list
  163.  
  164. # Generate an awk script that looks for functions in functions.def
  165.  
  166. needed.awk: $(srcdir)/functions.def Makefile
  167.     echo "# !Automatically generated from $(srcdir)/functions.def"\
  168.       "- DO NOT EDIT!" >needed.awk
  169.     grep '^DEF(' < $(srcdir)/functions.def \
  170.         | sed -e '/DEF/s|DEF.\([^,]*\).*|/\1/ { printf "\1.o " }|' \
  171.         >>needed.awk
  172.  
  173. config.h: $(CONFIG_H)
  174.     cp $(CONFIG_H) config.h
  175.  
  176. lconfig.h: needed2.awk errors
  177.     echo "/* !Automatically generated from $(srcdir)/functions.def"\
  178.       "- DO NOT EDIT! */" >lconfig.h
  179.     awk -f needed2.awk <errors >>lconfig.h
  180.  
  181. # Generate an awk script that looks for variables in functions.def
  182.  
  183. needed2.awk: $(srcdir)/functions.def Makefile
  184.     echo "# !Automatically generated from $(srcdir)/functions.def"\
  185.       "- DO NOT EDIT!" >needed2.awk
  186.     grep '^DEFVAR(' < $(srcdir)/functions.def \
  187.      | sed -e '/DEFVAR/s|DEFVAR.\([^,]*\).*|/\1/ { printf "#ifndef NEED_\1\\n#define NEED_\1\\n#endif\\n" }|' \
  188.      >>needed2.awk
  189.     grep '^DEFFUNC(' < $(srcdir)/functions.def \
  190.      | sed -e '/DEFFUNC/s|DEFFUNC.\([^,]*\).*|/\1/ { printf "#ifndef NEED_\1\\n#define NEED_\1\\n#endif\\n" }|' \
  191.      >>needed2.awk
  192.  
  193. dummy.o: $(srcdir)/dummy.c $(srcdir)/functions.def
  194.     $(CC) -c $(CFLAGS) -I. -I$(INCDIR) $(HDEFINES) $(srcdir)/dummy.c 2>/dev/null
  195.  
  196. errors: dummy.o $(EXTRA_OFILES)
  197.     -($(CC) -o dummy $(CFLAGS) $(LDFLAGS) dummy.o $(EXTRA_OFILES) $(LOADLIBES)) >errors 2>&1 || true
  198.  
  199. $(HOST_OFILES) $(REQUIRED_OFILES) : config.h
  200.  
  201. RULE1 = $(TARGETLIB)
  202. $(RULE1): $(REQUIRED_OFILES) $(DO_ALSO) .always.
  203.     @$(MAKE) RULE1=not-used RULE2=$(TARGETLIB) \
  204.          HOST_OFILES="$(HOST_OFILES)" \
  205.         "CC=$(CC)" "CFLAGS=$(CFLAGS)" \
  206.         "AR=$(AR)" "AR_FLAGS=$(AR_FLAGS)" "RANLIB=$(RANLIB)" \
  207.         "SHELL=$(SHELL)"
  208.  
  209. # Rule invoked by recursive make in $(RULE1).
  210. RULE2 = not-used
  211. $(RULE2): $(REQUIRED_OFILES) $(HOST_OFILES)
  212.     rm -rf $(TARGETLIB)
  213.     $(AR) $(AR_FLAGS) $(TARGETLIB) \
  214.       $(REQUIRED_OFILES) $(HOST_OFILES)
  215.     $(RANLIB) $(TARGETLIB)
  216.  
  217. .always.:
  218. # Do nothing.
  219.  
  220. .PHONEY: all etags tags ls clean stage1 stage2 .always.
  221.  
  222. etags tags: TAGS
  223.  
  224. TAGS: $(CFILES) $(HFILES)
  225.     etags `for i in $(HFILES) $(CFILES); do echo $(srcdir)/$$i ; done`
  226.  
  227. # The standalone demangler (c++filt) has been moved to binutils.
  228. demangle:
  229.     @echo "The standalone demangler, now named c++filt, is now"
  230.     @echo "a part of binutils."
  231.     @false
  232.  
  233. ls:
  234.     @echo Makefile $(HFILES) $(CFILES)
  235.  
  236. # Need to deal with profiled libraries, too.
  237.  
  238. mostlyclean:
  239.     rm -f *.o core errs \#* *.E a.out
  240.     rm -f needed.awk needed2.awk errors dummy needed-list config.h
  241.     rm -f $(CONFIG_H) $(NEEDED_LIST)
  242. clean: mostlyclean
  243.     rm -f *.a
  244. distclean: clean
  245.     rm -f *~ Makefile config.status alloca-conf.h TAGS
  246. realclean: distclean
  247.  
  248. force:
  249.  
  250. Makefile: $(srcdir)/Makefile.in $(host_makefile_frag) $(target_makefile_frag)
  251.     $(SHELL) ./config.status
  252.  
  253. argv.o: $(INCDIR)/libiberty.h
  254. basename.o: $(INCDIR)/libiberty.h
  255. concat.o: $(INCDIR)/libiberty.h
  256. cplus-dem.o: $(INCDIR)/demangle.h
  257. fdmatch.o: $(INCDIR)/libiberty.h
  258. getopt.o: $(INCDIR)/getopt.h
  259. getopt1.o: $(INCDIR)/getopt.h
  260. getruntime.o: $(INCDIR)/libiberty.h
  261. floatformat.o: $(INCDIR)/floatformat.h
  262. obstack.o: $(INCDIR)/obstack.h
  263. spaces.o: $(INCDIR)/libiberty.h
  264. strerror.o: $(INCDIR)/libiberty.h
  265. strsignal.o: $(INCDIR)/libiberty.h
  266. xatexit.o: $(INCDIR)/libiberty.h
  267. xexit.o: $(INCDIR)/libiberty.h
  268. xmalloc.o: $(INCDIR)/libiberty.h
  269.