Imported Upstream version 2.9.0
[debian/cc1111] / support / cpp / Makefile.in
1 # Makefile for GNU C Preprocessor.
2 #
3 # hacked from gcc Makefile by kvigor.
4 #
5 #   Copyright (C) 1987, 1988, 1990, 1991, 1992, 1993, 1994, 1995
6 #   1996, 1997, 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
7
8 #This file is part of GNU CC.
9
10 #GNU CC is free software; you can redistribute it and/or modify
11 #it under the terms of the GNU General Public License as published by
12 #the Free Software Foundation; either version 2, or (at your option)
13 #any later version.
14
15 #GNU CC is distributed in the hope that it will be useful,
16 #but WITHOUT ANY WARRANTY; without even the implied warranty of
17 #MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18 #GNU General Public License for more details.
19
20 #You should have received a copy of the GNU General Public License
21 #along with GNU CC; see the file COPYING.  If not, write to
22 #the Free Software Foundation, 59 Temple Place - Suite 330,
23 #Boston MA 02111-1307, USA.
24
25 EXEEXT = @EXEEXT@
26 TARGET = ../../bin/sdcpp$(EXEEXT)
27
28 VPATH  = @srcdir@
29
30 # This is the default target.
31 all: $(TARGET)
32
33 # Directory where sources are, from where we are.
34 srcdir = @srcdir@
35
36
37
38 LIBS = @LIBS@
39 CFLAGS = @CFLAGS@ -Wall
40 ALL_CFLAGS = $(INTERNAL_CFLAGS) $(X_CFLAGS) $(T_CFLAGS) \
41   $(CFLAGS) $(WARN_CFLAGS) $(XCFLAGS) @DEFS@
42 ALL_CPPFLAGS = $(CPPFLAGS) $(X_CPPFLAGS) $(T_CPPFLAGS)
43 LDFLAGS = @LDFLAGS@
44
45 AWK = @AWK@
46 CC = @CC@
47 AR = ar
48 AR_FLAGS = rc
49 RANLIB = @RANLIB@
50 SHELL = /bin/sh
51 STRIP = @STRIP@
52 # on sysV, define this as cp.
53 INSTALL = @INSTALL@
54 # Some systems may be missing symbolic links, regular links, or both.
55 # Allow configure to check this and use "ln -s", "ln", or "cp" as appropriate.
56 LN=@LN@
57 LN_S=@LN_S@
58 # These permit overriding just for certain files.
59 INSTALL_PROGRAM = @INSTALL_PROGRAM@
60 INSTALL_DATA = @INSTALL_DATA@
61 @SET_MAKE@
62 # Some compilers can't handle cc -c blah.c -o foo/blah.o.
63 # In stage2 and beyond, we force this to "-o $@" since we know we're using gcc.
64 OUTPUT_OPTION = @OUTPUT_OPTION@
65
66 # Some versions of `touch' (such as the version on Solaris 2.8)
67 # do not correctly set the timestamp due to buggy versions of `utime'
68 # in the kernel.  So, we use `echo' instead.
69 STAMP = echo timestamp >
70
71 # Where to find some libiberty headers.
72 LIBIBERTY_DIR = $(srcdir)/libiberty
73 LIBCPP_DIR = $(srcdir)/libcpp
74 OBSTACK_H   = $(LIBIBERTY_DIR)/obstack.h
75 SPLAY_TREE_H= $(LIBIBERTY_DIR)/splay-tree.h
76
77 # Test to see whether <limits.h> exists in the system header files.
78 LIMITS_H_TEST = [ -f $(SYSTEM_HEADER_DIR)/limits.h ]
79
80 # Common prefix for installation directories.
81 # NOTE: This directory must exist when you start installation.
82 prefix = @prefix@
83 # Directory in which to put localized header files. On the systems with
84 # gcc as the native cc, `local_prefix' may not be `prefix' which is
85 # `/usr'.
86 # NOTE: local_prefix *should not* default from prefix.
87 local_prefix = @local_prefix@
88 # Directory in which to put host dependent programs and libraries
89 exec_prefix = @exec_prefix@
90 # Directory in which to put the executable for the command `gcc'
91 bindir = @bindir@
92 includedir = $(local_prefix)/include
93 # where the info files go
94 exeext = @host_exeext@
95
96 transform       = @program_transform_name@
97 lang_opt_files=$(srcdir)/sdcpp.opt
98
99 # All option source files
100 ALL_OPT_FILES=$(lang_opt_files) $(extra_opt_files)
101
102 # Top build directory, relative to here.
103 top_builddir = @top_builddir@
104
105 # Whether we were configured with NLS.
106 USE_NLS = @USE_NLS@
107
108 # Internationalization library.
109 INTLLIBS = @INTLLIBS@
110
111 # Change this to a null string if obstacks are installed in the
112 # system library.
113 OBSTACK=obstack.o
114
115 # End of variables for you to override.
116
117 install: all
118         mkdir -p $(DESTDIR)$(bindir)
119         $(INSTALL) $(TARGET) `echo $(DESTDIR)$(bindir)/sdcpp$(EXEEXT)|sed '$(transform)'`
120         $(STRIP) `echo $(DESTDIR)$(bindir)/sdcpp$(EXEEXT)|sed '$(transform)'`
121
122 uninstall:
123         rm -f $(DESTDIR)$(bindir)/sdcpp$(EXEEXT)
124 clean:
125         -rm -f $(TARGET) *.o core libcpp.a
126         rm -f s-options optionlist options.h s-options-h options.c
127
128 distclean: clean
129         -rm -f auto-host.h auto-build.h cstamp-h Makefile
130         config.status config.run config.cache config.bak config.log *~
131
132 # This tells GNU Make version 3 not to put all variables in the environment.
133 .NOEXPORT:
134
135 # GCONFIG_H lists the config files that the generator files depend on, while
136 # CONFIG_H lists the the ones ordinary gcc files depend on, which includes
137 # a file generated by gencodes.
138 CONFIG_H = config.h
139 SYSTEM_H = system.h hwint.h
140
141 # sed inserts variable overrides after the following line.
142 ####target overrides
143 #@target_overrides@
144
145 ####host overrides
146 #@host_overrides@
147
148 ####cross overrides
149 #@cross_defines@
150 #@cross_overrides@
151
152 ####build overrides
153 #@build_overrides@
154 #\f
155
156 INCLUDES = -I$(srcdir) -I$(LIBCPP_DIR) -I$(LIBCPP_DIR)/include -I$(LIBIBERTY_DIR) -I.
157
158 # Always use -I$(srcdir)/config when compiling.
159 .c.o:
160         $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $< $(OUTPUT_OPTION)
161
162 # cstamp-h.in controls rebuilding of config.in.
163 # It is named cstamp-h.in and not stamp-h.in so the mostlyclean rule doesn't
164 # delete it.  A stamp file is needed as autoheader won't update the file if
165 # nothing has changed.
166 # It remains in the source directory and is part of the distribution.
167 # This follows what is done in shellutils, fileutils, etc.
168 # "echo timestamp" is used instead of touch to be consistent with other
169 # packages that use autoconf (??? perhaps also to avoid problems with patch?).
170 # ??? Newer versions have a maintainer mode that may be useful here.
171 $(srcdir)/config.in: $(srcdir)/cstamp-h.in $(srcdir)/acconfig.h
172 $(srcdir)/cstamp-h.in: $(srcdir)/configure.in $(srcdir)/acconfig.h
173         (cd $(srcdir) && autoheader)
174         @rm -f $(srcdir)/cstamp-h.in
175         echo timestamp > $(srcdir)/cstamp-h.in
176 auto-host.h: cstamp-h ; @true
177 cstamp-h: config.in config.status
178         CONFIG_HEADERS=auto-host.h:config.in LANGUAGES="$(CONFIG_LANGUAGES)" $(SHELL) config.status
179
180 # Really, really stupid make features, such as SUN's KEEP_STATE, may force
181 # a target to build even if it is up-to-date.  So we must verify that
182 # config.status does not exist before failing.
183 config.status: $(srcdir)/configure  version.c
184         @if [ ! -f config.status ] ; then \
185           echo You must configure gcc.  Look at http://gcc.gnu.org/install/ for details.; \
186           false; \
187         else \
188           LANGUAGES="$(CONFIG_LANGUAGES)" $(SHELL) config.status --recheck; \
189         fi
190
191
192 optionlist: s-options ; @true
193 s-options: $(ALL_OPT_FILES) Makefile $(srcdir)/opt-gather.awk
194         $(AWK) -f $(srcdir)/opt-gather.awk $(ALL_OPT_FILES) > tmp-optionlist
195         $(SHELL) $(srcdir)/move-if-change tmp-optionlist optionlist
196         $(STAMP) s-options
197
198 options.c: optionlist $(srcdir)/opt-functions.awk $(srcdir)/optc-gen.awk
199         $(AWK) -f $(srcdir)/opt-functions.awk -f $(srcdir)/optc-gen.awk \
200                -v header_name="config.h system.h options.h" < $< > $@
201
202 options.h: s-options-h ; @true
203 s-options-h: optionlist $(srcdir)/opt-functions.awk $(srcdir)/opth-gen.awk
204         $(AWK) -f $(srcdir)/opt-functions.awk -f $(srcdir)/opth-gen.awk \
205                < $< > tmp-options.h
206         $(SHELL) $(srcdir)/move-if-change tmp-options.h options.h
207         $(STAMP) $@
208
209 #\f
210 # Remake cpp and protoize.
211
212 PREPROCESSOR_DEFINES = \
213   -DGCC_INCLUDE_DIR=\"$(libsubdir)/include\" \
214   -DGPLUSPLUS_INCLUDE_DIR=\"$(gcc_gxx_include_dir)\" \
215   -DGPLUSPLUS_TOOL_INCLUDE_DIR=\"$(gcc_gxx_include_dir)/$(target_alias)\" \
216   -DGPLUSPLUS_BACKWARD_INCLUDE_DIR=\"$(gcc_gxx_include_dir)/backward\" \
217   -DLOCAL_INCLUDE_DIR=\"$(includedir)\" \
218   -DCROSS_INCLUDE_DIR=\"$(gcc_tooldir)/sys-include\" \
219   -DTOOL_INCLUDE_DIR=\"$(gcc_tooldir)/include\"
220
221 ##########################
222 # Libcpp
223
224 LIBCPP_OBJS =   charset.o directives.o errors.o expr.o files.o identifiers.o \
225                 init.o lex.o line-map.o macro.o mkdeps.o symtab.o traditional.o
226
227
228 ##LIBCPP_DEPS = cpplib.h cpphash.h hashtable.h intl.h options.h $(OBSTACK_H) $(SYSTEM_H)
229
230 # Most of the other archives built/used by this makefile are for
231 # targets.  This one is strictly for the host.
232 libcpp.a: $(LIBCPP_OBJS)
233         -rm -rf libcpp.a
234         $(AR) $(AR_FLAGS) libcpp.a $(LIBCPP_OBJS)
235         -$(RANLIB) libcpp.a
236
237 charset.o: $(LIBCPP_DIR)/charset.c $(CONFIG_H) $(LIBCPP_DEPS)
238         $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $< $(OUTPUT_OPTION)
239
240 directives.o: $(LIBCPP_DIR)/directives.c $(CONFIG_H) $(LIBCPP_DEPS)
241         $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $< $(OUTPUT_OPTION)
242
243 errors.o: $(LIBCPP_DIR)/errors.c $(CONFIG_H) $(LIBCPP_DEPS)
244         $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $< $(OUTPUT_OPTION)
245
246 expr.o: $(LIBCPP_DIR)/expr.c $(CONFIG_H) $(LIBCPP_DEPS)
247         $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $< $(OUTPUT_OPTION)
248
249 files.o: $(LIBCPP_DIR)/files.c $(CONFIG_H) $(LIBCPP_DEPS)
250         $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $< $(OUTPUT_OPTION)
251
252 identifiers.o: $(LIBCPP_DIR)/identifiers.c $(CONFIG_H) $(LIBCPP_DEPS)
253         $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $< $(OUTPUT_OPTION)
254
255 init.o: $(LIBCPP_DIR)/init.c $(CONFIG_H) $(LIBCPP_DEPS)
256         $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $< $(OUTPUT_OPTION)
257
258 lex.o: $(LIBCPP_DIR)/lex.c $(CONFIG_H) $(LIBCPP_DEPS)
259         $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $< $(OUTPUT_OPTION)
260
261 line-map.o: $(LIBCPP_DIR)/line-map.c $(CONFIG_H) $(LIBCPP_DEPS)
262         $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $< $(OUTPUT_OPTION)
263
264 macro.o: $(LIBCPP_DIR)/macro.c $(CONFIG_H) $(LIBCPP_DEPS)
265         $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $< $(OUTPUT_OPTION)
266
267 mkdeps.o: $(LIBCPP_DIR)/mkdeps.c $(CONFIG_H) $(LIBCPP_DEPS)
268         $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $< $(OUTPUT_OPTION)
269
270 symtab.o: $(LIBCPP_DIR)/symtab.c $(CONFIG_H) $(LIBCPP_DEPS)
271         $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $< $(OUTPUT_OPTION)
272
273 traditional.o: $(LIBCPP_DIR)/traditional.c $(CONFIG_H) $(LIBCPP_DEPS)
274         $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $< $(OUTPUT_OPTION)
275
276 ##########################
277 # Libiberty
278
279 MY_LIBIBERTY_BITS = concat.o fopen_unlocked.o getpwd.o hashtab.o hex.o \
280                     lbasename.o md5.o obstack.o safe-ctype.o splay-tree.o \
281                     vasprintf.o xexit.o xmalloc.o xmemdup.o xstrdup.o \
282                     xstrerror.o
283
284 concat.o: $(LIBIBERTY_DIR)/concat.c $(CONFIG_H) $(LIBCPP_DEPS)
285         $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $< $(OUTPUT_OPTION)
286
287 fopen_unlocked.o: $(LIBIBERTY_DIR)/fopen_unlocked.c $(CONFIG_H) $(LIBCPP_DEPS)
288         $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $< $(OUTPUT_OPTION)
289
290 getpwd.o: $(LIBIBERTY_DIR)/getpwd.c $(CONFIG_H) $(LIBCPP_DEPS)
291         $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $< $(OUTPUT_OPTION)
292
293 hashtab.o: $(LIBIBERTY_DIR)/hashtab.c $(CONFIG_H) $(LIBCPP_DEPS)
294         $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $< $(OUTPUT_OPTION)
295
296 hex.o: $(LIBIBERTY_DIR)/hex.c $(CONFIG_H) $(LIBCPP_DEPS)
297         $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $< $(OUTPUT_OPTION)
298
299 lbasename.o: $(LIBIBERTY_DIR)/lbasename.c $(CONFIG_H) $(LIBCPP_DEPS)
300         $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $< $(OUTPUT_OPTION)
301
302 md5.o: $(LIBIBERTY_DIR)/md5.c $(LIBIBERTY_DIR)/obstack.h $(CONFIG_H) $(LIBCPP_DEPS)
303         $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $< $(OUTPUT_OPTION)
304
305 obstack.o: $(LIBIBERTY_DIR)/obstack.c $(LIBIBERTY_DIR)/obstack.h $(CONFIG_H) $(LIBCPP_DEPS)
306         $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $< $(OUTPUT_OPTION)
307
308 safe-ctype.o: $(LIBIBERTY_DIR)/safe-ctype.c $(LIBIBERTY_DIR)/safe-ctype.h $(CONFIG_H) $(LIBCPP_DEPS)
309         $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $< $(OUTPUT_OPTION)
310
311 splay-tree.o: $(LIBIBERTY_DIR)/splay-tree.c $(LIBIBERTY_DIR)/splay-tree.h $(CONFIG_H) $(LIBCPP_DEPS)
312         $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $< $(OUTPUT_OPTION)
313
314 vasprintf.o: $(LIBIBERTY_DIR)/vasprintf.c  $(CONFIG_H) $(LIBCPP_DEPS)
315         $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $< $(OUTPUT_OPTION)
316
317 xexit.o: $(LIBIBERTY_DIR)/xexit.c  $(CONFIG_H) $(LIBCPP_DEPS)
318         $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $< $(OUTPUT_OPTION)
319
320 xmalloc.o: $(LIBIBERTY_DIR)/xmalloc.c  $(CONFIG_H) $(LIBCPP_DEPS)
321         $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $< $(OUTPUT_OPTION)
322
323 xmemdup.o: $(LIBIBERTY_DIR)/xmemdup.c  $(CONFIG_H) $(LIBCPP_DEPS)
324         $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $< $(OUTPUT_OPTION)
325
326 xstrdup.o: $(LIBIBERTY_DIR)/xstrdup.c  $(CONFIG_H) $(LIBCPP_DEPS)
327         $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $< $(OUTPUT_OPTION)
328
329 xstrerror.o: $(LIBIBERTY_DIR)/xstrerror.c  $(CONFIG_H) $(LIBCPP_DEPS)
330         $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $< $(OUTPUT_OPTION)
331
332 ##########################
333 # Sdcpp
334
335 SDCC_OBJS = sdcpp.o sdcpp-opts.o c-ppoutput.o cppdefault.o prefix.o version.o opts.o opts-common.o options.o c-incpath.o
336
337 $(TARGET): $(SDCC_OBJS) $(MY_LIBIBERTY_BITS) libcpp.a $(LIBDEPS)
338         mkdir -p $(dir $@)
339         $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ $(SDCC_OBJS) \
340         $(MY_LIBIBERTY_BITS) libcpp.a $(LIBS)
341
342 sdcpp.o: sdcpp.c $(CONFIG_H) $(SYSTEM_H) options.h
343
344 sdcpp-opts.o: sdcpp-opts.c $(CONFIG_H) $(LIBCPP_DEPS) options.h
345
346 c-ppoutput.o: c-ppoutput.c $(CONFIG_H) $(SYSTEM_H)
347
348 options.o: options.c $(CONFIG_H) $(LIBCPP_DEPS) options.h
349
350 opts.o: opts.c $(CONFIG_H) $(LIBCPP_DEPS) options.h
351
352 opts-common.o: opts.c $(CONFIG_H) $(LIBCPP_DEPS) options.h
353
354 c-incpath.o: $(CONFIG_H) $(LIBCPP_DEPS) c-incpath.h
355
356 version.o: version.c version.h
357
358 cppcharset.o: cppcharset.c $(CONFIG_H) $(SYSTEM_H)
359
360 prefix.o: prefix.c $(CONFIG_H) $(SYSTEM_H) Makefile prefix.h
361         $(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
362         -DPREFIX=\"$(prefix)\" \
363           -c $(srcdir)/prefix.c
364
365 cppdefault.o: cppdefault.c $(CONFIG_H) $(SYSTEM_H) cppdefault.h Makefile
366         $(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
367           $(PREPROCESSOR_DEFINES) \
368           -c $(srcdir)/cppdefault.c