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