sim: bfin: move arch-specific file compilation to top-level
[binutils-gdb.git] / sim / bfin / local.mk
1 ## See sim/Makefile.am
2 ##
3 ## Copyright (C) 2005-2023 Free Software Foundation, Inc.
4 ## Written by Analog Devices, Inc.
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 AM_CPPFLAGS_%C% = $(SDL_CFLAGS)
20
21 %C%_libsim_a_SOURCES =
22 %C%_libsim_a_LIBADD = \
23 $(common_libcommon_a_OBJECTS) \
24 $(patsubst %,%D%/%,$(SIM_NEW_COMMON_OBJS)) \
25 $(patsubst %,%D%/dv-%.o,$(SIM_HW_DEVICES)) \
26 $(patsubst %,%D%/dv-%.o,$(%C%_SIM_EXTRA_HW_DEVICES)) \
27 %D%/bfin-sim.o \
28 %D%/devices.o \
29 %D%/gui.o \
30 %D%/interp.o \
31 %D%/machs.o \
32 %D%/modules.o \
33 %D%/sim-resume.o
34 $(%C%_libsim_a_OBJECTS) $(%C%_libsim_a_LIBADD): %D%/hw-config.h
35
36 noinst_LIBRARIES += %D%/libsim.a
37
38 %D%/%.o: common/%.c
39 $(AM_V_at)$(MAKE) $(AM_MAKEFLAGS) -C $(@D) $(@F)
40
41 %C%_run_SOURCES =
42 %C%_run_LDADD = \
43 %D%/nrun.o \
44 %D%/libsim.a \
45 $(SIM_COMMON_LIBS)
46
47 noinst_PROGRAMS += %D%/run
48
49 %C%_SIM_EXTRA_HW_DEVICES = \
50 bfin_cec \
51 bfin_ctimer \
52 bfin_dma \
53 bfin_dmac \
54 bfin_ebiu_amc \
55 bfin_ebiu_ddrc \
56 bfin_ebiu_sdc \
57 bfin_emac \
58 bfin_eppi \
59 bfin_evt \
60 bfin_gpio \
61 bfin_gpio2 \
62 bfin_gptimer \
63 bfin_jtag \
64 bfin_mmu \
65 bfin_nfc \
66 bfin_otp \
67 bfin_pfmon \
68 bfin_pint \
69 bfin_pll \
70 bfin_ppi \
71 bfin_rtc \
72 bfin_sic \
73 bfin_spi \
74 bfin_trace \
75 bfin_twi \
76 bfin_uart \
77 bfin_uart2 \
78 bfin_wdog \
79 bfin_wp \
80 eth_phy
81 AM_MAKEFLAGS += %C%_SIM_EXTRA_HW_DEVICES="$(%C%_SIM_EXTRA_HW_DEVICES)"
82
83 %D%/linux-fixed-code.h: @MAINT@ $(srcdir)/%D%/linux-fixed-code.s %D%/local.mk %D%/$(am__dirstamp)
84 $(AM_V_GEN)$(AS_FOR_TARGET_BFIN) $(srcdir)/%D%/linux-fixed-code.s -o %D%/linux-fixed-code.o
85 $(AM_V_at)(\
86 set -e; \
87 echo "/* DO NOT EDIT: Autogenerated from linux-fixed-code.s. */"; \
88 echo "static const unsigned char bfin_linux_fixed_code[] ="; \
89 echo "{"; \
90 $(OBJDUMP_FOR_TARGET_BFIN) -d -z %D%/linux-fixed-code.o > $@.dis; \
91 sed -n \
92 -e 's:^[^ ]* :0x:' \
93 -e '/^0x/{s: .*::;s: *$$:,:;s: :, 0x:g;p;}' \
94 $@.dis; \
95 rm -f $@.dis; \
96 echo "};" \
97 ) > $@.tmp
98 $(AM_V_at)$(SHELL) $(srcroot)/move-if-change $@.tmp $(srcdir)/%D%/linux-fixed-code.h
99 $(AM_V_at)touch $(srcdir)/%D%/linux-fixed-code.h