File: Makefile.in

package info (click to toggle)
sdcc 4.0.0%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 100,120 kB
  • sloc: ansic: 935,524; cpp: 75,055; makefile: 57,615; sh: 30,106; asm: 14,243; perl: 12,136; yacc: 7,297; lisp: 1,672; python: 815; lex: 781; awk: 498; sed: 89
file content (323 lines) | stat: -rw-r--r-- 11,160 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
# Makefile for GNU C Preprocessor.
#
# hacked from gcc Makefile by kvigor.
#
#   Copyright (C) 1987, 1988, 1990, 1991, 1992, 1993, 1994, 1995
#   1996, 1997, 1998, 1999, 2000, 2001 Free Software Foundation, Inc.

#This file is part of GNU CC.

#GNU CC is free software; you can redistribute it and/or modify
#it under the terms of the GNU General Public License as published by
#the Free Software Foundation; either version 2, or (at your option)
#any later version.

#GNU CC is distributed in the hope that it will be useful,
#but WITHOUT ANY WARRANTY; without even the implied warranty of
#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#GNU General Public License for more details.

#You should have received a copy of the GNU General Public License
#along with GNU CC; see the file COPYING.  If not, write to
#the Free Software Foundation, 59 Temple Place - Suite 330,
#Boston MA 02111-1307, USA.

EXEEXT = @EXEEXT@
TARGET = ../../bin/sdcpp$(EXEEXT)

VPATH  = @srcdir@

# This is the default target.
all: $(TARGET)

# Directory where sources are, from where we are.
srcdir = @srcdir@



LIBS = @LIBS@
CFLAGS = @CFLAGS@ @WALL_FLAG@
ALL_CFLAGS = $(INTERNAL_CFLAGS) $(X_CFLAGS) $(T_CFLAGS) \
  $(CFLAGS) $(WARN_CFLAGS) $(XCFLAGS) @DEFS@
ALL_CPPFLAGS = $(CPPFLAGS) $(X_CPPFLAGS) $(T_CPPFLAGS)
LDFLAGS = @LDFLAGS@

AWK = @AWK@
CC = @CC@
AR = @AR@
AR_FLAGS = rc
RANLIB = @RANLIB@
SHELL = /bin/sh
STRIP = @STRIP@
# on sysV, define this as cp.
INSTALL = @INSTALL@
# Some systems may be missing symbolic links, regular links, or both.
# Allow configure to check this and use "ln -s", "ln", or "cp" as appropriate.
LN=@LN@
LN_S=@LN_S@
# These permit overriding just for certain files.
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_DATA = @INSTALL_DATA@
@SET_MAKE@
# Some compilers can't handle cc -c blah.c -o foo/blah.o.
# In stage2 and beyond, we force this to "-o $@" since we know we're using gcc.
OUTPUT_OPTION = @OUTPUT_OPTION@

# Some versions of `touch' (such as the version on Solaris 2.8)
# do not correctly set the timestamp due to buggy versions of `utime'
# in the kernel.  So, we use `echo' instead.
STAMP = echo timestamp >

# Where to find some libiberty headers.
LIBIBERTY_DIR = $(srcdir)/../sdbinutils/include
LIBCPP_DIR = $(srcdir)/libcpp
OBSTACK_H   = $(LIBIBERTY_DIR)/obstack.h
SPLAY_TREE_H= $(LIBIBERTY_DIR)/splay-tree.h

# Test to see whether <limits.h> exists in the system header files.
LIMITS_H_TEST = [ -f $(SYSTEM_HEADER_DIR)/limits.h ]

# Common prefix for installation directories.
# NOTE: This directory must exist when you start installation.
prefix = @prefix@
# Directory in which to put localized header files. On the systems with
# gcc as the native cc, `local_prefix' may not be `prefix' which is
# `/usr'.
# NOTE: local_prefix *should not* default from prefix.
local_prefix = @local_prefix@
# Directory in which to put host dependent programs and libraries
exec_prefix = @exec_prefix@
# Directory in which to put the executable for the command `gcc'
bindir = @bindir@
includedir = $(local_prefix)/include
# where the info files go
exeext = @host_exeext@

transform       = @program_transform_name@
lang_opt_files=$(srcdir)/sdcpp.opt

# All option source files
ALL_OPT_FILES=$(lang_opt_files) $(extra_opt_files)

# Top build directory, relative to here.
top_builddir = @top_builddir@

# Whether we were configured with NLS.
USE_NLS = @USE_NLS@

# Internationalization library.
INTLLIBS = @INTLLIBS@

# Change this to a null string if obstacks are installed in the
# system library.
OBSTACK=obstack.o

# End of variables for you to override.

install: all
	mkdir -p $(DESTDIR)$(bindir)
	$(INSTALL) $(TARGET) $(DESTDIR)$(bindir)/`echo sdcpp|sed '$(transform)'`$(EXEEXT)
	$(STRIP) $(DESTDIR)$(bindir)/`echo sdcpp|sed '$(transform)'`$(EXEEXT)

uninstall:
	rm -f $(DESTDIR)$(bindir)/`echo sdcpp|sed '$(transform)'`$(EXEEXT)
clean:
	-rm -f $(TARGET) *.o core libcpp.a
	rm -f s-options optionlist options.h s-options-h options.c

distclean: clean
	-rm -f auto-host.h auto-build.h cstamp-h Makefile \
	  config.status config.run config.cache config.bak config.log *~ \
	  configargs.h

# This tells GNU Make version 3 not to put all variables in the environment.
.NOEXPORT:

# GCONFIG_H lists the config files that the generator files depend on, while
# CONFIG_H lists the the ones ordinary gcc files depend on, which includes
# a file generated by gencodes.
CONFIG_H = config.h
SYSTEM_H = system.h hwint.h

# sed inserts variable overrides after the following line.
####target overrides
#@target_overrides@

####host overrides
#@host_overrides@

####cross overrides
#@cross_defines@
#@cross_overrides@

####build overrides
#@build_overrides@
#

INCLUDES = -I$(srcdir) -I$(LIBCPP_DIR) -I$(LIBCPP_DIR)/include -I$(LIBIBERTY_DIR) -I.

# Always use -I$(srcdir)/config when compiling.
.c.o:
	$(CC) -c $(ALL_CFLAGS) $(INCLUDES) $(ALL_CPPFLAGS) $< $(OUTPUT_OPTION)

# cstamp-h.in controls rebuilding of config.in.
# It is named cstamp-h.in and not stamp-h.in so the mostlyclean rule doesn't
# delete it.  A stamp file is needed as autoheader won't update the file if
# nothing has changed.
# It remains in the source directory and is part of the distribution.
# This follows what is done in shellutils, fileutils, etc.
# "echo timestamp" is used instead of touch to be consistent with other
# packages that use autoconf (??? perhaps also to avoid problems with patch?).
# ??? Newer versions have a maintainer mode that may be useful here.
$(srcdir)/config.in: $(srcdir)/cstamp-h.in $(srcdir)/acconfig.h
$(srcdir)/cstamp-h.in: $(srcdir)/configure.in $(srcdir)/acconfig.h
	(cd $(srcdir) && autoheader)
	@rm -f $(srcdir)/cstamp-h.in
	echo timestamp > $(srcdir)/cstamp-h.in
auto-host.h: cstamp-h ; @true
cstamp-h: config.in config.status
	CONFIG_HEADERS=auto-host.h:config.in LANGUAGES="$(CONFIG_LANGUAGES)" $(SHELL) config.status

# Really, really stupid make features, such as SUN's KEEP_STATE, may force
# a target to build even if it is up-to-date.  So we must verify that
# config.status does not exist before failing.
config.status: $(srcdir)/configure  version.c
	@if [ ! -f config.status ] ; then \
	  echo You must configure gcc.  Look at http://gcc.gnu.org/install/ for details.; \
	  false; \
	else \
	  LANGUAGES="$(CONFIG_LANGUAGES)" $(SHELL) config.status --recheck; \
	fi


optionlist: s-options ; @true
s-options: $(ALL_OPT_FILES) Makefile $(srcdir)/opt-gather.awk
	$(AWK) -f $(srcdir)/opt-gather.awk $(ALL_OPT_FILES) > tmp-optionlist
	$(SHELL) $(srcdir)/move-if-change tmp-optionlist optionlist
	$(STAMP) s-options

options.c: optionlist $(srcdir)/opt-functions.awk $(srcdir)/optc-gen.awk
	$(AWK) -f $(srcdir)/opt-functions.awk -f $(srcdir)/optc-gen.awk \
	       -v header_name="config.h system.h options.h" < $< > $@

options.h: s-options-h ; @true
s-options-h: optionlist $(srcdir)/opt-functions.awk $(srcdir)/opth-gen.awk
	$(AWK) -f $(srcdir)/opt-functions.awk -f $(srcdir)/opth-gen.awk \
	       < $< > tmp-options.h
	$(SHELL) $(srcdir)/move-if-change tmp-options.h options.h
	$(STAMP) $@

#
# Remake cpp and protoize.

PREPROCESSOR_DEFINES = \
  -DGCC_INCLUDE_DIR=\"$(libsubdir)/include\" \
  -DGPLUSPLUS_INCLUDE_DIR=\"$(gcc_gxx_include_dir)\" \
  -DGPLUSPLUS_TOOL_INCLUDE_DIR=\"$(gcc_gxx_include_dir)/$(target_alias)\" \
  -DGPLUSPLUS_BACKWARD_INCLUDE_DIR=\"$(gcc_gxx_include_dir)/backward\" \
  -DLOCAL_INCLUDE_DIR=\"$(includedir)\" \
  -DCROSS_INCLUDE_DIR=\"$(gcc_tooldir)/sys-include\" \
  -DTOOL_INCLUDE_DIR=\"$(gcc_tooldir)/include\"

##########################
# Libcpp

LIBCPP_OBJS =	charset.o directives.o errors.o expr.o files.o identifiers.o \
		init.o lex.o line-map.o macro.o mkdeps.o symtab.o traditional.o


##LIBCPP_DEPS =	cpplib.h cpphash.h hashtable.h intl.h options.h $(OBSTACK_H) $(SYSTEM_H)

# Most of the other archives built/used by this makefile are for
# targets.  This one is strictly for the host.
libcpp.a: $(LIBCPP_OBJS)
	-rm -rf libcpp.a
	$(AR) $(AR_FLAGS) libcpp.a $(LIBCPP_OBJS)
	-$(RANLIB) libcpp.a

charset.o: $(LIBCPP_DIR)/charset.c $(CONFIG_H) $(LIBCPP_DEPS)
	$(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $< $(OUTPUT_OPTION)

directives.o: $(LIBCPP_DIR)/directives.c $(CONFIG_H) $(LIBCPP_DEPS)
	$(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $< $(OUTPUT_OPTION)

errors.o: $(LIBCPP_DIR)/errors.c $(CONFIG_H) $(LIBCPP_DEPS)
	$(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $< $(OUTPUT_OPTION)

expr.o: $(LIBCPP_DIR)/expr.c $(CONFIG_H) $(LIBCPP_DEPS)
	$(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $< $(OUTPUT_OPTION)

files.o: $(LIBCPP_DIR)/files.c $(CONFIG_H) $(LIBCPP_DEPS)
	$(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $< $(OUTPUT_OPTION)

identifiers.o: $(LIBCPP_DIR)/identifiers.c $(CONFIG_H) $(LIBCPP_DEPS)
	$(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $< $(OUTPUT_OPTION)

init.o: $(LIBCPP_DIR)/init.c $(CONFIG_H) $(LIBCPP_DEPS)
	$(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $< $(OUTPUT_OPTION)

lex.o: $(LIBCPP_DIR)/lex.c $(CONFIG_H) $(LIBCPP_DEPS)
	$(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $< $(OUTPUT_OPTION)

line-map.o: $(LIBCPP_DIR)/line-map.c $(CONFIG_H) $(LIBCPP_DEPS)
	$(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $< $(OUTPUT_OPTION)

macro.o: $(LIBCPP_DIR)/macro.c $(CONFIG_H) $(LIBCPP_DEPS)
	$(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $< $(OUTPUT_OPTION)

mkdeps.o: $(LIBCPP_DIR)/mkdeps.c $(CONFIG_H) $(LIBCPP_DEPS)
	$(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $< $(OUTPUT_OPTION)

symtab.o: $(LIBCPP_DIR)/symtab.c $(CONFIG_H) $(LIBCPP_DEPS)
	$(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $< $(OUTPUT_OPTION)

traditional.o: $(LIBCPP_DIR)/traditional.c $(CONFIG_H) $(LIBCPP_DEPS)
	$(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $< $(OUTPUT_OPTION)

##########################
# Libiberty

LIBIBERTY = ../sdbinutils/libiberty/libiberty.a

$(LIBIBERTY):
	cd ../sdbinutils/libiberty/ && if [ -e Makefile ]; then $(MAKE); else ./configure && $(MAKE); fi

##########################
# Sdcpp

SDCC_OBJS = sdcpp.o sdcpp-opts.o sdcpp-diagnostic.o c-ppoutput.o cppdefault.o prefix.o version.o opts.o opts-common.o options.o c-incpath.o

$(TARGET): $(SDCC_OBJS) $(LIBIBERTY) libcpp.a $(LIBDEPS)
	mkdir -p $(dir $@)
	$(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ $(SDCC_OBJS) \
	libcpp.a $(LIBIBERTY) $(LIBS)

sdcpp.o: sdcpp.c $(CONFIG_H) $(SYSTEM_H) options.h

sdcpp-opts.o: sdcpp-opts.c $(CONFIG_H) $(LIBCPP_DEPS) options.h

sdcpp-diagnostic.o: sdcpp-diagnostic.c $(CONFIG_H) $(LIBCPP_DEPS)

c-ppoutput.o: c-ppoutput.c $(CONFIG_H) $(SYSTEM_H)

options.o: options.c $(CONFIG_H) $(LIBCPP_DEPS) options.h

opts.o: opts.c $(CONFIG_H) $(LIBCPP_DEPS) options.h

opts-common.o: opts.c $(CONFIG_H) $(LIBCPP_DEPS) options.h

c-incpath.o: $(CONFIG_H) $(LIBCPP_DEPS) c-incpath.h

version.o: version.c version.h

cppcharset.o: cppcharset.c $(CONFIG_H) $(SYSTEM_H)

prefix.o: prefix.c $(CONFIG_H) $(SYSTEM_H) Makefile prefix.h
	$(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
	-DPREFIX=\"$(prefix)\" \
	  -c $(srcdir)/prefix.c

cppdefault.o: cppdefault.c $(CONFIG_H) $(SYSTEM_H) cppdefault.h Makefile
	$(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
	  $(PREPROCESSOR_DEFINES) \
	  -c $(srcdir)/cppdefault.c