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