# Makefile for GNU Objective-C++ compiler. # Copyright (C) 1987, 88, 90-4, 1995 Free Software Foundation, Inc. #This file is part of GNU CC. #GNU CC is free software; you can redistribute it and/or modify #it under the terms of the GNU General Public License as published by #the Free Software Foundation; either version 2, or (at your option) #any later version. #GNU CC is distributed in the hope that it will be useful, #but WITHOUT ANY WARRANTY; without even the implied warranty of #MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #GNU General Public License for more details. #You should have received a copy of the GNU General Public License #along with GNU CC; see the file COPYING. If not, write to #the Free Software Foundation, 59 Temple Place - Suite 330, #Boston, MA 02111-1307, USA. # The makefile built from this file lives in the language subdirectory. # Its purpose is to provide support for: # # 1) recursion where necessary, and only then (building .o's), and # 2) building and debugging cc1 from the language subdirectory, and # 3) nothing else. # # The parent makefile handles all other chores, with help from the # language makefile fragment, of course. # # The targets for external use are: # all, TAGS, ???mostlyclean, ???clean. # Suppress smart makes who think they know how to automake Yacc files .y.c: # Variables that exist for you to override. # See below for how to change them for certain systems. ALLOCA = # Various ways of specifying flags for compilations: # CFLAGS is for the user to override to, e.g., do a bootstrap with -O2. # BOOT_CFLAGS is the value of CFLAGS to pass # to the stage2 and stage3 compilations # XCFLAGS is used for most compilations but not when using the GCC just built. XCFLAGS = CFLAGS = -g BOOT_CFLAGS = -O $(CFLAGS) # These exists to be overridden by the x-* and t-* files, respectively. X_CFLAGS = T_CFLAGS = X_CPPFLAGS = T_CPPFLAGS = CC = cc BISON = bison BISONFLAGS = SHELL = /bin/sh # Define this as & to perform parallel make on a Sequent. # Note that this has some bugs, and it seems currently necessary # to compile all the gen* files first by hand to avoid erroneous results. P = # This is used in the definition of SUBDIR_USE_ALLOCA. # ??? Perhaps it would be better if it just looked for *gcc*. OLDCC = cc # This is used instead of ALL_CFLAGS when compiling with GCC_FOR_TARGET. # It omits XCFLAGS, and specifies -B./. # It also specifies -B$(tooldir)/ to find as and ld for a cross compiler. GCC_CFLAGS=$(INTERNAL_CFLAGS) $(X_CFLAGS) $(T_CFLAGS) $(CFLAGS) # Tools to use when building a cross-compiler. # These are used because `configure' appends `cross-make' # to the makefile when making a cross-compiler. target= ... `configure' substitutes actual target name here. xmake_file= ... `configure' substitutes actual x- file name here. tmake_file= ... `configure' substitutes actual t- file name here. #version=`sed -e 's/.*\"\([^ \"]*\)[ \"].*/\1/' < $(srcdir)/version.c` #mainversion=`sed -e 's/.*\"\([0-9]*\.[0-9]*\).*/\1/' < $(srcdir)/version.c` # Directory where sources are, from where we are. srcdir = . # Additional system libraries to link with. CLIB= # Change this to a null string if obstacks are installed in the # system library. OBSTACK=obstack.o # Choose the real default target. ALL=all # End of variables for you to override. # Definition of `all' is here so that new rules inserted by sed # do not specify the default target. all: all.indirect # This tells GNU Make version 3 not to put all variables in the environment. .NOEXPORT: # sed inserts variable overrides after the following line. ####target overrides ####host overrides ####cross overrides ####build overrides # Now figure out from those variables how to compile and link. all.indirect: Makefile ../cc1objplus # IN_GCC tells obstack.h that we are using gcc's file. INTERNAL_CFLAGS = $(CROSS) -DIN_GCC -DOBJCPLUS # This is the variable actually used when we compile. ALL_CFLAGS = $(INTERNAL_CFLAGS) $(X_CFLAGS) $(T_CFLAGS) $(CFLAGS) $(XCFLAGS) # Likewise. ALL_CPPFLAGS = $(CPPFLAGS) $(X_CPPFLAGS) $(T_CPPFLAGS) # Even if ALLOCA is set, don't use it if compiling with GCC. SUBDIR_OBSTACK = `if [ x$(OBSTACK) != x ]; then echo ../$(OBSTACK); else true; fi` SUBDIR_USE_ALLOCA = `case "${CC}" in "${OLDCC}") if [ x$(ALLOCA) != x ]; then echo ../$(ALLOCA); else true; fi ;; esac` SUBDIR_MALLOC = `if [ x$(MALLOC) != x ]; then echo ../$(MALLOC); else true; fi` # How to link with both our special library facilities # and the system's installed libraries. LIBS = $(SUBDIR_OBSTACK) $(SUBDIR_USE_ALLOCA) $(SUBDIR_MALLOC) $(CLIB) # Specify the directories to be searched for header files. # Both . and srcdir are used, in that order, # so that tm.h and config.h will be found in the compilation # subdirectory rather than in the source directory. INCLUDES = -I. -I.. -I$(srcdir) -I$(srcdir)/.. -I$(srcdir)/../config # Always use -I$(srcdir)/config when compiling. .c.o: $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $< # This tells GNU make version 3 not to export all the variables # defined in this file into the environment. .NOEXPORT: # Lists of files for various purposes. # Language specific object files for Objective-C++ OBJCPLUS_OBJS = call.o decl.o errfn.o expr.o pt.o sig.o typeck2.o \ class.o decl2.o error.o gc.o lex.o parse.o ptree.o spew.o typeck.o cvt.o \ edsel.o except.o init.o method.o search.o tree.o xref.o repo.o obcp-act.o # Language-independent object files. OBJS = `cat ../stamp-objlist` ../c-common.o ../c-pragma.o OBJDEPS = ../stamp-objlist ../c-common.o ../c-pragma.o compiler: ../cc1objplus ../cc1objplus: $(P) $(OBJCPLUS_OBJS) $(OBJDEPS) $(LIBDEPS) rm -f ../cc1objplus$(exeext) $(CC) $(ALL_CFLAGS) -DOBJCPLUS $(LDFLAGS) -o $@ \ $(OBJCPLUS_OBJS) $(OBJS) $(LIBS) Makefile: $(srcdir)/Makefile.in $(srcdir)/../configure cd ..; $(SHELL) config.status native: config.status ../cc1objplus # Compiling object files from source files. # Note that dependencies on obstack.h are not written # because that file is not part of GCC. # Objective-C++ language specific files. RTL_H = $(srcdir)/../rtl.h $(srcdir)/../rtl.def \ $(srcdir)/../machmode.h $(srcdir)/../machmode.def TREE_H = $(srcdir)/../tree.h $(srcdir)/../real.h $(srcdir)/../objc-tree.def \ $(srcdir)/../machmode.h $(srcdir)/../machmode.def OBJCXX_TREE_H = $(TREE_H) cp-tree.h $(srcdir)/../cp/tree.def PARSE_H = parse.h PARSE_C = parse.c parse.o : $(PARSE_C) $(CONFIG_H) $(OBJCXX_TREE_H) $(srcdir)/../flags.h lex.h $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $(BIG_SWITCHFLAG) \ `echo $(PARSE_C) | sed 's,^\./,,'` CONFLICTS = expect 96 shift/reduce conflicts and 92 reduce/reduce conflicts. $(PARSE_H) : $(PARSE_C) $(PARSE_C) : parse.y @echo $(CONFLICTS) $(BISON) $(BISONFLAGS) -d -o parse.c parse.y grep '^#define[ ]*YYEMPTY' parse.c >>parse.h parse.y : parse.in sed `case "$(target)" in i*86-nextpdo-winnt3*) \ echo " -e /^ifwin32$$/d" ;; esac ` \ -e "`case "$(target)" in i*86-nextpdo-winnt3*) \ echo '/^end ifwin32$$/d' ;; \ *) echo '/^ifwin32$$/,/^end ifwin32$$/d' ;; esac`" \ $(srcdir)/parse.in >tmp-parse.y $(srcdir)/../move-if-change tmp-parse.y parse.y # hash.h really depends on $(srcdir)/obcp.gperf and $(OBCP_GPERF). # But this would screw things for people that don't have gperf, # if obcp.gperf got touched, say. # Thus you have to remove hash.h to force it to be re-made. hash.h: cat $(srcdir)/obcp.gperf $(OBCP_GPERF) | \ gperf -p -j1 -g -G -o -t -N is_reserved_word '-k1,4,7,$$' >hash.h spew.o : spew.c $(CONFIG_H) $(OBJCXX_TREE_H) \ $(PARSE_H) $(srcdir)/../flags.h lex.h lex.o : lex.c $(CONFIG_H) $(OBJCXX_TREE_H) \ $(PARSE_H) input.c $(srcdir)/../flags.h hash.h lex.h $(srcdir)/../c-pragma.h decl.o : decl.c $(CONFIG_H) $(OBJCXX_TREE_H) $(srcdir)/../flags.h \ lex.h decl.h $(srcdir)/../stack.h decl2.o : decl2.c $(CONFIG_H) $(OBJCXX_TREE_H) $(srcdir)/../flags.h \ lex.h decl.h typeck2.o : typeck2.c $(CONFIG_H) $(OBJCXX_TREE_H) $(srcdir)/../flags.h typeck.o : typeck.c $(CONFIG_H) $(OBJCXX_TREE_H) $(srcdir)/../flags.h $(RTL_H) class.o : class.c $(CONFIG_H) $(OBJCXX_TREE_H) $(srcdir)/../flags.h call.o : call.c $(CONFIG_H) $(OBJCXX_TREE_H) $(srcdir)/../flags.h class.h init.o : init.c $(CONFIG_H) $(OBJCXX_TREE_H) $(srcdir)/../flags.h $(RTL_H) method.o : method.c $(CONFIG_H) $(OBJCXX_TREE_H) class.h cvt.o : cvt.c $(CONFIG_H) $(OBJCXX_TREE_H) class.h search.o : search.c $(CONFIG_H) $(OBJCXX_TREE_H) $(srcdir)/../stack.h $(srcdir)/../flags.h tree.o : tree.c $(CONFIG_H) $(OBJCXX_TREE_H) $(srcdir)/../flags.h ptree.o : ptree.c $(CONFIG_H) $(OBJCXX_TREE_H) gc.o : gc.c $(CONFIG_H) $(OBJCXX_TREE_H) $(srcdir)/../flags.h except.o : except.c $(CONFIG_H) $(OBJCXX_TREE_H) $(srcdir)/../flags.h $(RTL_H) expr.o : expr.c $(CONFIG_H) $(OBJCXX_TREE_H) $(RTL_H) $(srcdir)/../flags.h \ $(srcdir)/../expr.h ../insn-codes.h edsel.o : edsel.c $(CONFIG_H) $(OBJCXX_TREE_H) $(srcdir)/../stack.h $(srcdir)/../flags.h xref.o : xref.c $(CONFIG_H) $(OBJCXX_TREE_H) $(srcdir)/../input.h pt.o : pt.c $(CONFIG_H) $(OBJCXX_TREE_H) decl.h $(PARSE_H) error.o : error.c $(CONFIG_H) $(OBJCXX_TREE_H) errfn.o : errfn.c $(CONFIG_H) $(OBJCXX_TREE_H) sig.o : sig.c $(CONFIG_H) $(OBJCXX_TREE_H) $(srcdir)/../flags.h repo.o : repo.c $(CONFIG_H) $(OBJCXX_TREE_H) # These exist for maintenance purposes. # Update the tags table. TAGS: force cd $(srcdir) ; \ etags *.c *.h ; \ echo 'l' | tr 'l' '\f' >> TAGS ; \ echo 'parse.in,0' >> TAGS ; \ etags -a ../*.h ../*.c; .PHONY: TAGS force: