813bdc895339621b0c7a75791f4a5323afbdb9a0
[binutils-gdb.git] / sim / moxie / local.mk
1 ## See sim/Makefile.am
2 ##
3 ## Copyright (C) 2008-2023 Free Software Foundation, Inc.
4 ## Written by Anthony Green
5 ##
6 ## This program is free software; you can redistribute it and/or modify
7 ## it under the terms of the GNU General Public License as published by
8 ## the Free Software Foundation; either version 3 of the License, or
9 ## (at your option) any later version.
10 ##
11 ## This program is distributed in the hope that it will be useful,
12 ## but WITHOUT ANY WARRANTY; without even the implied warranty of
13 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 ## GNU General Public License for more details.
15 ##
16 ## You should have received a copy of the GNU General Public License
17 ## along with this program. If not, see <http://www.gnu.org/licenses/>.
18
19 %C%_libsim_a_SOURCES =
20 %C%_libsim_a_LIBADD = \
21 $(common_libcommon_a_OBJECTS) \
22 $(patsubst %,%D%/%,$(SIM_NEW_COMMON_OBJS)) \
23 $(patsubst %,%D%/dv-%.o,$(SIM_HW_DEVICES)) \
24 %D%/interp.o \
25 %D%/modules.o \
26 %D%/sim-resume.o
27 $(%C%_libsim_a_OBJECTS) $(%C%_libsim_a_LIBADD): %D%/hw-config.h
28
29 noinst_LIBRARIES += %D%/libsim.a
30
31 %D%/%.o: %D%/%.c
32 $(AM_V_at)$(MAKE) $(AM_MAKEFLAGS) -C $(@D) $(@F)
33
34 %D%/%.o: common/%.c
35 $(AM_V_at)$(MAKE) $(AM_MAKEFLAGS) -C $(@D) $(@F)
36
37 %C%_run_SOURCES =
38 %C%_run_LDADD = \
39 %D%/nrun.o \
40 %D%/libsim.a \
41 $(SIM_COMMON_LIBS)
42
43 noinst_PROGRAMS += %D%/run
44
45 dtbdir = $(datadir)/gdb/dtb
46
47 dtb_DATA = %D%/moxie-gdb.dtb
48
49 %D%/moxie-gdb.dtb: @MAINT@ %D%/moxie-gdb.dts %D%/$(am__dirstamp)
50 $(AM_V_GEN) \
51 if test "x$(DTC)" != x; then \
52 $(DTC) -O dtb -o $@.tmp ${srcdir}/%D%/moxie-gdb.dts || exit 1; \
53 $(SHELL) $(srcroot)/move-if-change $@.tmp ${srcdir}/%D%/moxie-gdb.dtb || exit 1; \
54 touch ${srcdir}/%D%/moxie-gdb.dtb; \
55 else \
56 echo "Could not update the moxie-gdb.dtb file because the device "; \
57 echo "tree compiler tool (dtc) is missing. Install the tool to "; \
58 echo "update the device tree blob."; \
59 fi