]>
Commit | Line | Data |
---|---|---|
bae7f79e ILT |
1 | # Process this file with automake to generate Makefile.in |
2 | ||
3 | AUTOMAKE_OPTIONS = | |
4 | ||
5a6f7e2d | 5 | SUBDIRS = po testsuite |
bae7f79e ILT |
6 | |
7 | tooldir = $(exec_prefix)/$(target_alias) | |
8 | ||
9 | ACLOCAL_AMFLAGS = -I ../bfd -I ../config | |
10 | ||
494e05f4 ILT |
11 | AM_CFLAGS = $(WARN_CFLAGS) $(LFS_CFLAGS) |
12 | AM_CXXFLAGS = $(WARN_CXXFLAGS) $(LFS_CFLAGS) | |
bae7f79e | 13 | |
fa99aa09 | 14 | INCLUDES = \ |
bae7f79e ILT |
15 | -I$(srcdir) -I$(srcdir)/../include -I$(srcdir)/../elfcpp \ |
16 | -DLOCALEDIR="\"$(datadir)/locale\"" \ | |
ad2d6943 | 17 | -DBINDIR="\"$(bindir)\"" -DTOOLBINDIR="\"$(tooldir)/bin\"" \ |
bae7f79e ILT |
18 | @INCINTL@ |
19 | ||
ad2d6943 ILT |
20 | LIBIBERTY = ../libiberty/libiberty.a |
21 | ||
fe9a4c12 ILT |
22 | if THREADS |
23 | THREADSLIB = -lpthread | |
24 | endif | |
25 | ||
4991e922 | 26 | AM_YFLAGS = -d |
dbe717ef | 27 | |
bae7f79e | 28 | noinst_PROGRAMS = ld-new |
5a6f7e2d | 29 | noinst_LIBRARIES = libgold.a |
bae7f79e | 30 | |
14bfc3f5 | 31 | CCFILES = \ |
61ba1cf9 | 32 | archive.cc \ |
bc644c6c | 33 | binary.cc \ |
ead1e424 | 34 | common.cc \ |
9a0910c3 | 35 | compressed_output.cc \ |
ead1e424 | 36 | defstd.cc \ |
bae7f79e | 37 | dirsearch.cc \ |
dbe717ef | 38 | dynobj.cc \ |
5c2c6c95 | 39 | dwarf_reader.cc \ |
3151305a | 40 | ehframe.cc \ |
75f2446e | 41 | errors.cc \ |
e5756efb | 42 | expression.cc \ |
bae7f79e ILT |
43 | fileread.cc \ |
44 | gold.cc \ | |
45 | gold-threads.cc \ | |
a2fb1b05 | 46 | layout.cc \ |
b8e6aad9 | 47 | merge.cc \ |
bae7f79e ILT |
48 | object.cc \ |
49 | options.cc \ | |
a2fb1b05 | 50 | output.cc \ |
7e1edb90 | 51 | parameters.cc \ |
bae7f79e | 52 | readsyms.cc \ |
61ba1cf9 | 53 | reloc.cc \ |
14bfc3f5 | 54 | resolve.cc \ |
494e05f4 | 55 | script-sections.cc \ |
dbe717ef | 56 | script.cc \ |
14bfc3f5 | 57 | stringpool.cc \ |
c92003e0 | 58 | symtab.cc \ |
14bfc3f5 | 59 | target-select.cc \ |
8486ee48 | 60 | version.cc \ |
c7912668 ILT |
61 | workqueue.cc \ |
62 | workqueue-threads.cc | |
bae7f79e ILT |
63 | |
64 | HFILES = \ | |
61ba1cf9 | 65 | archive.h \ |
bc644c6c | 66 | binary.h \ |
ead1e424 | 67 | common.h \ |
9a0910c3 | 68 | compressed_output.h \ |
ead1e424 | 69 | defstd.h \ |
bae7f79e | 70 | dirsearch.h \ |
dbe717ef | 71 | dynobj.h \ |
5c2c6c95 | 72 | dwarf_reader.h \ |
3151305a | 73 | ehframe.h \ |
75f2446e | 74 | errors.h \ |
bae7f79e ILT |
75 | fileread.h \ |
76 | gold.h \ | |
77 | gold-threads.h \ | |
a2fb1b05 | 78 | layout.h \ |
b8e6aad9 | 79 | merge.h \ |
bae7f79e ILT |
80 | object.h \ |
81 | options.h \ | |
a2fb1b05 | 82 | output.h \ |
7e1edb90 | 83 | parameters.h \ |
bae7f79e | 84 | readsyms.h \ |
61ba1cf9 | 85 | reloc.h \ |
c06b7b0b | 86 | reloc-types.h \ |
c06b7b0b | 87 | script-c.h \ |
494e05f4 ILT |
88 | script-sections.h \ |
89 | script.h \ | |
14bfc3f5 | 90 | stringpool.h \ |
bae7f79e ILT |
91 | symtab.h \ |
92 | target.h \ | |
61ba1cf9 | 93 | target-reloc.h \ |
14bfc3f5 | 94 | target-select.h \ |
af6359d5 | 95 | tls.h \ |
17a1d0a9 | 96 | token.h \ |
c7912668 ILT |
97 | workqueue.h \ |
98 | workqueue-internal.h | |
bae7f79e | 99 | |
dbe717ef ILT |
100 | YFILES = \ |
101 | yyscript.y | |
102 | ||
103 | EXTRA_DIST = yyscript.c yyscript.h | |
bae7f79e | 104 | |
6df6da4a | 105 | TARGETSOURCES = \ |
f5314dd5 | 106 | i386.cc x86_64.cc sparc.cc |
6df6da4a ILT |
107 | |
108 | ALL_TARGETOBJS = \ | |
f5314dd5 | 109 | i386.$(OBJEXT) x86_64.$(OBJEXT) sparc.$(OBJEXT) |
6df6da4a | 110 | |
5a6f7e2d | 111 | libgold_a_SOURCES = $(CCFILES) $(HFILES) $(YFILES) |
bae7f79e | 112 | |
6df6da4a | 113 | sources_var = main.cc |
ad2d6943 | 114 | deps_var = $(TARGETOBJS) libgold.a $(LIBIBERTY) $(LIBINTL_DEP) |
fe9a4c12 | 115 | ldadd_var = $(TARGETOBJS) libgold.a $(LIBIBERTY) $(LIBINTL) $(THREADSLIB) |
537b5f51 ILT |
116 | |
117 | ld_new_SOURCES = $(sources_var) | |
82dcae9d ILT |
118 | ld_new_DEPENDENCIES = $(deps_var) $(LIBOBJS) |
119 | ld_new_LDADD = $(ldadd_var) $(LIBOBJS) | |
bae7f79e | 120 | |
6df6da4a ILT |
121 | EXTRA_ld_new_SOURCES = $(TARGETSOURCES) |
122 | ||
dbe717ef | 123 | # Use an explicit dependency for the bison generated header file. |
7d320313 ILT |
124 | expression.$(OBJEXT): yyscript.h |
125 | script-sections.$(OBJEXT): yyscript.h | |
dbe717ef ILT |
126 | script.$(OBJEXT): yyscript.h |
127 | ||
5a6f7e2d ILT |
128 | # We have to build libgold.a before we run the tests. |
129 | check: libgold.a | |
130 | ||
bae7f79e ILT |
131 | .PHONY: install-exec-local |
132 | ||
133 | install-exec-local: ld-new$(EXEEXT) | |
134 | $(mkinstalldirs) $(DESTDIR)$(bindir) $(DESTDIR)$(tooldir)/bin | |
56fd6e75 | 135 | n=`echo ld | sed '$(transform)'`; \ |
bae7f79e ILT |
136 | $(INSTALL_PROGRAM) ld-new$(EXEEXT) $(DESTDIR)$(bindir)/$${n}$(EXEEXT); \ |
137 | if test "$(bindir)" != "$(tooldir)/bin"; then \ | |
138 | rm -f $(DESTDIR)$(tooldir)/bin/ld$(EXEEXT); \ | |
139 | ln $(DESTDIR)$(bindir)/$${n}$(EXEEXT) $(DESTDIR)$(tooldir)/bin/ld$(EXEEXT) >/dev/null 2>/dev/null \ | |
140 | || $(INSTALL_PROGRAM) ld-new$(EXEEXT) $(DESTDIR)$(tooldir)/bin/ld$(EXEEXT); \ | |
141 | fi | |
142 | ||
143 | # We want install to imply install-info as per GNU standards, despite | |
144 | # the cygnus option. | |
145 | install-data-local: install-info | |
5a6f7e2d | 146 | |
6df6da4a | 147 | POTFILES= $(CCFILES) $(HFILES) $(TARGETSOURCES) |
5a6f7e2d ILT |
148 | |
149 | po/POTFILES.in: @MAINT@ Makefile | |
150 | for f in $(POTFILES); do echo $$f; done | LC_COLLATE= sort > tmp \ | |
151 | && mv tmp $(srcdir)/po/POTFILES.in | |
537b5f51 ILT |
152 | |
153 | # Bootstrap test support. We use ld-new to build ld1, then use ld1 to | |
154 | # build ld2. ld1 and ld2 should be identical. ld-new need not be | |
155 | # identical to ld1, since it was linked with the host linker. | |
156 | ||
157 | if GCC | |
158 | if NATIVE_LINKER | |
159 | ||
160 | gcctestdir1/ld: ld-new | |
161 | test -d gcctestdir1 || mkdir -p gcctestdir1 | |
162 | rm -f gcctestdir1/ld | |
163 | (cd gcctestdir1 && $(LN_S) ../ld-new ld) | |
164 | ||
165 | ld1_SOURCES = $(sources_var) | |
166 | ld1_DEPENDENCIES = $(deps_var) gcctestdir1/ld | |
167 | ld1_LDADD = $(ldadd_var) | |
168 | ld1_LDFLAGS = -Bgcctestdir1/ | |
169 | ||
170 | gcctestdir2/ld: ld1 | |
171 | test -d gcctestdir2 || mkdir -p gcctestdir2 | |
172 | rm -f gcctestdir2/ld | |
173 | (cd gcctestdir2 && $(LN_S) ../ld1 ld) | |
174 | ||
175 | ld2_SOURCES = $(sources_var) | |
176 | ld2_DEPENDENCIES = $(deps_var) gcctestdir2/ld | |
177 | ld2_LDADD = $(ldadd_var) | |
178 | ld2_LDFLAGS = -Bgcctestdir2/ | |
179 | ||
537b5f51 ILT |
180 | bootstrap-test: ld2 |
181 | rm -f $@ | |
182 | echo "#!/bin/sh" > $@ | |
183 | echo "cmp ld1 ld2" > $@ | |
184 | chmod +x $@ | |
185 | ||
755ab8af ILT |
186 | libgold-1-r.o: gcctestdir1/ld libgold.a |
187 | gcctestdir1/ld -o $@ -r --whole-archive libgold.a | |
188 | ||
189 | ld1_r_SOURCES = $(sources_var) | |
190 | ld1_r_DEPENDENCIES = libgold-1-r.o $(deps_var) gcctestdir1/ld | |
191 | ld1_r_LDADD = libgold-1-r.o $(ldadd_var) | |
192 | ld1_r_LDFLAGS = -Bgcctestdir1/ | |
193 | ||
194 | gcctestdir2-r/ld: ld1-r | |
195 | test -d gcctestdir2-r || mkdir -p gcctestdir2-r | |
196 | rm -f gcctestdir2-r/ld | |
197 | (cd gcctestdir2-r && $(LN_S) ../ld1-r ld) | |
198 | ||
199 | libgold-2-r.o: gcctestdir2-r/ld libgold.a | |
200 | gcctestdir2-r/ld -o $@ -r --whole-archive libgold.a | |
201 | ||
202 | ld2_r_SOURCES = $(sources_var) | |
203 | ld2_r_DEPENDENCIES = libgold-2-r.o $(deps_var) gcctestdir2-r/ld | |
204 | ld2_r_LDADD = libgold-2-r.o $(ldadd_var) | |
205 | ld2_r_LDFLAGS = -Bgcctestdir2-r/ | |
206 | ||
207 | bootstrap-test-r: ld2-r | |
208 | rm -f $@ | |
209 | echo "#!/bin/sh" > $@ | |
210 | echo "cmp ld1-r ld2-r" > $@ | |
211 | chmod +x $@ | |
212 | ||
213 | check_PROGRAMS = ld1 ld2 ld1-r ld2-r | |
214 | TESTS = bootstrap-test bootstrap-test-r | |
537b5f51 ILT |
215 | |
216 | endif | |
217 | endif |