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

  1. # Makefile for GNU Objective-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. SHELL = /bin/sh
  61.  
  62. # Define this as & to perform parallel make on a Sequent.
  63. # Note that this has some bugs, and it seems currently necessary 
  64. # to compile all the gen* files first by hand to avoid erroneous results.
  65. P =
  66.  
  67. # This is used in the definition of SUBDIR_USE_ALLOCA.
  68. # ??? Perhaps it would be better if it just looked for *gcc*.
  69. OLDCC = cc
  70.  
  71. # This is used instead of ALL_CFLAGS when compiling with GCC_FOR_TARGET.
  72. # It omits XCFLAGS, and specifies -B./.
  73. # It also specifies -B$(tooldir)/ to find as and ld for a cross compiler.
  74. GCC_CFLAGS=$(INTERNAL_CFLAGS) $(X_CFLAGS) $(T_CFLAGS) $(CFLAGS)
  75.  
  76. # Tools to use when building a cross-compiler.
  77. # These are used because `configure' appends `cross-make'
  78. # to the makefile when making a cross-compiler.
  79.  
  80. target= ... `configure' substitutes actual target name here.
  81. xmake_file= ... `configure' substitutes actual x- file name here.
  82. tmake_file= ... `configure' substitutes actual t- file name here.
  83. #version=`sed -e 's/.*\"\([^ \"]*\)[ \"].*/\1/' < $(srcdir)/version.c`
  84. #mainversion=`sed -e 's/.*\"\([0-9]*\.[0-9]*\).*/\1/' < $(srcdir)/version.c`
  85.  
  86. # Directory where sources are, from where we are.
  87. srcdir = .
  88.  
  89. # Additional system libraries to link with.
  90. CLIB=
  91.  
  92. # Change this to a null string if obstacks are installed in the
  93. # system library.
  94. OBSTACK=obstack.o
  95.  
  96. # Choose the real default target.
  97. ALL=all
  98.  
  99. # End of variables for you to override.
  100.  
  101. # Definition of `all' is here so that new rules inserted by sed
  102. # do not specify the default target.
  103. all: all.indirect
  104.  
  105. # This tells GNU Make version 3 not to put all variables in the environment.
  106. .NOEXPORT:
  107.  
  108. # sed inserts variable overrides after the following line.
  109. ####target overrides
  110. ####host overrides
  111. ####cross overrides
  112. ####build overrides
  113.  
  114. # Now figure out from those variables how to compile and link.
  115.  
  116. all.indirect: Makefile ../cc1objplus
  117.  
  118. # IN_GCC tells obstack.h that we are using gcc's <stddef.h> file.
  119. INTERNAL_CFLAGS = $(CROSS) -DIN_GCC -DOBJCPLUS
  120.  
  121. # This is the variable actually used when we compile.
  122. ALL_CFLAGS = $(INTERNAL_CFLAGS) $(X_CFLAGS) $(T_CFLAGS) $(CFLAGS) $(XCFLAGS)
  123.  
  124. # Likewise.
  125. ALL_CPPFLAGS = $(CPPFLAGS) $(X_CPPFLAGS) $(T_CPPFLAGS)
  126.  
  127. # Even if ALLOCA is set, don't use it if compiling with GCC.
  128.  
  129. SUBDIR_OBSTACK = `if [ x$(OBSTACK) != x ]; then echo ../$(OBSTACK); else true; fi`
  130. SUBDIR_USE_ALLOCA = `case "${CC}" in "${OLDCC}") if [ x$(ALLOCA) != x ]; then echo ../$(ALLOCA); else true; fi ;; esac`
  131. SUBDIR_MALLOC = `if [ x$(MALLOC) != x ]; then echo ../$(MALLOC); else true; fi`
  132.  
  133. # How to link with both our special library facilities
  134. # and the system's installed libraries.
  135. LIBS = $(SUBDIR_OBSTACK) $(SUBDIR_USE_ALLOCA) $(SUBDIR_MALLOC) $(CLIB)
  136.  
  137. # Specify the directories to be searched for header files.
  138. # Both . and srcdir are used, in that order,
  139. # so that tm.h and config.h will be found in the compilation
  140. # subdirectory rather than in the source directory.
  141. INCLUDES = -I. -I.. -I$(srcdir) -I$(srcdir)/.. -I$(srcdir)/../config
  142.  
  143. # Always use -I$(srcdir)/config when compiling.
  144. .c.o:
  145.     $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $<
  146.  
  147. # This tells GNU make version 3 not to export all the variables
  148. # defined in this file into the environment.
  149. .NOEXPORT:
  150.  
  151. # Lists of files for various purposes.
  152.  
  153. # Language specific object files for Objective-C++
  154.  
  155. OBJCPLUS_OBJS = call.o decl.o errfn.o expr.o pt.o sig.o typeck2.o \
  156.  class.o decl2.o error.o gc.o lex.o parse.o ptree.o spew.o typeck.o cvt.o \
  157.  edsel.o except.o init.o method.o search.o tree.o xref.o repo.o obcp-act.o
  158.  
  159.  
  160. # Language-independent object files.
  161. OBJS = `cat ../stamp-objlist` ../c-common.o ../c-pragma.o
  162. OBJDEPS = ../stamp-objlist ../c-common.o ../c-pragma.o
  163.  
  164. compiler: ../cc1objplus
  165. ../cc1objplus: $(P) $(OBJCPLUS_OBJS) $(OBJDEPS) $(LIBDEPS)
  166.     rm -f ../cc1objplus$(exeext)
  167.     $(CC) $(ALL_CFLAGS) -DOBJCPLUS $(LDFLAGS) -o $@ \
  168.           $(OBJCPLUS_OBJS) $(OBJS) $(LIBS)
  169.  
  170. Makefile: $(srcdir)/Makefile.in $(srcdir)/../configure
  171.     cd ..; $(SHELL) config.status
  172.  
  173. native: config.status ../cc1objplus
  174.  
  175. # Compiling object files from source files.
  176.  
  177. # Note that dependencies on obstack.h are not written
  178. # because that file is not part of GCC.
  179.  
  180. # Objective-C++ language specific files.
  181.  
  182. RTL_H = $(srcdir)/../rtl.h $(srcdir)/../rtl.def \
  183.     $(srcdir)/../machmode.h $(srcdir)/../machmode.def
  184. TREE_H = $(srcdir)/../tree.h $(srcdir)/../real.h $(srcdir)/../objc-tree.def \
  185.     $(srcdir)/../machmode.h $(srcdir)/../machmode.def
  186. OBJCXX_TREE_H = $(TREE_H) cp-tree.h tree.def
  187. PARSE_H = parse.h
  188. PARSE_C = parse.c
  189.  
  190. parse.o : $(PARSE_C) $(CONFIG_H) $(OBJCXX_TREE_H) $(srcdir)/../flags.h lex.h
  191.     $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $(BIG_SWITCHFLAG) \
  192.   `echo $(PARSE_C) | sed 's,^\./,,'`
  193.  
  194. CONFLICTS = expect 96 shift/reduce conflicts and 92 reduce/reduce conflicts.
  195. $(PARSE_H) : $(PARSE_C)
  196. $(PARSE_C) : parse.y
  197.     @echo $(CONFLICTS)
  198.     $(BISON) $(BISONFLAGS) -d -o parse.c parse.y
  199.     grep '^#define[     ]*YYEMPTY' parse.c >>parse.h
  200. parse.y : parse.in
  201.     sed `case "$(target)" in i*86-nextpdo-winnt3*) \
  202.           echo " -e /^ifwin32$$/d" ;; esac ` \
  203.           -e "`case "$(target)" in i*86-nextpdo-winnt3*) \
  204.           echo '/^end ifwin32$$/d' ;; \
  205.            *) echo '/^ifwin32$$/,/^end ifwin32$$/d' ;; esac`" \
  206.       $(srcdir)/parse.in >tmp-parse.y
  207.     $(srcdir)/../move-if-change tmp-parse.y parse.y
  208.  
  209. # hash.h really depends on $(srcdir)/obcp.gperf and $(OBCP_GPERF).
  210. # But this would screw things for people that don't have gperf,
  211. # if obcp.gperf got touched, say.
  212. # Thus you have to remove hash.h to force it to be re-made.
  213. hash.h:
  214.     cat $(srcdir)/obcp.gperf $(OBCP_GPERF) | \
  215.     gperf -p -j1 -g -G -o -t -N is_reserved_word '-k1,4,7,$$' >hash.h
  216.  
  217. spew.o : spew.c $(CONFIG_H) $(OBJCXX_TREE_H) \
  218.   $(PARSE_H) $(srcdir)/../flags.h lex.h
  219. lex.o : lex.c $(CONFIG_H) $(OBJCXX_TREE_H) \
  220.   $(PARSE_H) input.c $(srcdir)/../flags.h hash.h lex.h $(srcdir)/../c-pragma.h
  221. decl.o : decl.c $(CONFIG_H) $(OBJCXX_TREE_H) $(srcdir)/../flags.h \
  222.   lex.h decl.h $(srcdir)/../stack.h
  223. decl2.o : decl2.c $(CONFIG_H) $(OBJCXX_TREE_H) $(srcdir)/../flags.h \
  224.   lex.h decl.h
  225. typeck2.o : typeck2.c $(CONFIG_H) $(OBJCXX_TREE_H) $(srcdir)/../flags.h
  226. typeck.o : typeck.c $(CONFIG_H) $(OBJCXX_TREE_H) $(srcdir)/../flags.h $(RTL_H)
  227. class.o : class.c $(CONFIG_H) $(OBJCXX_TREE_H) $(srcdir)/../flags.h
  228. call.o : call.c $(CONFIG_H) $(OBJCXX_TREE_H) $(srcdir)/../flags.h class.h
  229. init.o : init.c $(CONFIG_H) $(OBJCXX_TREE_H) $(srcdir)/../flags.h $(RTL_H)
  230. method.o : method.c $(CONFIG_H) $(OBJCXX_TREE_H) class.h
  231. cvt.o : cvt.c $(CONFIG_H) $(OBJCXX_TREE_H) class.h
  232. search.o : search.c $(CONFIG_H) $(OBJCXX_TREE_H) $(srcdir)/../stack.h $(srcdir)/../flags.h
  233. tree.o : tree.c $(CONFIG_H) $(OBJCXX_TREE_H) $(srcdir)/../flags.h
  234. ptree.o : ptree.c $(CONFIG_H) $(OBJCXX_TREE_H)
  235. gc.o : gc.c $(CONFIG_H) $(OBJCXX_TREE_H) $(srcdir)/../flags.h
  236. except.o : except.c $(CONFIG_H) $(OBJCXX_TREE_H) $(srcdir)/../flags.h $(RTL_H)
  237. expr.o : expr.c $(CONFIG_H) $(OBJCXX_TREE_H) $(RTL_H) $(srcdir)/../flags.h \
  238.   $(srcdir)/../expr.h ../insn-codes.h
  239. edsel.o : edsel.c $(CONFIG_H) $(OBJCXX_TREE_H) $(srcdir)/../stack.h $(srcdir)/../flags.h
  240. xref.o : xref.c $(CONFIG_H) $(OBJCXX_TREE_H) $(srcdir)/../input.h
  241. pt.o : pt.c $(CONFIG_H) $(OBJCXX_TREE_H) decl.h $(PARSE_H)
  242. error.o : error.c $(CONFIG_H) $(OBJCXX_TREE_H)
  243. errfn.o : errfn.c $(CONFIG_H) $(OBJCXX_TREE_H)
  244. sig.o : sig.c $(CONFIG_H) $(OBJCXX_TREE_H) $(srcdir)/../flags.h
  245. repo.o : repo.c $(CONFIG_H) $(OBJCXX_TREE_H)
  246.  
  247. # These exist for maintenance purposes.
  248.  
  249. # Update the tags table.
  250. TAGS: force
  251.     cd $(srcdir) ;                \
  252.     etags *.c *.h ;                \
  253.     echo 'l' | tr 'l' '\f' >> TAGS ;    \
  254.     echo 'parse.in,0' >> TAGS ;        \
  255.     etags -a ../*.h ../*.c;
  256.  
  257. .PHONY: TAGS
  258.  
  259. force:
  260.