opcodes/
[external/binutils.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_CXXFLAGS = $(WARN_CXXFLAGS) $(LFS_CXXFLAGS)
12
13 INCLUDES = -D_GNU_SOURCE \
14         -I$(srcdir) -I$(srcdir)/../include -I$(srcdir)/../elfcpp \
15         -DLOCALEDIR="\"$(datadir)/locale\"" \
16         @INCINTL@
17
18 YFLAGS = -d
19
20 noinst_PROGRAMS = ld-new
21 noinst_LIBRARIES = libgold.a
22
23 CCFILES = \
24         archive.cc \
25         common.cc \
26         defstd.cc \
27         dirsearch.cc \
28         dynobj.cc \
29         fileread.cc \
30         gold.cc \
31         gold-threads.cc \
32         layout.cc \
33         object.cc \
34         options.cc \
35         output.cc \
36         readsyms.cc \
37         reloc.cc \
38         resolve.cc \
39         script.cc \
40         symtab.cc \
41         stringpool.cc \
42         target-select.cc \
43         workqueue.cc
44
45 HFILES = \
46         archive.h \
47         common.h \
48         defstd.h \
49         dirsearch.h \
50         dynobj.h \
51         fileread.h \
52         gold.h \
53         gold-threads.h \
54         layout.h \
55         object.h \
56         options.h \
57         output.h \
58         readsyms.h \
59         reloc.h \
60         reloc-types.h \
61         script.h \
62         script-c.h \
63         stringpool.h \
64         symtab.h \
65         target.h \
66         target-reloc.h \
67         target-select.h \
68         workqueue.h
69
70 TARGETFILES = \
71         i386.cc
72
73 YFILES = \
74         yyscript.y
75
76 EXTRA_DIST = yyscript.c yyscript.h
77
78 libgold_a_SOURCES = $(CCFILES) $(HFILES) $(YFILES)
79
80 ld_new_SOURCES = main.cc $(TARGETFILES)
81 ld_new_DEPENDENCIES = libgold.a $(LIBINTL_DEP)
82 ld_new_LDADD = libgold.a $(LIBINTL)
83
84 # Use an explicit dependency for the bison generated header file.
85 script.$(OBJEXT): yyscript.h
86
87 # We have to build libgold.a before we run the tests.
88 check: libgold.a
89
90 .PHONY: install-exec-local
91
92 install-exec-local: ld-new$(EXEEXT)
93         $(mkinstalldirs) $(DESTDIR)$(bindir) $(DESTDIR)$(tooldir)/bin
94         n=`echo ld | sed '$(transform)'; \
95         $(INSTALL_PROGRAM) ld-new$(EXEEXT) $(DESTDIR)$(bindir)/$${n}$(EXEEXT); \
96         if test "$(bindir)" != "$(tooldir)/bin"; then \
97           rm -f $(DESTDIR)$(tooldir)/bin/ld$(EXEEXT); \
98           ln $(DESTDIR)$(bindir)/$${n}$(EXEEXT) $(DESTDIR)$(tooldir)/bin/ld$(EXEEXT) >/dev/null 2>/dev/null \
99             || $(INSTALL_PROGRAM) ld-new$(EXEEXT) $(DESTDIR)$(tooldir)/bin/ld$(EXEEXT); \
100         fi
101
102 # We want install to imply install-info as per GNU standards, despite
103 # the cygnus option.
104 install-data-local: install-info
105
106 POTFILES= $(CCFILES) $(HFILES) $(TARGETFILES)
107
108 po/POTFILES.in: @MAINT@ Makefile
109         for f in $(POTFILES); do echo $$f; done | LC_COLLATE= sort > tmp \
110           && mv tmp $(srcdir)/po/POTFILES.in