Enabled VPATH feature: changed nearly all Makefiles (149 files).
[fw/sdcc] / support / cpp2 / 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@
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 CC = @CC@
46 AR = ar
47 AR_FLAGS = rc
48 RANLIB = @RANLIB@
49 SHELL = /bin/sh
50 STRIP = @STRIP@
51 # on sysV, define this as cp.
52 INSTALL = @INSTALL@
53 # Some systems may be missing symbolic links, regular links, or both.
54 # Allow configure to check this and use "ln -s", "ln", or "cp" as appropriate.
55 LN=@LN@
56 LN_S=@LN_S@
57 # These permit overriding just for certain files.
58 INSTALL_PROGRAM = @INSTALL_PROGRAM@
59 INSTALL_DATA = @INSTALL_DATA@
60 @SET_MAKE@
61 # Some compilers can't handle cc -c blah.c -o foo/blah.o.
62 # In stage2 and beyond, we force this to "-o $@" since we know we're using gcc.
63 OUTPUT_OPTION = @OUTPUT_OPTION@
64
65 # Some versions of `touch' (such as the version on Solaris 2.8)
66 # do not correctly set the timestamp due to buggy versions of `utime'
67 # in the kernel.  So, we use `echo' instead.
68 STAMP = echo timestamp >
69
70 # Where to find some libiberty headers.
71 LIBIBERTY_DIR = $(srcdir)/libiberty
72 OBSTACK_H   = $(LIBIBERTY_DIR)/obstack.h
73 SPLAY_TREE_H= $(LIBIBERTY_DIR)/splay-tree.h
74
75 # Test to see whether <limits.h> exists in the system header files.
76 LIMITS_H_TEST = [ -f $(SYSTEM_HEADER_DIR)/limits.h ]
77
78 # Common prefix for installation directories.
79 # NOTE: This directory must exist when you start installation.
80 prefix = @prefix@
81 # Directory in which to put localized header files. On the systems with
82 # gcc as the native cc, `local_prefix' may not be `prefix' which is
83 # `/usr'.
84 # NOTE: local_prefix *should not* default from prefix.
85 local_prefix = @local_prefix@
86 # Directory in which to put host dependent programs and libraries
87 exec_prefix = @exec_prefix@
88 # Directory in which to put the executable for the command `gcc'
89 bindir = @bindir@
90 includedir = $(local_prefix)/include
91 # where the info files go
92 exeext = @host_exeext@
93
94 transform       = @program_transform_name@
95
96 # Top build directory, relative to here.
97 top_builddir = @top_builddir@
98
99 # Whether we were configured with NLS.
100 USE_NLS = @USE_NLS@
101
102 # Internationalization library.
103 INTLLIBS = @INTLLIBS@
104
105 # Change this to a null string if obstacks are installed in the
106 # system library.
107 OBSTACK=obstack.o
108
109 # End of variables for you to override.
110
111 install: all
112         mkdir -p $(DESTDIR)$(bindir)
113         $(INSTALL) $(TARGET) `echo $(DESTDIR)$(bindir)/sdcpp$(EXEEXT)|sed '$(transform)'`
114         $(STRIP) `echo $(DESTDIR)$(bindir)/sdcpp$(EXEEXT)|sed '$(transform)'`
115
116 uninstall:
117         rm -f $(DESTDIR)$(bindir)/sdcpp$(EXEEXT)
118 clean:
119         -rm -f $(TARGET) *.o core libcpp.a
120
121 distclean: clean
122         -rm -f auto-host.h auto-build.h cstamp-h Makefile
123         -rm -f configargs.h config.status config.run config.cache config.bak config.log *~
124
125 # This tells GNU Make version 3 not to put all variables in the environment.
126 .NOEXPORT:
127
128 # GCONFIG_H lists the config files that the generator files depend on, while
129 # CONFIG_H lists the the ones ordinary gcc files depend on, which includes
130 # a file generated by gencodes.
131 CONFIG_H = config.h
132 SYSTEM_H = system.h hwint.h
133
134 # sed inserts variable overrides after the following line.
135 ####target overrides
136 #@target_overrides@
137
138 ####host overrides
139 #@host_overrides@
140
141 ####cross overrides
142 #@cross_defines@
143 #@cross_overrides@
144
145 ####build overrides
146 #@build_overrides@
147 #\f
148
149 INCLUDES = -I$(srcdir) -I$(LIBIBERTY_DIR) -I.
150
151 # Always use -I$(srcdir)/config when compiling.
152 .c.o:
153         $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $< $(OUTPUT_OPTION)
154
155 # cstamp-h.in controls rebuilding of config.in.
156 # It is named cstamp-h.in and not stamp-h.in so the mostlyclean rule doesn't
157 # delete it.  A stamp file is needed as autoheader won't update the file if
158 # nothing has changed.
159 # It remains in the source directory and is part of the distribution.
160 # This follows what is done in shellutils, fileutils, etc.
161 # "echo timestamp" is used instead of touch to be consistent with other
162 # packages that use autoconf (??? perhaps also to avoid problems with patch?).
163 # ??? Newer versions have a maintainer mode that may be useful here.
164 $(srcdir)/config.in: $(srcdir)/cstamp-h.in $(srcdir)/acconfig.h
165 $(srcdir)/cstamp-h.in: $(srcdir)/configure.in $(srcdir)/acconfig.h
166         (cd $(srcdir) && autoheader)
167         @rm -f $(srcdir)/cstamp-h.in
168         echo timestamp > $(srcdir)/cstamp-h.in
169 auto-host.h: cstamp-h ; @true
170 cstamp-h: config.in config.status
171         CONFIG_HEADERS=auto-host.h:config.in LANGUAGES="$(CONFIG_LANGUAGES)" $(SHELL) config.status
172
173 # Really, really stupid make features, such as SUN's KEEP_STATE, may force
174 # a target to build even if it is up-to-date.  So we must verify that
175 # config.status does not exist before failing.
176 config.status: $(srcdir)/configure  version.c
177         @if [ ! -f config.status ] ; then \
178           echo You must configure gcc.  Look at http://gcc.gnu.org/install/ for details.; \
179           false; \
180         else \
181           LANGUAGES="$(CONFIG_LANGUAGES)" $(SHELL) config.status --recheck; \
182         fi
183
184 version.o: version.c version.h
185
186 hashtable.o: hashtable.c hashtable.h $(CONFIG_H) $(SYSTEM_H) $(OBSTACK_H)
187
188 prefix.o: prefix.c $(CONFIG_H) $(SYSTEM_H) Makefile prefix.h
189         $(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
190         -DPREFIX=\"$(prefix)\" \
191           -c $(srcdir)/prefix.c
192
193 intl.o: intl.c intl.h Makefile
194         $(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
195           -DLOCALEDIR=\"$(localedir)\" \
196           -c $(srcdir)/intl.c
197
198 #\f
199 # Remake cpp and protoize.
200
201 PREPROCESSOR_DEFINES = \
202   -DGCC_INCLUDE_DIR=\"$(libsubdir)/include\" \
203   -DGPLUSPLUS_INCLUDE_DIR=\"$(gcc_gxx_include_dir)\" \
204   -DGPLUSPLUS_TOOL_INCLUDE_DIR=\"$(gcc_gxx_include_dir)/$(target_alias)\" \
205   -DGPLUSPLUS_BACKWARD_INCLUDE_DIR=\"$(gcc_gxx_include_dir)/backward\" \
206   -DLOCAL_INCLUDE_DIR=\"$(includedir)\" \
207   -DCROSS_INCLUDE_DIR=\"$(gcc_tooldir)/sys-include\" \
208   -DTOOL_INCLUDE_DIR=\"$(gcc_tooldir)/include\"
209
210 LIBCPP_OBJS =   cpplib.o cpplex.o cppmacro.o cppexp.o cppfiles.o \
211                 cpphash.o cpperror.o cppinit.o cppdefault.o \
212                 hashtable.o mkdeps.o prefix.o version.o mbchar.o
213
214 LIBCPP_DEPS =   cpplib.h cpphash.h hashtable.h intl.h $(OBSTACK_H) $(SYSTEM_H)
215
216 # Most of the other archives built/used by this makefile are for
217 # targets.  This one is strictly for the host.
218 libcpp.a: $(LIBCPP_OBJS)
219         -rm -rf libcpp.a
220         $(AR) $(AR_FLAGS) libcpp.a $(LIBCPP_OBJS)
221         -$(RANLIB) libcpp.a
222
223 MY_LIBIBERTY_BITS = safe-ctype.o obstack.o splay-tree.o \
224                     lbasename.o
225
226 $(TARGET): cppmain.o intl.o $(MY_LIBIBERTY_BITS) libcpp.a $(LIBDEPS) 
227         mkdir -p $(dir $@)
228         $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ cppmain.o \
229         $(MY_LIBIBERTY_BITS) libcpp.a $(LIBS)
230
231 cppmain.o:  cppmain.c  $(CONFIG_H) cpplib.h intl.h $(SYSTEM_H)
232
233 cpperror.o: cpperror.c $(CONFIG_H) $(LIBCPP_DEPS)
234 cppexp.o:   cppexp.c   $(CONFIG_H) $(LIBCPP_DEPS)
235 cpplex.o:   cpplex.c   $(CONFIG_H) $(LIBCPP_DEPS) mbchar.h
236 cppmacro.o: cppmacro.c $(CONFIG_H) $(LIBCPP_DEPS)
237 cpplib.o:   cpplib.c   $(CONFIG_H) $(LIBCPP_DEPS)
238 cpphash.o:  cpphash.c  $(CONFIG_H) $(LIBCPP_DEPS)
239 cppfiles.o: cppfiles.c $(CONFIG_H) $(LIBCPP_DEPS) $(SPLAY_TREE_H) mkdeps.h
240 cppinit.o:  cppinit.c  $(CONFIG_H) $(LIBCPP_DEPS) cppdefault.h \
241                 mkdeps.h prefix.h output.h version.h
242 safe-ctype.o: $(LIBIBERTY_DIR)/safe-ctype.c $(LIBIBERTY_DIR)/safe-ctype.h $(CONFIG_H) $(LIBCPP_DEPS)
243         $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $< $(OUTPUT_OPTION)
244 obstack.o: $(LIBIBERTY_DIR)/obstack.c $(LIBIBERTY_DIR)/obstack.h $(CONFIG_H) $(LIBCPP_DEPS)
245         $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $< $(OUTPUT_OPTION)
246 splay-tree.o: $(LIBIBERTY_DIR)/splay-tree.c $(LIBIBERTY_DIR)/splay-tree.h $(CONFIG_H) $(LIBCPP_DEPS)
247         $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $< $(OUTPUT_OPTION)
248 lbasename.o: $(LIBIBERTY_DIR)/lbasename.c  $(CONFIG_H) $(LIBCPP_DEPS)
249         $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $< $(OUTPUT_OPTION)
250 cppdefault.o: cppdefault.c $(CONFIG_H) $(SYSTEM_H) cppdefault.h Makefile
251         $(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
252           $(PREPROCESSOR_DEFINES) \
253           -c $(srcdir)/cppdefault.c
254
255 mkdeps.o: mkdeps.c $(CONFIG_H) $(SYSTEM_H) mkdeps.h
256