1*e4b17023SJohn Marino# Top level -*- makefile -*- fragment for GNU Objective-C++ 2*e4b17023SJohn Marino# Copyright (C) 2005, 2007, 2008, 2009, 2010, 2011 3*e4b17023SJohn Marino# Free Software Foundation, Inc. 4*e4b17023SJohn Marino# Contributed by Ziemowit Laski <zlaski@apple.com> 5*e4b17023SJohn Marino 6*e4b17023SJohn Marino#This file is part of GCC. 7*e4b17023SJohn Marino 8*e4b17023SJohn Marino#GCC is free software; you can redistribute it and/or modify 9*e4b17023SJohn Marino#it under the terms of the GNU General Public License as published by 10*e4b17023SJohn Marino#the Free Software Foundation; either version 3, or (at your option) 11*e4b17023SJohn Marino#any later version. 12*e4b17023SJohn Marino 13*e4b17023SJohn Marino#GCC is distributed in the hope that it will be useful, 14*e4b17023SJohn Marino#but WITHOUT ANY WARRANTY; without even the implied warranty of 15*e4b17023SJohn Marino#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16*e4b17023SJohn Marino#GNU General Public License for more details. 17*e4b17023SJohn Marino 18*e4b17023SJohn Marino#You should have received a copy of the GNU General Public License 19*e4b17023SJohn Marino#along with GCC; see the file COPYING3. If not see 20*e4b17023SJohn Marino#<http://www.gnu.org/licenses/>. 21*e4b17023SJohn Marino 22*e4b17023SJohn Marino 23*e4b17023SJohn Marino# This file provides the language dependent support in the main Makefile. 24*e4b17023SJohn Marino# Each language makefile fragment must provide the following targets: 25*e4b17023SJohn Marino# 26*e4b17023SJohn Marino# foo.all.cross, foo.start.encap, foo.rest.encap, 27*e4b17023SJohn Marino# foo.install-common, foo.install-man, foo.install-info, foo.install-pdf, 28*e4b17023SJohn Marino# foo.install-html, foo.info, foo.dvi, foo.pdf, foo.html, foo.uninstall, 29*e4b17023SJohn Marino# foo.mostlyclean, foo.clean, foo.distclean, 30*e4b17023SJohn Marino# foo.maintainer-clean, foo.stage1, foo.stage2, foo.stage3, foo.stage4 31*e4b17023SJohn Marino# 32*e4b17023SJohn Marino# where `foo' is the name of the language. 33*e4b17023SJohn Marino# 34*e4b17023SJohn Marino# It should also provide rules for: 35*e4b17023SJohn Marino# 36*e4b17023SJohn Marino# - making any compiler driver (eg: g++) 37*e4b17023SJohn Marino# - the compiler proper (eg: cc1plus) 38*e4b17023SJohn Marino# - define the names for selecting the language in LANGUAGES. 39*e4b17023SJohn Marino 40*e4b17023SJohn Marino# 41*e4b17023SJohn Marino# Define the names for selecting Objective-C++ in LANGUAGES. 42*e4b17023SJohn Marinoobj-c++: cc1objplus$(exeext) 43*e4b17023SJohn Marino 44*e4b17023SJohn Marino# Tell GNU make to ignore these if they exist. 45*e4b17023SJohn Marino.PHONY: obj-c++ 46*e4b17023SJohn Marino 47*e4b17023SJohn MarinoSTART_HDRS = $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) $(CXX_TREE_H) \ 48*e4b17023SJohn Marino $(CXX_PARSER_H) $(CXX_PRETTY_PRINT_H) langhooks.h c-family/c-objc.h objc/objc-act.h 49*e4b17023SJohn Marino 50*e4b17023SJohn Marino# Use maximal warnings for this front end. Also, make ObjC and C++ 51*e4b17023SJohn Marino# headers accessible. 52*e4b17023SJohn Marinoobjcp-warn = $(STRICT_WARN) -DOBJCPLUS -I$(srcdir)/objc -I$(srcdir)/cp 53*e4b17023SJohn Marino 54*e4b17023SJohn Marino# Language-specific object files for Objective C++. 55*e4b17023SJohn MarinoOBJCXX_OBJS = objcp/objcp-act.o objcp/objcp-lang.o objcp/objcp-decl.o \ 56*e4b17023SJohn Marino objcp/objc-runtime-shared-support.o \ 57*e4b17023SJohn Marino objcp/objc-gnu-runtime-abi-01.o \ 58*e4b17023SJohn Marino objcp/objc-next-runtime-abi-01.o \ 59*e4b17023SJohn Marino objcp/objc-next-runtime-abi-02.o \ 60*e4b17023SJohn Marino objcp/objc-encoding.o \ 61*e4b17023SJohn Marino objcp/objc-map.o \ 62*e4b17023SJohn Marino $(CXX_AND_OBJCXX_OBJS) 63*e4b17023SJohn Marino 64*e4b17023SJohn Marinoobj-c++_OBJS = $(OBJCXX_OBJS) cc1objplus-checksum.o 65*e4b17023SJohn Marino 66*e4b17023SJohn Marinocc1objplus-checksum.c : build/genchecksum$(build_exeext) checksum-options \ 67*e4b17023SJohn Marino $(OBJCXX_OBJS) $(BACKEND) $(LIBDEPS) 68*e4b17023SJohn Marino build/genchecksum$(build_exeext) $(OBJCXX_OBJS) $(BACKEND) \ 69*e4b17023SJohn Marino $(LIBDEPS) checksum-options > cc1objplus-checksum.c.tmp && \ 70*e4b17023SJohn Marino $(srcdir)/../move-if-change cc1objplus-checksum.c.tmp \ 71*e4b17023SJohn Marino cc1objplus-checksum.c 72*e4b17023SJohn Marino 73*e4b17023SJohn Marinocc1objplus-checksum.o : cc1objplus-checksum.c $(CONFIG_H) $(SYSTEM_H) 74*e4b17023SJohn Marino 75*e4b17023SJohn Marinocc1objplus$(exeext): $(OBJCXX_OBJS) cc1objplus-checksum.o $(BACKEND) $(LIBDEPS) 76*e4b17023SJohn Marino +$(LINKER) $(ALL_LINKERFLAGS) $(LDFLAGS) -o $@ \ 77*e4b17023SJohn Marino $(OBJCXX_OBJS) cc1objplus-checksum.o $(BACKEND) $(LIBS) $(BACKENDLIBS) 78*e4b17023SJohn Marino 79*e4b17023SJohn Marino# Objective C++ language specific files. 80*e4b17023SJohn Marino 81*e4b17023SJohn Marinoobjcp/objcp-lang.o : objcp/objcp-lang.c \ 82*e4b17023SJohn Marino $(START_HDRS) \ 83*e4b17023SJohn Marino $(GGC_H) \ 84*e4b17023SJohn Marino $(C_COMMON_H) $(LANGHOOKS_DEF_H) cp/cp-objcp-common.h \ 85*e4b17023SJohn Marino $(TARGET_H) gtype-objcp.h 86*e4b17023SJohn Marino 87*e4b17023SJohn Marinoobjcp/objcp-decl.o : objcp/objcp-decl.c \ 88*e4b17023SJohn Marino $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) $(CXX_TREE_H) \ 89*e4b17023SJohn Marino objc/objc-act.h c-family/c-objc.h \ 90*e4b17023SJohn Marino objcp/objcp-decl.h 91*e4b17023SJohn Marino 92*e4b17023SJohn Marinoobjcp/objc-runtime-shared-support.o : objc/objc-runtime-shared-support.c \ 93*e4b17023SJohn Marino gt-objc-objc-runtime-shared-support.h \ 94*e4b17023SJohn Marino $(START_HDRS) \ 95*e4b17023SJohn Marino $(GGC_H) $(DIAGNOSTIC_CORE_H) $(FLAGS_H) input.h \ 96*e4b17023SJohn Marino objc/objc-encoding.h \ 97*e4b17023SJohn Marino objc/objc-next-metadata-tags.h \ 98*e4b17023SJohn Marino objc/objc-runtime-shared-support.h \ 99*e4b17023SJohn Marino objcp/objcp-decl.h 100*e4b17023SJohn Marino $(COMPILER) -c $(ALL_COMPILERFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $< \ 101*e4b17023SJohn Marino $(OUTPUT_OPTION) 102*e4b17023SJohn Marino 103*e4b17023SJohn Marinoobjcp/objc-gnu-runtime-abi-01.o: objc/objc-gnu-runtime-abi-01.c \ 104*e4b17023SJohn Marino gt-objc-objc-gnu-runtime-abi-01.h \ 105*e4b17023SJohn Marino $(START_HDRS) \ 106*e4b17023SJohn Marino $(GGC_H) $(DIAGNOSTIC_CORE_H) $(FLAGS_H) input.h \ 107*e4b17023SJohn Marino toplev.h \ 108*e4b17023SJohn Marino objc/objc-encoding.h \ 109*e4b17023SJohn Marino objc/objc-runtime-hooks.h \ 110*e4b17023SJohn Marino objc/objc-runtime-shared-support.h \ 111*e4b17023SJohn Marino objcp/objcp-decl.h 112*e4b17023SJohn Marino $(COMPILER) -c $(ALL_COMPILERFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $< \ 113*e4b17023SJohn Marino $(OUTPUT_OPTION) 114*e4b17023SJohn Marino 115*e4b17023SJohn Marinoobjcp/objc-next-runtime-abi-01.o: objc/objc-next-runtime-abi-01.c \ 116*e4b17023SJohn Marino gt-objc-objc-next-runtime-abi-01.h \ 117*e4b17023SJohn Marino $(START_HDRS) \ 118*e4b17023SJohn Marino $(GGC_H) $(DIAGNOSTIC_CORE_H) $(FLAGS_H) input.h \ 119*e4b17023SJohn Marino $(TARGET_H) output.h \ 120*e4b17023SJohn Marino objc/objc-encoding.h \ 121*e4b17023SJohn Marino objc/objc-next-metadata-tags.h \ 122*e4b17023SJohn Marino objc/objc-runtime-hooks.h \ 123*e4b17023SJohn Marino objc/objc-runtime-shared-support.h \ 124*e4b17023SJohn Marino objcp/objcp-decl.h 125*e4b17023SJohn Marino $(COMPILER) -c $(ALL_COMPILERFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $< \ 126*e4b17023SJohn Marino $(OUTPUT_OPTION) 127*e4b17023SJohn Marino 128*e4b17023SJohn Marinoobjcp/objc-next-runtime-abi-02.o: objc/objc-next-runtime-abi-02.c \ 129*e4b17023SJohn Marino gt-objc-objc-next-runtime-abi-02.h \ 130*e4b17023SJohn Marino $(START_HDRS) \ 131*e4b17023SJohn Marino $(GGC_H) $(DIAGNOSTIC_CORE_H) $(FLAGS_H) input.h \ 132*e4b17023SJohn Marino $(TARGET_H) \ 133*e4b17023SJohn Marino objc/objc-encoding.h \ 134*e4b17023SJohn Marino objc/objc-next-metadata-tags.h \ 135*e4b17023SJohn Marino objc/objc-runtime-hooks.h \ 136*e4b17023SJohn Marino objc/objc-runtime-shared-support.h \ 137*e4b17023SJohn Marino objcp/objcp-decl.h 138*e4b17023SJohn Marino $(COMPILER) -c $(ALL_COMPILERFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $< \ 139*e4b17023SJohn Marino $(OUTPUT_OPTION) 140*e4b17023SJohn Marino 141*e4b17023SJohn Marino 142*e4b17023SJohn Marino# The following must be an explicit rule; please keep in sync with the implicit 143*e4b17023SJohn Marino# one in Makefile.in. 144*e4b17023SJohn Marinoobjcp/objcp-act.o : objc/objc-act.c \ 145*e4b17023SJohn Marino gt-objc-objc-act.h \ 146*e4b17023SJohn Marino $(START_HDRS) \ 147*e4b17023SJohn Marino $(GGC_H) $(DIAGNOSTIC_H) $(FLAGS_H) input.h \ 148*e4b17023SJohn Marino toplev.h $(FUNCTION_H) output.h debug.h $(LANGHOOKS_DEF_H) \ 149*e4b17023SJohn Marino $(HASHTAB_H) $(GIMPLE_H) \ 150*e4b17023SJohn Marino $(RTL_H) $(EXPR_H) $(TARGET_H) \ 151*e4b17023SJohn Marino objcp/objcp-decl.h \ 152*e4b17023SJohn Marino objc/objc-encoding.h \ 153*e4b17023SJohn Marino objc/objc-map.h \ 154*e4b17023SJohn Marino objc/objc-runtime-hooks.h \ 155*e4b17023SJohn Marino objc/objc-runtime-shared-support.h \ 156*e4b17023SJohn Marino objcp/objcp-decl.h 157*e4b17023SJohn Marino $(COMPILER) -c $(ALL_COMPILERFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $< \ 158*e4b17023SJohn Marino $(OUTPUT_OPTION) 159*e4b17023SJohn Marino 160*e4b17023SJohn Marinoobjcp/objc-encoding.o : objc/objc-encoding.c \ 161*e4b17023SJohn Marino $(START_HDRS) \ 162*e4b17023SJohn Marino $(GGC_H) $(DIAGNOSTIC_CORE_H) $(FLAGS_H) input.h \ 163*e4b17023SJohn Marino $(OBSTACK_H) \ 164*e4b17023SJohn Marino objc/objc-encoding.h \ 165*e4b17023SJohn Marino objc/objc-runtime-shared-support.h \ 166*e4b17023SJohn Marino objcp/objcp-decl.h 167*e4b17023SJohn Marino $(COMPILER) -c $(ALL_COMPILERFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $< \ 168*e4b17023SJohn Marino $(OUTPUT_OPTION) 169*e4b17023SJohn Marino 170*e4b17023SJohn Marinoobjcp/objc-map.o : objc/objc-map.c \ 171*e4b17023SJohn Marino $(START_HDRS) \ 172*e4b17023SJohn Marino $(GGC_H) $(DIAGNOSTIC_CORE_H) $(FLAGS_H) input.h \ 173*e4b17023SJohn Marino $(OBSTACK_H) \ 174*e4b17023SJohn Marino objc/objc-map.h 175*e4b17023SJohn Marino $(COMPILER) -c $(ALL_COMPILERFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $< \ 176*e4b17023SJohn Marino $(OUTPUT_OPTION) 177*e4b17023SJohn Marino 178*e4b17023SJohn Marinopo-generated: 179*e4b17023SJohn Marino 180*e4b17023SJohn Marino# 181*e4b17023SJohn Marino# Build hooks: 182*e4b17023SJohn Marino 183*e4b17023SJohn Marinoobj-c++.all.cross: 184*e4b17023SJohn Marinoobj-c++.start.encap: 185*e4b17023SJohn Marinoobj-c++.rest.encap: 186*e4b17023SJohn Marinoobj-c++.info: 187*e4b17023SJohn Marinoobj-c++.install-info: 188*e4b17023SJohn Marinoobj-c++.dvi: 189*e4b17023SJohn Marinoobj-c++.pdf: 190*e4b17023SJohn Marinoobj-c++.install-pdf: 191*e4b17023SJohn Marinoobj-c++.html: 192*e4b17023SJohn Marinoobj-c++.install-html: 193*e4b17023SJohn Marinoobj-c++.srcinfo: 194*e4b17023SJohn Marinoobj-c++.srcextra: 195*e4b17023SJohn Marinoobj-c++.man: 196*e4b17023SJohn Marinoobj-c++.install-plugin: 197*e4b17023SJohn Marino 198*e4b17023SJohn Marinoobj-c++.tags: force 199*e4b17023SJohn Marino cd $(srcdir)/objcp; etags -o TAGS.sub *.c *.h; \ 200*e4b17023SJohn Marino etags --include TAGS.sub --include ../TAGS.sub 201*e4b17023SJohn Marino 202*e4b17023SJohn Marinolang_checks += check-obj-c++ 203*e4b17023SJohn Marino 204*e4b17023SJohn Marino# 205*e4b17023SJohn Marino# Install hooks: 206*e4b17023SJohn Marino# cc1objplus is installed elsewhere as part of $(COMPILERS). 207*e4b17023SJohn Marino 208*e4b17023SJohn Marinoobj-c++.install-common: 209*e4b17023SJohn Marino 210*e4b17023SJohn Marinoobj-c++.install-man: 211*e4b17023SJohn Marino 212*e4b17023SJohn Marinoobj-c++.uninstall: 213*e4b17023SJohn Marino# 214*e4b17023SJohn Marino# Clean hooks: 215*e4b17023SJohn Marino# A lot of the ancillary files are deleted by the main makefile. 216*e4b17023SJohn Marino# We just have to delete files specific to us. 217*e4b17023SJohn Marinoobj-c++.mostlyclean: 218*e4b17023SJohn Marino -rm -f objcp/*$(objext) 219*e4b17023SJohn Marino -rm -f objcp/*$(coverageexts) 220*e4b17023SJohn Marinoobj-c++.clean: obj-c++.mostlyclean 221*e4b17023SJohn Marinoobj-c++.distclean: 222*e4b17023SJohn Marino -rm -f objcp/config.status objcp/Makefile 223*e4b17023SJohn Marinoobj-c++.maintainer-clean: 224*e4b17023SJohn Marino 225*e4b17023SJohn Marino# 226*e4b17023SJohn Marino# Stage hooks: 227*e4b17023SJohn Marino 228*e4b17023SJohn Marinoobj-c++.stage1: stage1-start 229*e4b17023SJohn Marino -mv objcp/*$(objext) stage1/objcp 230*e4b17023SJohn Marinoobj-c++.stage2: stage2-start 231*e4b17023SJohn Marino -mv objcp/*$(objext) stage2/objcp 232*e4b17023SJohn Marinoobj-c++.stage3: stage3-start 233*e4b17023SJohn Marino -mv objcp/*$(objext) stage3/objcp 234*e4b17023SJohn Marinoobj-c++.stage4: stage4-start 235*e4b17023SJohn Marino -mv objcp/*$(objext) stage4/objcp 236*e4b17023SJohn Marinoobj-c++.stageprofile: stageprofile-start 237*e4b17023SJohn Marino -mv objcp/*$(objext) stageprofile/objcp 238*e4b17023SJohn Marinoobj-c++.stagefeedback: stagefeedback-start 239*e4b17023SJohn Marino -mv objcp/*$(objext) stagefeedback/objcp 240