]>
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 \ |
ead1e424 | 33 | common.cc \ |
9a0910c3 | 34 | compressed_output.cc \ |
ead1e424 | 35 | defstd.cc \ |
bae7f79e | 36 | dirsearch.cc \ |
dbe717ef | 37 | dynobj.cc \ |
5c2c6c95 | 38 | dwarf_reader.cc \ |
3151305a | 39 | ehframe.cc \ |
75f2446e | 40 | errors.cc \ |
e5756efb | 41 | expression.cc \ |
bae7f79e ILT |
42 | fileread.cc \ |
43 | gold.cc \ | |
44 | gold-threads.cc \ | |
a2fb1b05 | 45 | layout.cc \ |
b8e6aad9 | 46 | merge.cc \ |
bae7f79e ILT |
47 | object.cc \ |
48 | options.cc \ | |
a2fb1b05 | 49 | output.cc \ |
7e1edb90 | 50 | parameters.cc \ |
bae7f79e | 51 | readsyms.cc \ |
61ba1cf9 | 52 | reloc.cc \ |
14bfc3f5 | 53 | resolve.cc \ |
494e05f4 | 54 | script-sections.cc \ |
dbe717ef | 55 | script.cc \ |
14bfc3f5 | 56 | stringpool.cc \ |
c92003e0 | 57 | symtab.cc \ |
14bfc3f5 | 58 | target-select.cc \ |
8486ee48 | 59 | version.cc \ |
c7912668 ILT |
60 | workqueue.cc \ |
61 | workqueue-threads.cc | |
bae7f79e ILT |
62 | |
63 | HFILES = \ | |
61ba1cf9 | 64 | archive.h \ |
ead1e424 | 65 | common.h \ |
9a0910c3 | 66 | compressed_output.h \ |
ead1e424 | 67 | defstd.h \ |
bae7f79e | 68 | dirsearch.h \ |
dbe717ef | 69 | dynobj.h \ |
5c2c6c95 | 70 | dwarf_reader.h \ |
3151305a | 71 | ehframe.h \ |
75f2446e | 72 | errors.h \ |
bae7f79e ILT |
73 | fileread.h \ |
74 | gold.h \ | |
75 | gold-threads.h \ | |
a2fb1b05 | 76 | layout.h \ |
b8e6aad9 | 77 | merge.h \ |
bae7f79e ILT |
78 | object.h \ |
79 | options.h \ | |
a2fb1b05 | 80 | output.h \ |
7e1edb90 | 81 | parameters.h \ |
bae7f79e | 82 | readsyms.h \ |
61ba1cf9 | 83 | reloc.h \ |
c06b7b0b | 84 | reloc-types.h \ |
c06b7b0b | 85 | script-c.h \ |
494e05f4 ILT |
86 | script-sections.h \ |
87 | script.h \ | |
14bfc3f5 | 88 | stringpool.h \ |
bae7f79e ILT |
89 | symtab.h \ |
90 | target.h \ | |
61ba1cf9 | 91 | target-reloc.h \ |
14bfc3f5 | 92 | target-select.h \ |
af6359d5 | 93 | tls.h \ |
17a1d0a9 | 94 | token.h \ |
c7912668 ILT |
95 | workqueue.h \ |
96 | workqueue-internal.h | |
bae7f79e | 97 | |
dbe717ef ILT |
98 | YFILES = \ |
99 | yyscript.y | |
100 | ||
101 | EXTRA_DIST = yyscript.c yyscript.h | |
bae7f79e | 102 | |
6df6da4a | 103 | TARGETSOURCES = \ |
2e30d253 | 104 | i386.cc x86_64.cc |
6df6da4a ILT |
105 | |
106 | ALL_TARGETOBJS = \ | |
2e30d253 | 107 | i386.$(OBJEXT) x86_64.$(OBJEXT) |
6df6da4a | 108 | |
5a6f7e2d | 109 | libgold_a_SOURCES = $(CCFILES) $(HFILES) $(YFILES) |
bae7f79e | 110 | |
6df6da4a | 111 | sources_var = main.cc |
ad2d6943 | 112 | deps_var = $(TARGETOBJS) libgold.a $(LIBIBERTY) $(LIBINTL_DEP) |
fe9a4c12 | 113 | ldadd_var = $(TARGETOBJS) libgold.a $(LIBIBERTY) $(LIBINTL) $(THREADSLIB) |
537b5f51 ILT |
114 | |
115 | ld_new_SOURCES = $(sources_var) | |
82dcae9d ILT |
116 | ld_new_DEPENDENCIES = $(deps_var) $(LIBOBJS) |
117 | ld_new_LDADD = $(ldadd_var) $(LIBOBJS) | |
bae7f79e | 118 | |
6df6da4a ILT |
119 | EXTRA_ld_new_SOURCES = $(TARGETSOURCES) |
120 | ||
dbe717ef | 121 | # Use an explicit dependency for the bison generated header file. |
7d320313 ILT |
122 | expression.$(OBJEXT): yyscript.h |
123 | script-sections.$(OBJEXT): yyscript.h | |
dbe717ef ILT |
124 | script.$(OBJEXT): yyscript.h |
125 | ||
5a6f7e2d ILT |
126 | # We have to build libgold.a before we run the tests. |
127 | check: libgold.a | |
128 | ||
bae7f79e ILT |
129 | .PHONY: install-exec-local |
130 | ||
131 | install-exec-local: ld-new$(EXEEXT) | |
132 | $(mkinstalldirs) $(DESTDIR)$(bindir) $(DESTDIR)$(tooldir)/bin | |
133 | n=`echo ld | sed '$(transform)'; \ | |
134 | $(INSTALL_PROGRAM) ld-new$(EXEEXT) $(DESTDIR)$(bindir)/$${n}$(EXEEXT); \ | |
135 | if test "$(bindir)" != "$(tooldir)/bin"; then \ | |
136 | rm -f $(DESTDIR)$(tooldir)/bin/ld$(EXEEXT); \ | |
137 | ln $(DESTDIR)$(bindir)/$${n}$(EXEEXT) $(DESTDIR)$(tooldir)/bin/ld$(EXEEXT) >/dev/null 2>/dev/null \ | |
138 | || $(INSTALL_PROGRAM) ld-new$(EXEEXT) $(DESTDIR)$(tooldir)/bin/ld$(EXEEXT); \ | |
139 | fi | |
140 | ||
141 | # We want install to imply install-info as per GNU standards, despite | |
142 | # the cygnus option. | |
143 | install-data-local: install-info | |
5a6f7e2d | 144 | |
6df6da4a | 145 | POTFILES= $(CCFILES) $(HFILES) $(TARGETSOURCES) |
5a6f7e2d ILT |
146 | |
147 | po/POTFILES.in: @MAINT@ Makefile | |
148 | for f in $(POTFILES); do echo $$f; done | LC_COLLATE= sort > tmp \ | |
149 | && mv tmp $(srcdir)/po/POTFILES.in | |
537b5f51 ILT |
150 | |
151 | # Bootstrap test support. We use ld-new to build ld1, then use ld1 to | |
152 | # build ld2. ld1 and ld2 should be identical. ld-new need not be | |
153 | # identical to ld1, since it was linked with the host linker. | |
154 | ||
155 | if GCC | |
156 | if NATIVE_LINKER | |
157 | ||
158 | gcctestdir1/ld: ld-new | |
159 | test -d gcctestdir1 || mkdir -p gcctestdir1 | |
160 | rm -f gcctestdir1/ld | |
161 | (cd gcctestdir1 && $(LN_S) ../ld-new ld) | |
162 | ||
163 | ld1_SOURCES = $(sources_var) | |
164 | ld1_DEPENDENCIES = $(deps_var) gcctestdir1/ld | |
165 | ld1_LDADD = $(ldadd_var) | |
166 | ld1_LDFLAGS = -Bgcctestdir1/ | |
167 | ||
168 | gcctestdir2/ld: ld1 | |
169 | test -d gcctestdir2 || mkdir -p gcctestdir2 | |
170 | rm -f gcctestdir2/ld | |
171 | (cd gcctestdir2 && $(LN_S) ../ld1 ld) | |
172 | ||
173 | ld2_SOURCES = $(sources_var) | |
174 | ld2_DEPENDENCIES = $(deps_var) gcctestdir2/ld | |
175 | ld2_LDADD = $(ldadd_var) | |
176 | ld2_LDFLAGS = -Bgcctestdir2/ | |
177 | ||
178 | check_PROGRAMS = ld1 ld2 | |
179 | ||
180 | bootstrap-test: ld2 | |
181 | rm -f $@ | |
182 | echo "#!/bin/sh" > $@ | |
183 | echo "cmp ld1 ld2" > $@ | |
184 | chmod +x $@ | |
185 | ||
186 | TESTS = bootstrap-test | |
187 | ||
188 | endif | |
189 | endif |