Fix Build issues due to patch "gprofng: a new GNU profiler"
[binutils-gdb.git] / gprofng / src / Makefile.am
blobfdd95f5f7ba4fd286689bec38558d7caa4cc4b8a
1 ## Process this file with automake to generate Makefile.in
3 #   Copyright (C) 2021 Free Software Foundation, Inc.
5 # This file is free software; you can redistribute it and/or modify
6 # it under the terms of the GNU General Public License as published by
7 # the Free Software Foundation; either version 3 of the License, or
8 # (at your option) any later version.
10 # This program is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13 # GNU General Public License for more details.
15 # You should have received a copy of the GNU General Public License
16 # along with this program; see the file COPYING3.  If not see
17 # <http://www.gnu.org/licenses/>.
19 AUTOMAKE_OPTIONS = foreign
20 ACLOCAL_AMFLAGS = -I . -I .. -I ../.. 
22 CCSOURCES = \
23         Application.cc \
24         BaseMetric.cc \
25         BaseMetricTreeNode.cc \
26         CallStack.cc \
27         CatchOutOfMemory.cc \
28         ClassFile.cc \
29         Command.cc \
30         CompCom.cc \
31         DataObject.cc \
32         DataSpace.cc \
33         Data_window.cc \
34         DataStream.cc \
35         DbeApplication.cc \
36         DbeFile.cc \
37         DbeJarFile.cc \
38         DbeLock.cc \
39         DbeSession.cc \
40         DbeThread.cc \
41         DbeView.cc \
42         DerivedMetrics.cc \
43         Disasm.cc \
44         Dwarf.cc \
45         DwarfLib.cc \
46         Elf.cc \
47         Emsg.cc \
48         Experiment.cc \
49         Exp_Layout.cc \
50         ExpGroup.cc \
51         Expression.cc \
52         FileData.cc \
53         Filter.cc \
54         FilterSet.cc \
55         Function.cc \
56         HeapMap.cc \
57         HeapData.cc \
58         HeapActivity.cc \
59         Hist_data.cc \
60         IndexObject.cc \
61         IOActivity.cc \
62         LoadObject.cc \
63         MachineModel.cc \
64         MemObject.cc \
65         MemorySpace.cc \
66         Metric.cc \
67         MetricList.cc \
68         Module.cc \
69         Ovw_data.cc \
70         PRBTree.cc \
71         PathTree.cc \
72         PreviewExp.cc \
73         Print.cc \
74         SAXParserFactory.cc \
75         Sample.cc \
76         Settings.cc \
77         SourceFile.cc \
78         Stabs.cc \
79         Stats_data.cc \
80         StringBuilder.cc \
81         Table.cc \
82         QLParser.tab.cc \
83         dbe_collctrl.cc \
84         i18n.cc \
85         parse.cc \
86         UserLabel.cc \
87         util.cc \
88         Dbe.cc \
89         $(NULL)
91 CSOURCES = \
92         dbe_hwcdrv.c \
93         dbe_hwcfuncs.c \
94         dbe_hwctable.c \
95         dbe_memmgr.c \
96         gethrtime.c \
97         $(NULL)
99 LIBGPROFNG = libgprofng.la
101 AM_CPPFLAGS = $(GPROFNG_CPPFLAGS) -DLOCALEDIR=\"@localedir@\" -I.. -I$(srcdir) \
102         -I$(srcdir)/../common \
103         -I$(srcdir)/../../include -I$(srcdir)/../../opcodes \
104         -I../../bfd -I$(srcdir)/../../bfd
105 AM_CFLAGS = $(GPROFNG_CFLAGS) $(PTHREAD_CFLAGS) \
106         $(GPROFNG_NO_FORMAT_TRUNCATION_CFLAGS) \
107         $(GPROFNG_NO_SWITCH_CFLAGS)
108 AM_CXXFLAGS = $(AM_CFLAGS)
110 man_MANS = gprofng.1 \
111         gp-archive.1 \
112         gp-collect-app.1 \
113         gp-display-src.1 \
114         gp-display-text.1
116 MAINTAINERCLEANFILES = $(man_MANS)
118 EXTRA_DIST = $(man_MANS)
121 lib_LTLIBRARIES = $(LIBGPROFNG)
122 libgprofng_la_SOURCES = $(CCSOURCES) $(CSOURCES)
123 libgprofng_la_LDFLAGS = -version-info 0:0:0
124 libgprofng_la_LIBADD = $(top_builddir)/../opcodes/libopcodes.la \
125         $(top_builddir)/../bfd/libbfd.la \
126         $(GPROFNG_LIBADD) \
127         $(PTHREAD_LIBS) -ldl
129 dbedir = $(prefix)/etc
130 dbe_DATA = $(srcdir)/gprofng.rc
133 bin_PROGRAMS = gp-archive gp-collect-app gprofng gp-display-text gp-display-src
135 gp_archive_SOURCES = gp-archive.cc ArchiveExp.cc
136 gp_archive_LDADD = $(LIBGPROFNG) $(CLOCK_GETTIME_LINK)
138 gp_collect_app_SOURCES = gp-collect-app.cc checks.cc envsets.cc count.cc
139 gp_collect_app_LDADD = $(LIBGPROFNG) $(CLOCK_GETTIME_LINK)
141 gprofng_SOURCES = gprofng.cc
142 gprofng_LDADD = $(LIBGPROFNG) $(CLOCK_GETTIME_LINK)
144 gp_display_src_SOURCES = gp-display-src.cc
145 gp_display_src_LDADD = $(LIBGPROFNG) $(CLOCK_GETTIME_LINK)
147 gp_display_text_SOURCES = gp-display-text.cc ipc.cc ipcio.cc
148 gp_display_text_LDADD = $(LIBGPROFNG) $(CLOCK_GETTIME_LINK)
151 if BUILD_MAN
153 # The man pages depend on the version number and on a help2man include file.
154 common_mandeps = $(top_srcdir)/../bfd/version.m4
156 # Use -o so that the `missing' program can infer the output file.
157 # Embolden subcommand names in the output, and include a SEE ALSO.
158 # Arrange to regenerate the output if we have help2man, but leave the
159 # disted output there otherwise.
160 # Some extra annoying complexity is in place so that people without
161 # help2man dno't accidentally overwrite the manpage.
163 INFO_PAGE            = "gprofng"
164 MANUAL               = "User Commands"
165 TEXT_GPROFNG         = "the driver for the gprofng tool suite"
166 TEXT_GP_ARCHIVE      = "archive gprofng experiment data"
167 TEXT_GP_COLLECT_APP  = "collect performance data for the target application"
168 TEXT_GP_DISPLAY_SRC  = "display the source code, optionally interleaved with the disassembly of the target object"
169 TEXT_GP_DISPLAY_TEXT = "display the performance data in plain text format"
171 HELP2MAN_OPT = --libtool --no-info --info-page=$(INFO_PAGE) --manual=$(MANUAL)
172 H2M_FILTER = | sed 's/\.TP/\.TP\n.B/' | sed 's/Commands:/\.SH COMMANDS/' \
173   | sed 's/See also:/\.SH SEE ALSO/' | sed 's/Documentation:/.SH DOCUMENTATION/' \
174   | sed 's/Limitations:/.SH LIMITATIONS/'
176 gprofng.1: $(srcdir)/gprofng.cc $(common_mandeps) | ./gprofng$(EXEEXT)
177         $(AM_V_GEN)_BUILDING_MANPAGE=1 $(HELP2MAN) $(HELP2MAN_OPT) \
178           --name=$(TEXT_GPROFNG) ./gprofng$(EXEEXT) $(H2M_FILTER) > $@
180 gp-archive.1: $(srcdir)/gp-archive.cc $(common_mandeps) | ./gp-archive$(EXEEXT)
181         $(AM_V_GEN)_BUILDING_MANPAGE=1 $(HELP2MAN) $(HELP2MAN_OPT) \
182           --name=$(TEXT_GP_ARCHIVE) ./gp-archive$(EXEEXT) $(H2M_FILTER) > $@
184 gp-collect-app.1: $(srcdir)/gp-collect-app.cc $(common_mandeps) | ./gp-collect-app$(EXEEXT)
185         $(AM_V_GEN)_BUILDING_MANPAGE=1 $(HELP2MAN) $(HELP2MAN_OPT) \
186           --name=$(TEXT_GP_COLLECT_APP) ./gp-collect-app$(EXEEXT) $(H2M_FILTER) > $@
188 gp-display-src.1: $(srcdir)/gp-display-src.cc $(srcdir)/Command.cc \
189                 $(common_mandeps) | ./gp-display-src$(EXEEXT)
190         $(AM_V_GEN)_BUILDING_MANPAGE=1 $(HELP2MAN) $(HELP2MAN_OPT) \
191           --name=$(TEXT_GP_DISPLAY_SRC) ./gp-display-src$(EXEEXT) $(H2M_FILTER) > $@
193 gp-display-text.1: $(srcdir)/gp-display-text.cc $(srcdir)/Command.cc \
194                 $(common_mandeps) | ./gp-display-text$(EXEEXT)
195         $(AM_V_GEN)_BUILDING_MANPAGE=1 $(HELP2MAN) $(HELP2MAN_OPT) \
196           --name=$(TEXT_GP_DISPLAY_TEXT) ./gp-display-text$(EXEEXT) $(H2M_FILTER) > $@
198 endif
200 # Distribution involves building the binaries to generate the manpage,
201 # so ensure that the necessary libraries are built at dist time.
202 dist-hook: $(LIBGPROFNG)