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