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