1## See sim/Makefile.am.
2##
3## Copyright (C) 1997-2023 Free Software Foundation, Inc.
4##
5## This program 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.
9##
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.
14##
15## You should have received a copy of the GNU General Public License
16## along with this program.  If not, see <http://www.gnu.org/licenses/>.
17
18## Parts of the common/ sim code that have been unified.
19## Most still lives in common/Make-common.in.
20
21AM_CPPFLAGS += \
22	-I$(srcdir)/%D% \
23	-DSIM_COMMON_BUILD
24AM_CPPFLAGS_FOR_BUILD += -I$(srcdir)/%D%
25
26## This makes sure common parts are available before building the arch-subdirs
27## which will refer to these.
28SIM_ALL_RECURSIVE_DEPS += \
29	%D%/libcommon.a
30
31## NB: libcommon.a isn't used directly by ports.  We need a target for common
32## objects to be a part of, and ports use the individual objects directly.
33SIM_COMMON_LIB = %D%/libcommon.a
34noinst_LIBRARIES += $(SIM_COMMON_LIB)
35%C%_libcommon_a_SOURCES = \
36	%D%/callback.c \
37	%D%/portability.c \
38	%D%/sim-load.c \
39	%D%/syscall.c \
40	%D%/target-newlib-errno.c \
41	%D%/target-newlib-open.c \
42	%D%/target-newlib-signal.c \
43	%D%/target-newlib-syscall.c \
44	%D%/version.c
45
46%D%/version.c: %D%/version.c-stamp ; @true
47%D%/version.c-stamp: $(srcroot)/gdb/version.in $(srcroot)/bfd/version.h $(srcdir)/%D%/create-version.sh
48	$(AM_V_GEN)$(SHELL) $(srcdir)/%D%/create-version.sh $(srcroot)/gdb $@.tmp
49	$(AM_V_at)$(SHELL) $(srcroot)/move-if-change $@.tmp $(@:-stamp=)
50	$(AM_V_at)touch $@
51
52CLEANFILES += \
53	%D%/version.c %D%/version.c-stamp
54
55##
56## For subdirs.
57##
58
59LIBIBERTY_LIB = ../libiberty/libiberty.a
60BFD_LIB = ../bfd/libbfd.la
61OPCODES_LIB = ../opcodes/libopcodes.la
62
63SIM_COMMON_LIBS = \
64	$(SIM_COMMON_LIB) \
65	$(BFD_LIB) \
66	$(OPCODES_LIB) \
67	$(LIBIBERTY_LIB) \
68	$(LIBGNU) \
69	$(LIBGNU_EXTRA_LIBS)
70