OSDN Git Service

* objc/Make-lang.in (objc-parse.c): Put BISON parameters in correct
[pf3gnuchains/gcc-fork.git] / gcc / objc / Make-lang.in
1 # Top level makefile fragment for GNU Objective-C
2 #   Copyright (C) 1997, 1998 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, foo.distdir,
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 #\f
39 # Extra flags to pass to recursive makes.
40 OBJC_FLAGS_TO_PASS = \
41         "OBJC_FOR_BUILD=$(OBJC_FOR_BUILD)" \
42         "OBJCFLAGS=$(OBJCFLAGS)" \
43         "OBJC_FOR_TARGET=$(OBJC_FOR_TARGET)" \
44
45 # Actual names to use when installing a native compiler.
46 #OBJC_INSTALL_NAME = `t='$(program_transform_name)'; echo c++ | sed $$t`
47
48 # Actual names to use when installing a cross-compiler.
49 #OBJC_CROSS_NAME = `t='$(program_transform_cross_name)'; echo c++ | sed $$t`
50
51 #\f
52 # Define the names for selecting Objective-C in LANGUAGES.
53 OBJC objc: cc1obj$(exeext)
54 OBJECTIVE-C objective-c: cc1obj$(exeext)
55
56 # Tell GNU make to ignore these if they exist.
57 .PHONY: objective-c objc ObjC
58
59 # Language-specific object files for Objective C.
60 OBJC_OBJS = objc-parse.o objc-act.o $(C_AND_OBJC_OBJS)
61
62 cc1obj$(exeext): $(P) $(OBJS) $(OBJC_OBJS) $(LIBDEPS)
63         $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ $(OBJS) $(OBJC_OBJS) $(LIBS)
64
65 # Objective C language specific files.
66
67 objc-parse.o : $(srcdir)/objc/objc-parse.c \
68    $(CONFIG_H) $(TREE_H) $(srcdir)/toplev.h \
69    $(srcdir)/c-lex.h $(srcdir)/c-tree.h $(srcdir)/input.h \
70    $(srcdir)/flags.h $(srcdir)/output.h $(srcdir)/objc/objc-act.h system.h
71         $(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) -I$(srcdir)/objc \
72         -c $(srcdir)/objc/objc-parse.c
73
74 $(INTL_TARGETS): $(srcdir)/objc/objc-parse.c
75 $(srcdir)/objc/objc-parse.c : $(srcdir)/objc/objc-parse.y
76         cd $(srcdir)/objc; \
77         $(BISON) $(BISONFLAGS) -o objc-parse.c objc-parse.y
78
79 $(srcdir)/objc/objc-parse.y: $(srcdir)/c-parse.in
80         echo '/*WARNING: This file is automatically generated!*/' >tmp-objc-prs.y
81         sed -e "/^ifc$$/,/^end ifc$$/d" \
82           -e "/^ifobjc$$/d" -e "/^end ifobjc$$/d" \
83           $(srcdir)/c-parse.in >>tmp-objc-prs.y
84         $(srcdir)/move-if-change tmp-objc-prs.y $(srcdir)/objc/objc-parse.y
85
86 objc-act.o : $(srcdir)/objc/objc-act.c \
87    $(CONFIG_H) $(TREE_H) $(RTL_H) system.h \
88    $(srcdir)/c-tree.h $(srcdir)/c-lex.h $(srcdir)/toplev.h \
89    $(srcdir)/flags.h $(srcdir)/objc/objc-act.h $(srcdir)/input.h \
90    $(srcdir)/function.h $(srcdir)/output.h $(srcdir)/c-parse.h
91         $(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) -I$(srcdir)/objc \
92         -c $(srcdir)/objc/objc-act.c
93
94 #\f
95 # Build hooks:
96
97 objc.all.build:
98 objc.all.cross:
99 objc.start.encap:
100 objc.rest.encap:
101
102 objc.info:
103 objc.dvi:
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 objc.clean: objc.mostlyclean
126         -rm -rf objc-headers
127 objc.distclean:
128         -rm -f objc/Makefile objc/Make-host objc/Make-target
129         -rm -f objc/config.status objc/config.cache
130         -rm -f objc-parse.output
131 objc.extraclean:
132 objc.maintainer-clean:
133         -rm -f objc/objc-parse.y
134         -rm -f objc/objc-parse.c objc/objc-parse.output
135
136 #\f
137 # Stage hooks:
138
139 objc.stage1: stage1-start
140         -mv objc/*$(objext) stage1/objc
141         -mv cc1obj$(exeext) stage1
142 objc.stage2: stage2-start
143         -mv objc/*$(objext) stage2/objc
144         -mv cc1obj$(exeext) stage2
145 objc.stage3: stage3-start
146         -mv objc/*$(objext) stage3/objc
147         -mv cc1obj$(exeext) stage3
148 objc.stage4: stage4-start
149         -mv objc/*$(objext) stage4/objc
150         -mv cc1obj$(exeext) stage4
151
152 #\f
153 # Maintenance hooks:
154
155 # This target creates the files that can be rebuilt, but go in the
156 # distribution anyway.  It then copies the files to the distdir directory.
157 # ??? Note that this should be fixed once the Makefile is fixed to do
158 # the build in the inner directory.
159 objc.distdir: $(srcdir)/objc/objc-parse.c
160         mkdir tmp/objc
161 #       cd objc ; $(MAKE) $(FLAGS_TO_PASS) objc-parse.c
162         cd objc; \
163         for file in *[0-9a-zA-Z+]; do \
164           ln $$file ../tmp/objc >/dev/null 2>&1 || cp $$file ../tmp/objc; \
165         done