1 # Top level -*- makefile -*- fragment for GNU Objective-C
2 # Copyright (C) 1997, 1998, 2000, 2001, 2002, 2003, 2004, 2005, 2007,
3 # 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
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 3, 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 COPYING3. If not see
19 # <http://www.gnu.org/licenses/>.
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, foo.install-info, foo.install-pdf,
27 # foo.install-html, foo.info, foo.dvi, foo.pdf, foo.html, foo.uninstall,
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.
43 # Tell GNU make to ignore these if they exist.
46 START_HDRS = $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) $(C_TREE_H) \
47 c-lang.h langhooks.h c-family/c-objc.h objc/objc-act.h
49 # Use maximal warnings for this front end.
50 objc-warn = $(STRICT_WARN)
52 # Language-specific object files for Objective C.
53 OBJC_OBJS = objc/objc-lang.o objc/objc-act.o \
54 objc/objc-runtime-shared-support.o \
55 objc/objc-gnu-runtime-abi-01.o \
56 objc/objc-next-runtime-abi-01.o \
57 objc/objc-next-runtime-abi-02.o \
58 objc/objc-encoding.o \
61 objc_OBJS = $(OBJC_OBJS) cc1obj-checksum.o
63 cc1obj-checksum.c : build/genchecksum$(build_exeext) checksum-options \
64 $(OBJC_OBJS) $(C_AND_OBJC_OBJS) $(BACKEND) $(LIBDEPS)
65 build/genchecksum$(build_exeext) $(OBJC_OBJS) $(C_AND_OBJC_OBJS) \
66 $(BACKEND) $(LIBDEPS) checksum-options > cc1obj-checksum.c.tmp && \
67 $(srcdir)/../move-if-change cc1obj-checksum.c.tmp cc1obj-checksum.c
69 cc1obj-checksum.o : cc1obj-checksum.c $(CONFIG_H) $(SYSTEM_H)
71 cc1obj$(exeext): $(OBJC_OBJS) $(C_AND_OBJC_OBJS) cc1obj-checksum.o $(BACKEND) $(LIBDEPS)
72 +$(LINKER) $(ALL_LINKERFLAGS) $(LDFLAGS) -o $@ \
73 $(OBJC_OBJS) $(C_AND_OBJC_OBJS) cc1obj-checksum.o \
74 $(BACKEND) $(LIBS) $(BACKENDLIBS)
76 # Objective C language specific files.
78 # When editing, please keep the objc/ header dependencies in
79 # alphabetical order, and try to use a similar logical order for the
80 # other files between the different targets.
82 objc/objc-lang.o : objc/objc-lang.c \
85 $(LANGHOOKS_DEF_H) $(C_COMMON_H) gtype-objc.h \
88 objc/objc-runtime-shared-support.o : objc/objc-runtime-shared-support.c \
89 gt-objc-objc-runtime-shared-support.h \
91 $(GGC_H) $(DIAGNOSTIC_CORE_H) $(FLAGS_H) input.h \
92 objc/objc-encoding.h \
93 objc/objc-next-metadata-tags.h \
94 objc/objc-runtime-shared-support.h
96 objc/objc-gnu-runtime-abi-01.o: objc/objc-gnu-runtime-abi-01.c \
97 gt-objc-objc-gnu-runtime-abi-01.h \
99 $(GGC_H) $(DIAGNOSTIC_CORE_H) $(FLAGS_H) input.h \
101 objc/objc-encoding.h \
102 objc/objc-runtime-hooks.h \
103 objc/objc-runtime-shared-support.h
105 objc/objc-next-runtime-abi-01.o: objc/objc-next-runtime-abi-01.c \
106 gt-objc-objc-next-runtime-abi-01.h \
108 $(GGC_H) $(DIAGNOSTIC_CORE_H) $(FLAGS_H) input.h \
109 $(TARGET_H) output.h \
110 objc/objc-encoding.h \
111 objc/objc-next-metadata-tags.h \
112 objc/objc-runtime-hooks.h \
113 objc/objc-runtime-shared-support.h
115 objc/objc-next-runtime-abi-02.o: objc/objc-next-runtime-abi-02.c \
116 gt-objc-objc-next-runtime-abi-02.h \
118 $(GGC_H) $(DIAGNOSTIC_CORE_H) $(FLAGS_H) input.h \
120 objc/objc-encoding.h \
121 objc/objc-next-metadata-tags.h \
122 objc/objc-runtime-hooks.h \
123 objc/objc-runtime-shared-support.h
125 objc/objc-act.o : objc/objc-act.c \
128 $(GGC_H) $(DIAGNOSTIC_CORE_H) $(FLAGS_H) input.h \
129 toplev.h $(FUNCTION_H) output.h debug.h $(LANGHOOKS_DEF_H) \
130 $(HASHTAB_H) $(GIMPLE_H) \
131 $(C_PRAGMA_H) $(C_TARGET_H) \
132 objc/objc-encoding.h \
134 objc/objc-runtime-hooks.h \
135 objc/objc-runtime-shared-support.h
137 objc/objc-encoding.o : objc/objc-encoding.c \
139 $(GGC_H) $(DIAGNOSTIC_CORE_H) $(FLAGS_H) input.h \
141 objc/objc-encoding.h \
142 objc/objc-runtime-shared-support.h
144 objc/objc-map.o : objc/objc-map.c \
146 $(GGC_H) $(DIAGNOSTIC_CORE_H) $(FLAGS_H) input.h \
171 cd $(srcdir)/objc; etags -o TAGS.sub *.c *.h; \
172 etags --include TAGS.sub --include ../TAGS.sub
174 lang_checks += check-objc
176 # The following allows you to do 'make check-objc -j2'. The
177 # execute.exp tests will be run in parallel with all the other ones.
178 lang_checks_parallelized += check-objc
179 check_objc_parallelize = gnu-encoding.exp execute.exp exceptions.exp
183 # cc1obj is installed elsewhere as part of $(COMPILERS).
192 # A lot of the ancillary files are deleted by the main makefile.
193 # We just have to delete files specific to us.
195 -rm -f objc/*$(objext) objc/xforward objc/fflags
196 -rm -f objc/*$(coverageexts)
197 objc.clean: objc.mostlyclean
200 -rm -f objc/Makefile objc/Make-host objc/Make-target
201 -rm -f objc/config.status objc/config.cache
202 objc.maintainer-clean:
207 objc.stage1: stage1-start
208 -mv objc/*$(objext) stage1/objc
209 objc.stage2: stage2-start
210 -mv objc/*$(objext) stage2/objc
211 objc.stage3: stage3-start
212 -mv objc/*$(objext) stage3/objc
213 objc.stage4: stage4-start
214 -mv objc/*$(objext) stage4/objc
215 objc.stageprofile: stageprofile-start
216 -mv objc/*$(objext) stageprofile/objc
217 objc.stagefeedback: stagefeedback-start
218 -mv objc/*$(objext) stagefeedback/objc