1 # Top level -*- makefile -*- fragment for GNU Objective-C++
2 # Copyright (C) 2005 Free Software Foundation, Inc.
3 # Contributed by Ziemowit Laski <zlaski@apple.com>
5 #This file is part of GCC.
7 #GCC is free software; you can redistribute it and/or modify
8 #it under the terms of the GNU General Public License as published by
9 #the Free Software Foundation; either version 2, or (at your option)
12 #GCC is distributed in the hope that it will be useful,
13 #but WITHOUT ANY WARRANTY; without even the implied warranty of
14 #MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 #GNU General Public License for more details.
17 #You should have received a copy of the GNU General Public License
18 #along with GCC; see the file COPYING. If not, write to
19 #the Free Software Foundation, 51 Franklin Street, Fifth Floor,
20 #Boston, MA 02110-1301, USA.
22 # This file provides the language dependent support in the main Makefile.
23 # Each language makefile fragment must provide the following targets:
25 # foo.all.cross, foo.start.encap, foo.rest.encap,
26 # foo.install-common, foo.install-man,
28 # foo.mostlyclean, foo.clean, foo.distclean,
29 # foo.maintainer-clean, foo.stage1, foo.stage2, foo.stage3, foo.stage4
31 # where `foo' is the name of the language.
33 # It should also provide rules for:
35 # - making any compiler driver (eg: g++)
36 # - the compiler proper (eg: cc1plus)
37 # - define the names for selecting the language in LANGUAGES.
40 # Define the names for selecting Objective-C++ in LANGUAGES.
41 OBJ-C++ obj-c++: cc1objplus$(exeext)
43 # Tell GNU make to ignore these if they exist.
44 .PHONY: Obj-c++ obj-C++
46 # Use maximal warnings for this front end. Also, make ObjC and C++
48 objcp-warn = $(STRICT_WARN) -DOBJCPLUS -I$(srcdir)/objc -I$(srcdir)/cp
50 # Language-specific object files for Objective C++.
51 OBJCXX_OBJS = objcp/objcp-act.o objcp/objcp-lang.o objcp/objcp-decl.o \
52 $(CXX_AND_OBJCXX_OBJS)
54 cc1objplus-dummy$(exeext): $(OBJCXX_OBJS) dummy-checksum.o $(BACKEND) \
56 $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ \
57 $(OBJCXX_OBJS) dummy-checksum.o $(BACKEND) $(LIBS)
59 cc1objplus-checksum.c : cc1objplus-dummy$(exeext) build/genchecksum$(build_exeext)
60 build/genchecksum$(build_exeext) cc1objplus-dummy$(exeext) > $@
62 cc1objplus-checksum.o : cc1objplus-checksum.c
64 cc1objplus$(exeext): $(OBJCXX_OBJS) cc1objplus-checksum.o $(BACKEND) $(LIBDEPS)
65 $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ \
66 $(OBJCXX_OBJS) cc1objplus-checksum.o $(BACKEND) $(LIBS)
68 # Objective C++ language specific files.
70 objcp/objcp-lang.o : objcp/objcp-lang.c \
71 $(CXX_TREE_H) $(TM_H) toplev.h debug.h langhooks.h objc/objc-act.h \
72 $(LANGHOOKS_DEF_H) c-common.h gtype-objcp.h \
73 $(DIAGNOSTIC_H) cp/cp-objcp-common.h tree-gimple.h
75 objcp/objcp-decl.o : objcp/objcp-decl.c \
76 $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) $(C_TREE_H) \
77 toplev.h $(GGC_H) c-pragma.h input.h flags.h output.h objc/objc-act.h \
78 objcp/objcp-decl.h tree-gimple.h $(EXPR_H)
80 # The following must be an explicit rule; please keep in sync with the implicit
82 objcp/objcp-act.o : objc/objc-act.c \
83 $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) $(RTL_H) $(TM_P_H) \
84 $(EXPR_H) $(TARGET_H) $(CXX_TREE_H) diagnostic.h toplev.h flags.h \
85 objc/objc-act.h input.h function.h output.h debug.h langhooks.h \
86 objcp/objcp-decl.h $(LANGHOOKS_DEF_H) $(HASHTAB_H) gt-objc-objc-act.h \
88 $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $< $(OUTPUT_OPTION)
104 cd $(srcdir)/objcp; etags -o TAGS.sub *.y *.c *.h; \
105 etags --include TAGS.sub --include ../TAGS.sub
107 lang_checks += check-obj-c++
111 # cc1objplus is installed elsewhere as part of $(COMPILERS).
113 obj-c++.install-common:
120 # A lot of the ancillary files are deleted by the main makefile.
121 # We just have to delete files specific to us.
123 -rm -f objcp/*$(objext)
124 -rm -f objcp/*$(coverageexts)
125 obj-c++.clean: obj-c++.mostlyclean
127 -rm -f objcp/config.status objcp/Makefile
128 obj-c++.maintainer-clean:
133 obj-c++.stage1: stage1-start
134 -mv objcp/*$(objext) stage1/objcp
135 obj-c++.stage2: stage2-start
136 -mv objcp/*$(objext) stage2/objcp
137 obj-c++.stage3: stage3-start
138 -mv objcp/*$(objext) stage3/objcp
139 obj-c++.stage4: stage4-start
140 -mv objcp/*$(objext) stage4/objcp
141 obj-c++.stageprofile: stageprofile-start
142 -mv objcp/*$(objext) stageprofile/objcp
143 obj-c++.stagefeedback: stagefeedback-start
144 -mv objcp/*$(objext) stagefeedback/objcp