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