3 ## Copyright (C) 1999-2024 Free Software Foundation, Inc.
4 ## Written by Cygnus Support.
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.
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.
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/>.
19 ## We must use 32-bit addresses to support memory bank switching.
20 ## The WORD_BITSIZE is normally 16 but must be switched (temporarily)
21 ## to 32 to avoid a bug in the sim-common which uses 'unsigned_word'
22 ## instead of 'address_word' in some places (the result is a truncation
23 ## of the 32-bit address to 16-bit; and this breaks the simulator).
25 -DWITH_TARGET_WORD_BITSIZE
=32 \
26 -DWITH_TARGET_CELL_BITSIZE
=32 \
27 -DWITH_TARGET_ADDRESS_BITSIZE
=32 \
28 -DWITH_TARGET_WORD_MSB
=31
30 nodist_
%C
%_libsim_a_SOURCES
= \
32 %C
%_libsim_a_SOURCES
= \
33 $(common_libcommon_a_SOURCES
)
34 %C
%_libsim_a_LIBADD
= \
41 $(patsubst %,%D
%/%,$(SIM_NEW_COMMON_OBJS
)) \
42 $(patsubst %,%D
%/dv-
%.o
,$(SIM_HW_DEVICES
)) \
43 $(patsubst %,%D
%/dv-
%.o
,$(%C
%_SIM_EXTRA_HW_DEVICES
)) \
45 $(%C
%_libsim_a_OBJECTS
) $(%C
%_libsim_a_LIBADD
): %D
%/hw-config.h
47 noinst_LIBRARIES
+= %D
%/libsim.a
49 ## Override wildcards that trigger common/modules.c to be (incorrectly) used.
50 %D
%/modules.o
: %D
%/modules.c
52 %D
%/%.o
: common
/%.c
; $(SIM_COMPILE
)
53 -@am__include@
%D
%/$(DEPDIR
)/*.Po
61 noinst_PROGRAMS
+= %D
%/run
63 %C
%_SIM_EXTRA_HW_DEVICES
= m68hc11 m68hc11sio m68hc11eepr m68hc11tim m68hc11spi nvram
66 %D
%/gencode
$(EXEEXT
) \
70 ## Generating modules.c requires all sources to scan.
71 %D
%/modules.c
: |
$(%C
%_BUILD_OUTPUTS
)
73 %C
%_gencode_SOURCES
= %D
%/gencode.c
75 # These rules are copied from automake, but tweaked to use FOR_BUILD variables.
76 %D
%/gencode
$(EXEEXT
): $(%C
%_gencode_OBJECTS
) $(%C
%_gencode_DEPENDENCIES
) %D
%/$(am__dirstamp
)
77 $(AM_V_CCLD
)$(LINK_FOR_BUILD
) $(%C
%_gencode_OBJECTS
) $(%C
%_gencode_LDADD
)
79 # gencode is a build-time only tool. Override the default rules for it.
80 %D
%/gencode.o
: %D
%/gencode.c
81 $(AM_V_CC
)$(COMPILE_FOR_BUILD
) -c
$< -o
$@
83 %D
%/m68hc11int.c
: %D
%/gencode
$(EXEEXT
)
84 $(AM_V_GEN
)$< -m6811
>$@
86 %D
%/m68hc12int.c
: %D
%/gencode
$(EXEEXT
)
87 $(AM_V_GEN
)$< -m6812
>$@
89 EXTRA_PROGRAMS
+= %D
%/gencode
90 MOSTLYCLEANFILES
+= $(%C
%_BUILD_OUTPUTS
)