]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blob - gold/Makefile.am
2009-11-24 Rafael Avila de Espindola <espindola@google.com>
[thirdparty/binutils-gdb.git] / gold / Makefile.am
1 # Process this file with automake to generate Makefile.in
2
3 AUTOMAKE_OPTIONS = foreign
4
5 SUBDIRS = po testsuite
6
7 tooldir = $(exec_prefix)/$(target_alias)
8
9 ACLOCAL_AMFLAGS = -I ../bfd -I ../config
10
11 AM_CFLAGS = $(WARN_CFLAGS) $(LFS_CFLAGS) $(RANDOM_SEED_CFLAGS)
12 AM_CXXFLAGS = $(WARN_CXXFLAGS) $(LFS_CFLAGS) $(RANDOM_SEED_CFLAGS)
13
14 AM_CPPFLAGS = \
15 -I$(srcdir) -I$(srcdir)/../include -I$(srcdir)/../elfcpp \
16 -DLOCALEDIR="\"$(datadir)/locale\"" \
17 -DBINDIR="\"$(bindir)\"" -DTOOLBINDIR="\"$(tooldir)/bin\"" \
18 @INCINTL@
19
20 LIBIBERTY = ../libiberty/libiberty.a
21
22 if PLUGINS
23 LIBDL = -ldl
24 endif
25
26 if THREADS
27 THREADSLIB = -lpthread
28 endif
29
30 AM_YFLAGS = -d
31
32 # Automake 1.10+ disables lex and yacc output file regeneration if
33 # maintainer mode is disabled. Avoid this.
34 am__skiplex =
35 am__skipyacc =
36
37 noinst_PROGRAMS = ld-new incremental-dump
38 noinst_LIBRARIES = libgold.a
39
40 CCFILES = \
41 archive.cc \
42 binary.cc \
43 common.cc \
44 compressed_output.cc \
45 copy-relocs.cc \
46 cref.cc \
47 defstd.cc \
48 descriptors.cc \
49 dirsearch.cc \
50 dynobj.cc \
51 dwarf_reader.cc \
52 ehframe.cc \
53 errors.cc \
54 expression.cc \
55 fileread.cc \
56 gc.cc \
57 gold.cc \
58 gold-threads.cc \
59 icf.cc \
60 incremental.cc \
61 layout.cc \
62 mapfile.cc \
63 merge.cc \
64 object.cc \
65 options.cc \
66 output.cc \
67 parameters.cc \
68 plugin.cc \
69 readsyms.cc \
70 reduced_debug_output.cc \
71 reloc.cc \
72 resolve.cc \
73 script-sections.cc \
74 script.cc \
75 stringpool.cc \
76 symtab.cc \
77 target.cc \
78 target-select.cc \
79 version.cc \
80 workqueue.cc \
81 workqueue-threads.cc
82
83 HFILES = \
84 archive.h \
85 binary.h \
86 common.h \
87 compressed_output.h \
88 copy-relocs.h \
89 cref.h \
90 defstd.h \
91 dirsearch.h \
92 descriptors.h \
93 dynobj.h \
94 dwarf_reader.h \
95 ehframe.h \
96 errors.h \
97 fileread.h \
98 freebsd.h \
99 gc.h \
100 gold.h \
101 gold-threads.h \
102 icf.h \
103 layout.h \
104 mapfile.h \
105 merge.h \
106 object.h \
107 options.h \
108 output.h \
109 parameters.h \
110 plugin.h \
111 readsyms.h \
112 reduced_debug_output.h \
113 reloc.h \
114 reloc-types.h \
115 script-c.h \
116 script-sections.h \
117 script.h \
118 stringpool.h \
119 symtab.h \
120 target.h \
121 target-reloc.h \
122 target-select.h \
123 tls.h \
124 token.h \
125 workqueue.h \
126 workqueue-internal.h
127
128 YFILES = \
129 yyscript.y
130
131 EXTRA_DIST = yyscript.c yyscript.h
132
133 TARGETSOURCES = \
134 i386.cc x86_64.cc sparc.cc powerpc.cc arm.cc
135
136 ALL_TARGETOBJS = \
137 i386.$(OBJEXT) x86_64.$(OBJEXT) sparc.$(OBJEXT) powerpc.$(OBJEXT) \
138 arm.$(OBJEXT)
139
140 libgold_a_SOURCES = $(CCFILES) $(HFILES) $(YFILES)
141 libgold_a_LIBADD = $(LIBOBJS)
142
143 sources_var = main.cc
144 deps_var = $(TARGETOBJS) libgold.a $(LIBIBERTY) $(LIBINTL_DEP)
145 ldadd_var = $(TARGETOBJS) libgold.a $(LIBIBERTY) $(LIBINTL) \
146 $(THREADSLIB) $(LIBDL)
147
148 ld_new_SOURCES = $(sources_var)
149 ld_new_DEPENDENCIES = $(deps_var)
150 ld_new_LDADD = $(ldadd_var)
151
152 EXTRA_ld_new_SOURCES = $(TARGETSOURCES)
153
154 incremental_dump_SOURCES = incremental-dump.cc
155 incremental_dump_DEPENDENCIES = $(TARGETOBJS) libgold.a $(LIBIBERTY)
156 incremental_dump_LDADD = $(TARGETOBJS) libgold.a $(LIBIBERTY)
157
158 # Use an explicit dependency for the bison generated header file.
159 expression.$(OBJEXT): yyscript.h
160 script-sections.$(OBJEXT): yyscript.h
161 script.$(OBJEXT): yyscript.h
162
163 # We have to build libgold.a before we run the tests.
164 check: libgold.a
165
166 .PHONY: install-exec-local
167
168 install-exec-local: ld-new$(EXEEXT)
169 $(mkinstalldirs) $(DESTDIR)$(bindir) $(DESTDIR)$(tooldir)/bin
170 n=`echo ld | sed '$(transform)'`; \
171 $(INSTALL_PROGRAM) ld-new$(EXEEXT) $(DESTDIR)$(bindir)/$${n}$(EXEEXT); \
172 if test "$(bindir)" != "$(tooldir)/bin"; then \
173 rm -f $(DESTDIR)$(tooldir)/bin/ld$(EXEEXT); \
174 ln $(DESTDIR)$(bindir)/$${n}$(EXEEXT) $(DESTDIR)$(tooldir)/bin/ld$(EXEEXT) >/dev/null 2>/dev/null \
175 || $(INSTALL_PROGRAM) ld-new$(EXEEXT) $(DESTDIR)$(tooldir)/bin/ld$(EXEEXT); \
176 fi
177
178 # We want install to imply install-info as per GNU standards, despite
179 # the cygnus option.
180 install-data-local: install-info
181
182 POTFILES= $(CCFILES) $(HFILES) $(TARGETSOURCES)
183
184 po/POTFILES.in: @MAINT@ Makefile
185 for f in $(POTFILES); do echo $$f; done | LC_ALL=C sort > tmp \
186 && mv tmp $(srcdir)/po/POTFILES.in
187
188 # Bootstrap test support. We use ld-new to build ld1, then use ld1 to
189 # build ld2. ld1 and ld2 should be identical. ld-new need not be
190 # identical to ld1, since it was linked with the host linker.
191
192 if GCC
193 if NATIVE_LINKER
194
195 gcctestdir1/ld: ld-new
196 test -d gcctestdir1 || mkdir -p gcctestdir1
197 rm -f gcctestdir1/ld
198 (cd gcctestdir1 && $(LN_S) ../ld-new ld)
199
200 ld1_SOURCES = $(sources_var)
201 ld1_DEPENDENCIES = $(deps_var) gcctestdir1/ld
202 ld1_LDADD = $(ldadd_var)
203 ld1_LDFLAGS = -Bgcctestdir1/
204
205 gcctestdir2/ld: ld1
206 test -d gcctestdir2 || mkdir -p gcctestdir2
207 rm -f gcctestdir2/ld
208 (cd gcctestdir2 && $(LN_S) ../ld1 ld)
209
210 ld2_SOURCES = $(sources_var)
211 ld2_DEPENDENCIES = $(deps_var) gcctestdir2/ld
212 ld2_LDADD = $(ldadd_var)
213 ld2_LDFLAGS = -Bgcctestdir2/
214
215 bootstrap-test: ld2
216 rm -f $@
217 echo "#!/bin/sh" > $@
218 echo "cmp ld1 ld2" > $@
219 chmod +x $@
220
221 libgold-1-r.o: gcctestdir1/ld libgold.a
222 gcctestdir1/ld -o $@ -r --whole-archive libgold.a
223
224 ld1_r_SOURCES = $(sources_var)
225 ld1_r_DEPENDENCIES = libgold-1-r.o $(deps_var) gcctestdir1/ld
226 ld1_r_LDADD = libgold-1-r.o $(ldadd_var)
227 ld1_r_LDFLAGS = -Bgcctestdir1/
228
229 gcctestdir2-r/ld: ld1-r
230 test -d gcctestdir2-r || mkdir -p gcctestdir2-r
231 rm -f gcctestdir2-r/ld
232 (cd gcctestdir2-r && $(LN_S) ../ld1-r ld)
233
234 libgold-2-r.o: gcctestdir2-r/ld libgold.a
235 gcctestdir2-r/ld -o $@ -r --whole-archive libgold.a
236
237 ld2_r_SOURCES = $(sources_var)
238 ld2_r_DEPENDENCIES = libgold-2-r.o $(deps_var) gcctestdir2-r/ld
239 ld2_r_LDADD = libgold-2-r.o $(ldadd_var)
240 ld2_r_LDFLAGS = -Bgcctestdir2-r/
241
242 bootstrap-test-r: ld2-r
243 rm -f $@
244 echo "#!/bin/sh" > $@
245 echo "cmp ld1-r ld2-r" > $@
246 chmod +x $@
247
248 check_PROGRAMS = ld1 ld2 ld1-r ld2-r
249 TESTS = bootstrap-test bootstrap-test-r
250
251 endif
252 endif