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 ../..
25 BaseMetricTreeNode.cc \
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 \
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 \
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)
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) > $@
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)