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