home *** CD-ROM | disk | FTP | other *** search
/ OpenStep 4.2J (Developer) / os42jdev.iso / NextDeveloper / Source / GNU / gcc / cp / Makefile.in < prev    next >
Makefile  |  1996-06-12  |  9KB  |  265 lines

  1. # Makefile for GNU C++ compiler.
  2. #   Copyright (C) 1987, 88, 90-4, 1995 Free Software Foundation, Inc.
  3.  
  4. #This file is part of GNU CC.
  5.  
  6. #GNU CC is free software; you can redistribute it and/or modify
  7. #it under the terms of the GNU General Public License as published by
  8. #the Free Software Foundation; either version 2, or (at your option)
  9. #any later version.
  10.  
  11. #GNU CC 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
  14. #GNU General Public License for more details.
  15.  
  16. #You should have received a copy of the GNU General Public License
  17. #along with GNU CC; see the file COPYING.  If not, write to
  18. #the Free Software Foundation, 59 Temple Place - Suite 330,
  19. #Boston, MA 02111-1307, USA.
  20.  
  21. # The makefile built from this file lives in the language subdirectory.
  22. # Its purpose is to provide support for:
  23. #
  24. # 1) recursion where necessary, and only then (building .o's), and
  25. # 2) building and debugging cc1 from the language subdirectory, and
  26. # 3) nothing else.
  27. #
  28. # The parent makefile handles all other chores, with help from the
  29. # language makefile fragment, of course.
  30. #
  31. # The targets for external use are:
  32. # all, TAGS, ???mostlyclean, ???clean.
  33.  
  34. # Suppress smart makes who think they know how to automake Yacc files
  35. .y.c:
  36.  
  37. # Variables that exist for you to override.
  38. # See below for how to change them for certain systems.
  39.  
  40. ALLOCA =
  41.  
  42. # Various ways of specifying flags for compilations:  
  43. # CFLAGS is for the user to override to, e.g., do a bootstrap with -O2.
  44. # BOOT_CFLAGS is the value of CFLAGS to pass
  45. # to the stage2 and stage3 compilations
  46. # XCFLAGS is used for most compilations but not when using the GCC just built.
  47. XCFLAGS =
  48. CFLAGS = -g
  49. BOOT_CFLAGS = -O $(CFLAGS)
  50. # These exists to be overridden by the x-* and t-* files, respectively.
  51. X_CFLAGS =
  52. T_CFLAGS =
  53.  
  54. X_CPPFLAGS =
  55. T_CPPFLAGS =
  56.  
  57. CC = cc
  58. BISON = bison
  59. BISONFLAGS =
  60. LEX = flex
  61. LEXFLAGS =
  62. AR = ar
  63. AR_FLAGS = rc
  64. SHELL = /bin/sh
  65. MAKEINFO = makeinfo
  66. TEXI2DVI = texi2dvi
  67.  
  68. # Define this as & to perform parallel make on a Sequent.
  69. # Note that this has some bugs, and it seems currently necessary 
  70. # to compile all the gen* files first by hand to avoid erroneous results.
  71. P =
  72.  
  73. # This is used in the definition of SUBDIR_USE_ALLOCA.
  74. # ??? Perhaps it would be better if it just looked for *gcc*.
  75. OLDCC = cc
  76.  
  77. # This is used instead of ALL_CFLAGS when compiling with GCC_FOR_TARGET.
  78. # It omits XCFLAGS, and specifies -B./.
  79. # It also specifies -B$(tooldir)/ to find as and ld for a cross compiler.
  80. GCC_CFLAGS=$(INTERNAL_CFLAGS) $(X_CFLAGS) $(T_CFLAGS) $(CFLAGS)
  81.  
  82. # Tools to use when building a cross-compiler.
  83. # These are used because `configure' appends `cross-make'
  84. # to the makefile when making a cross-compiler.
  85.  
  86. target= ... `configure' substitutes actual target name here.
  87. xmake_file= ... `configure' substitutes actual x- file name here.
  88. tmake_file= ... `configure' substitutes actual t- file name here.
  89. #version=`sed -e 's/.*\"\([^ \"]*\)[ \"].*/\1/' < $(srcdir)/version.c`
  90. #mainversion=`sed -e 's/.*\"\([0-9]*\.[0-9]*\).*/\1/' < $(srcdir)/version.c`
  91.  
  92. # Directory where sources are, from where we are.
  93. srcdir = .
  94.  
  95. # Additional system libraries to link with.
  96. CLIB=
  97.  
  98. # Change this to a null string if obstacks are installed in the
  99. # system library.
  100. OBSTACK=obstack.o
  101.  
  102. # Choose the real default target.
  103. ALL=all
  104.  
  105. # End of variables for you to override.
  106.  
  107. # Definition of `all' is here so that new rules inserted by sed
  108. # do not specify the default target.
  109. all: all.indirect
  110.  
  111. # This tells GNU Make version 3 not to put all variables in the environment.
  112. .NOEXPORT:
  113.  
  114. # sed inserts variable overrides after the following line.
  115. ####target overrides
  116. ####host overrides
  117. ####cross overrides
  118. ####build overrides
  119.  
  120. # Now figure out from those variables how to compile and link.
  121.  
  122. all.indirect: Makefile ../cc1plus
  123.  
  124. # IN_GCC tells obstack.h that we are using gcc's <stddef.h> file.
  125. INTERNAL_CFLAGS = $(CROSS) -DIN_GCC
  126.  
  127. # This is the variable actually used when we compile.
  128. ALL_CFLAGS = $(INTERNAL_CFLAGS) $(X_CFLAGS) $(T_CFLAGS) $(CFLAGS) $(XCFLAGS)
  129.  
  130. # Likewise.
  131. ALL_CPPFLAGS = $(CPPFLAGS) $(X_CPPFLAGS) $(T_CPPFLAGS)
  132.  
  133. # Even if ALLOCA is set, don't use it if compiling with GCC.
  134.  
  135. SUBDIR_OBSTACK = `if [ x$(OBSTACK) != x ]; then echo ../$(OBSTACK); else true; fi`
  136. SUBDIR_USE_ALLOCA = `case "${CC}" in "${OLDCC}") if [ x$(ALLOCA) != x ]; then echo ../$(ALLOCA); else true; fi ;; esac`
  137. SUBDIR_MALLOC = `if [ x$(MALLOC) != x ]; then echo ../$(MALLOC); else true; fi`
  138.  
  139. # How to link with both our special library facilities
  140. # and the system's installed libraries.
  141. LIBS = $(SUBDIR_OBSTACK) $(SUBDIR_USE_ALLOCA) $(SUBDIR_MALLOC) $(CLIB)
  142.  
  143. # Specify the directories to be searched for header files.
  144. # Both . and srcdir are used, in that order,
  145. # so that tm.h and config.h will be found in the compilation
  146. # subdirectory rather than in the source directory.
  147. INCLUDES = -I. -I.. -I$(srcdir) -I$(srcdir)/.. -I$(srcdir)/../config
  148.  
  149. # Always use -I$(srcdir)/config when compiling.
  150. .c.o:
  151.     $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $<
  152.  
  153. # This tells GNU make version 3 not to export all the variables
  154. # defined in this file into the environment.
  155. .NOEXPORT:
  156.  
  157. # Lists of files for various purposes.
  158.  
  159. # Language-specific object files for g++
  160.  
  161. CXX_OBJS = call.o decl.o errfn.o expr.o pt.o sig.o typeck2.o \
  162.  class.o decl2.o error.o gc.o lex.o parse.o ptree.o spew.o typeck.o cvt.o \
  163.  edsel.o except.o init.o method.o search.o tree.o xref.o repo.o
  164.  
  165. # Language-independent object files.
  166. OBJS = `cat ../stamp-objlist` ../c-common.o ../c-pragma.o
  167. OBJDEPS = ../stamp-objlist ../c-common.o ../c-pragma.o
  168.  
  169. compiler: ../cc1plus
  170. ../cc1plus: $(P) $(CXX_OBJS) $(OBJDEPS) $(LIBDEPS)
  171.     rm -f ../cc1plus$(exeext)
  172.     $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ \
  173.           $(CXX_OBJS) $(OBJS) $(LIBS)
  174.  
  175. Makefile: $(srcdir)/Makefile.in $(srcdir)/../configure
  176.     cd ..; $(SHELL) config.status
  177.  
  178. native: config.status ../cc1plus
  179.  
  180. # Compiling object files from source files.
  181.  
  182. # Note that dependencies on obstack.h are not written
  183. # because that file is not part of GCC.
  184.  
  185. # C++ language specific files.
  186.  
  187. RTL_H = $(srcdir)/../rtl.h $(srcdir)/../rtl.def \
  188.     $(srcdir)/../machmode.h $(srcdir)/../machmode.def
  189. TREE_H = $(srcdir)/../tree.h $(srcdir)/../real.h $(srcdir)/../tree.def \
  190.     $(srcdir)/../machmode.h $(srcdir)/../machmode.def
  191. CXX_TREE_H = $(TREE_H) cp-tree.h tree.def
  192. PARSE_H = parse.h
  193. PARSE_C = parse.c
  194.  
  195. parse.o : $(PARSE_C) $(CONFIG_H) $(CXX_TREE_H) $(srcdir)/../flags.h lex.h
  196.     $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $(BIG_SWITCHFLAG) \
  197.   `echo $(PARSE_C) | sed 's,^\./,,'`
  198.  
  199. CONFLICTS = expect 5 shift/reduce conflicts and 38 reduce/reduce conflicts.
  200. $(PARSE_H) : $(PARSE_C)
  201. $(PARSE_C) : parse.y
  202.     @echo $(CONFLICTS)
  203.     $(BISON) $(BISONFLAGS) -d -o parse.c parse.y
  204.     grep '^#define[     ]*YYEMPTY' parse.c >>parse.h
  205. parse.y : parse.in
  206.     sed `case "$(target)" in i*86-nextpdo-winnt3*) \
  207.           echo " -e /^ifwin32$$/d" ;; esac ` \
  208.           -e "`case "$(target)" in i*86-nextpdo-winnt3*) \
  209.           echo '/^end ifwin32$$/d' ;; \
  210.            *) echo '/^ifwin32$$/,/^end ifwin32$$/d' ;; esac`" \
  211.       $(srcdir)/parse.in >tmp-parse.y
  212.     $(srcdir)/../move-if-change tmp-parse.y parse.y
  213.  
  214. # hash.h really depends on $(srcdir)/gxx.gperf and $(GXX_GPERF).
  215. # But this would screw things for people that don't have gperf,
  216. # if gxx.gpref got touched, say.
  217. # Thus you have to remove hash.h to force it to be re-made.
  218. hash.h:
  219.     cat $(srcdir)/gxx.gperf $(GXX_GPERF) | \
  220.     gperf -p -j1 -g -o -t -N is_reserved_word '-k1,4,7,$$' >hash.h
  221.  
  222. spew.o : spew.c $(CONFIG_H) $(CXX_TREE_H) \
  223.   $(PARSE_H) $(srcdir)/../flags.h lex.h
  224. lex.o : lex.c $(CONFIG_H) $(CXX_TREE_H) \
  225.   $(PARSE_H) input.c $(srcdir)/../flags.h hash.h lex.h $(srcdir)/../c-pragma.h
  226. decl.o : decl.c $(CONFIG_H) $(CXX_TREE_H) $(srcdir)/../flags.h \
  227.   lex.h decl.h $(srcdir)/../stack.h
  228. decl2.o : decl2.c $(CONFIG_H) $(CXX_TREE_H) $(srcdir)/../flags.h \
  229.   lex.h decl.h
  230. typeck2.o : typeck2.c $(CONFIG_H) $(CXX_TREE_H) $(srcdir)/../flags.h
  231. typeck.o : typeck.c $(CONFIG_H) $(CXX_TREE_H) $(srcdir)/../flags.h $(RTL_H)
  232. class.o : class.c $(CONFIG_H) $(CXX_TREE_H) $(srcdir)/../flags.h
  233. call.o : call.c $(CONFIG_H) $(CXX_TREE_H) $(srcdir)/../flags.h class.h
  234. init.o : init.c $(CONFIG_H) $(CXX_TREE_H) $(srcdir)/../flags.h $(RTL_H)
  235. method.o : method.c $(CONFIG_H) $(CXX_TREE_H) class.h
  236. cvt.o : cvt.c $(CONFIG_H) $(CXX_TREE_H) class.h
  237. search.o : search.c $(CONFIG_H) $(CXX_TREE_H) $(srcdir)/../stack.h $(srcdir)/../flags.h
  238. tree.o : tree.c $(CONFIG_H) $(CXX_TREE_H) $(srcdir)/../flags.h
  239. ptree.o : ptree.c $(CONFIG_H) $(CXX_TREE_H)
  240. gc.o : gc.c $(CONFIG_H) $(CXX_TREE_H) $(srcdir)/../flags.h
  241. except.o : except.c $(CONFIG_H) $(CXX_TREE_H) $(srcdir)/../flags.h $(RTL_H)
  242. expr.o : expr.c $(CONFIG_H) $(CXX_TREE_H) $(RTL_H) $(srcdir)/../flags.h \
  243.   $(srcdir)/../expr.h ../insn-codes.h
  244. edsel.o : edsel.c $(CONFIG_H) $(CXX_TREE_H) $(srcdir)/../stack.h $(srcdir)/../flags.h
  245. xref.o : xref.c $(CONFIG_H) $(CXX_TREE_H) $(srcdir)/../input.h
  246. pt.o : pt.c $(CONFIG_H) $(CXX_TREE_H) decl.h $(PARSE_H)
  247. error.o : error.c $(CONFIG_H) $(CXX_TREE_H)
  248. errfn.o : errfn.c $(CONFIG_H) $(CXX_TREE_H)
  249. sig.o : sig.c $(CONFIG_H) $(CXX_TREE_H) $(srcdir)/../flags.h
  250. repo.o : repo.c $(CONFIG_H) $(CXX_TREE_H)
  251.  
  252. # These exist for maintenance purposes.
  253.  
  254. # Update the tags table.
  255. TAGS: force
  256.     cd $(srcdir) ;                \
  257.     etags *.c *.h ;                \
  258.     echo 'l' | tr 'l' '\f' >> TAGS ;    \
  259.     echo 'parse.in,0' >> TAGS ;         \
  260.     etags -a ../*.h ../*.c;
  261.  
  262. .PHONY: TAGS
  263.  
  264. force:
  265.