OSDN Git Service

Merge basic-improvements-branch to trunk
[pf3gnuchains/gcc-fork.git] / gcc / objc / Make-lang.in
1 # Top level -*- makefile -*- fragment for GNU Objective-C
2 #   Copyright (C) 1997, 1998, 2000, 2001 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 # This file provides the language dependent support in the main Makefile.
22 # Each language makefile fragment must provide the following targets:
23 #
24 # foo.all.build, foo.all.cross, foo.start.encap, foo.rest.encap,
25 # foo.info, foo.dvi,
26 # foo.install-normal, foo.install-common, foo.install-info, foo.install-man,
27 # foo.uninstall,
28 # foo.mostlyclean, foo.clean, foo.distclean, foo.extraclean,
29 # foo.maintainer-clean, foo.stage1, foo.stage2, foo.stage3, foo.stage4
30 #
31 # where `foo' is the name of the language.
32 #
33 # It should also provide rules for:
34 #
35 # - making any compiler driver (eg: g++)
36 # - the compiler proper (eg: cc1plus)
37 # - define the names for selecting the language in LANGUAGES.
38
39 #\f
40 # Define the names for selecting Objective-C in LANGUAGES.
41 OBJC objc: cc1obj$(exeext)
42 OBJECTIVE-C objective-c: cc1obj$(exeext)
43
44 # Tell GNU make to ignore these if they exist.
45 .PHONY: objective-c objc ObjC
46
47 # Use maximal warnings for this front end.
48 objc-warn = $(STRICT_WARN)
49
50 # Language-specific object files for Objective C.
51 OBJC_OBJS = objc/objc-lang.o objc/objc-parse.o objc/objc-act.o
52
53 cc1obj$(exeext): $(OBJC_OBJS) $(C_AND_OBJC_OBJS) $(BACKEND) $(LIBDEPS)
54         $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ \
55                 $(OBJC_OBJS) $(C_AND_OBJC_OBJS) $(BACKEND) $(LIBS)
56
57 # Objective C language specific files.
58
59 objc/objc-lang.o : objc/objc-lang.c \
60    $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) c-tree.h \
61    c-common.h toplev.h objc/objc-act.h langhooks.h $(LANGHOOKS_DEF_H)
62
63 objc/objc-parse.o : objc/objc-parse.c \
64    $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) $(C_TREE_H) \
65    toplev.h $(GGC_H) c-pragma.h input.h flags.h output.h objc/objc-act.h
66
67 objc/objc-act.o : objc/objc-act.c \
68    $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) $(RTL_H) $(EXPR_H) \
69    $(TARGET_H) $(C_TREE_H) diagnostic.h toplev.h flags.h objc/objc-act.h \
70    input.h function.h output.h debug.h langhooks.h $(LANGHOOKS_DEF_H) \
71    gtype-objc.h
72
73 po-generated: $(srcdir)/objc/objc-parse.c
74 $(srcdir)/objc/objc-parse.c : $(srcdir)/objc/objc-parse.y
75         cd $(srcdir)/objc; \
76         if $(BISON) $(BISONFLAGS) -o op$$$$.c objc-parse.y ; then \
77           test -f op$$$$.output && mv -f op$$$$.output objc-parse.output ; \
78           mv -f op$$$$.c objc-parse.c ; \
79         else \
80           rm -f op$$$$.* ; \
81           false ; \
82         fi
83
84 $(srcdir)/objc/objc-parse.y: $(srcdir)/c-parse.in
85         echo '/*WARNING: This file is automatically generated!*/' >tmp-objc-prs.y
86         sed -e "/^ifc$$/,/^end ifc$$/d" \
87           -e "/^ifobjc$$/d" -e "/^end ifobjc$$/d" \
88           $(srcdir)/c-parse.in >>tmp-objc-prs.y
89         $(SHELL) $(srcdir)/move-if-change tmp-objc-prs.y $(srcdir)/objc/objc-parse.y
90
91 gtype-objc.h : s-gtype ; @true
92
93 #\f
94 # Build hooks:
95
96 objc.all.build:
97 objc.all.cross:
98 objc.start.encap:
99 objc.rest.encap:
100
101 objc.info:
102 objc.dvi:
103 objc.generated-manpages:
104
105 #\f
106 # Install hooks:
107 # cc1obj is installed elsewhere as part of $(COMPILERS).
108
109 objc.install-normal:
110
111 objc.install-common:
112
113 objc.install-info:
114
115 objc.install-man:
116
117 objc.uninstall:
118 #\f
119 # Clean hooks:
120 # A lot of the ancillary files are deleted by the main makefile.
121 # We just have to delete files specific to us.
122 objc.mostlyclean:
123         -rm -f tmp-objc-prs.y
124         -rm -f objc/*$(objext) objc/xforward objc/fflags
125         -rm -f objc/*$(coverageexts)
126 objc.clean: objc.mostlyclean
127         -rm -rf objc-headers
128 objc.distclean:
129         -rm -f objc/Makefile objc/Make-host objc/Make-target
130         -rm -f objc/config.status objc/config.cache
131         -rm -f objc-parse.output
132 objc.extraclean:
133 objc.maintainer-clean:
134         -rm -f $(srcdir)/objc/objc-parse.y
135         -rm -f $(srcdir)/objc/objc-parse.c $(srcdir)/objc/objc-parse.output
136
137 #\f
138 # Stage hooks:
139
140 objc.stage1: stage1-start
141         -mv objc/*$(objext) stage1/objc
142         -mv cc1obj$(exeext) stage1
143 objc.stage2: stage2-start
144         -mv objc/*$(objext) stage2/objc
145         -mv cc1obj$(exeext) stage2
146 objc.stage3: stage3-start
147         -mv objc/*$(objext) stage3/objc
148         -mv cc1obj$(exeext) stage3
149 objc.stage4: stage4-start
150         -mv objc/*$(objext) stage4/objc
151         -mv cc1obj$(exeext) stage4