binutils-gdb/gprofng/testsuite/gprofng.display/synprog/Makefile
Jan Beulich ecb828308c gprofng/testsuite: adjust linking of synprog
In order for so_syn.so and so_syx.so to be able to access the main
program's "testtime" variable, that variable needs exposing in the
dynamic symbol table. Since this is a test program only, do it the brute
force way and simply expose all global symbols.
2022-12-19 09:23:34 +01:00

67 lines
1.8 KiB
Makefile

# Copyright (C) 2021 Free Software Foundation, Inc.
#
# This file is part of the GNU Binutils.
#
# This file is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
# MA 02110-1301, USA.
TARGETS = synprog so_syn.so so_syx.so
TARGET = ./synprog
ACCT_FILE = synprog.acct
srcdir = .
include $(srcdir)/../../lib/Makefile.skel
SRCS = \
$(srcdir)/../mttest/gethrtime.c \
$(srcdir)/synprog.c \
$(srcdir)/callso.c \
$(srcdir)/callsx.c \
$(srcdir)/endcases.c \
$(srcdir)/fitos.c \
$(srcdir)/iosyn.c \
$(srcdir)/pagethrash.c \
$(srcdir)/stopwatch.c \
$(NULL)
HDRS= \
$(srcdir)/inc_body.h \
$(srcdir)/inc_brace.h \
$(srcdir)/inc_entry.h \
$(srcdir)/inc_exit.h \
$(srcdir)/inc_func.h \
$(srcdir)/inc_inline.h \
$(srcdir)/inc_macro.h \
$(srcdir)/stopwatch.h \
$(NULL)
$(TARGET): $(SRCS) $(HDRS) so_syx.so so_syn.so
@echo " ---- Build: $@ -----"
$(CC) $(CFLAGS) -Wl,-E -o $@ $(SRCS) -ldl -lc -lrt
so_syx.so: $(srcdir)/so_syx.c
@echo " ---- Build: $@ -----"
$(CC) $(CFLAGS) $(SHAREDOPT) -o $@ $(srcdir)/so_syx.c -lc
so_syn.so: $(srcdir)/so_syn.c
@echo " ---- Build: $@ -----"
$(CC) $(CFLAGS) $(SHAREDOPT) -o $@ $(srcdir)/so_syn.c -lc
$(EXPERIMENT): $(TARGETS)
rm -rf $@
$(COLLECT) $(COLLECT_FLAGS) -o $@ $(TARGET) $(TARGET_FLAGS)