1169689Skan## See sim/Makefile.am 2132718Skan## 3132718Skan## Copyright (C) 2009-2024 Free Software Foundation, Inc. 4132718Skan## Contributed by Jon Beniston <jon@beniston.com> 5132718Skan## 6132718Skan## This program is free software; you can redistribute it and/or modify 7132718Skan## it under the terms of the GNU General Public License as published by 8132718Skan## the Free Software Foundation; either version 3 of the License, or 9132718Skan## (at your option) any later version. 10132718Skan## 11132718Skan## This program is distributed in the hope that it will be useful, 12132718Skan## but WITHOUT ANY WARRANTY; without even the implied warranty of 13132718Skan## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14132718Skan## GNU General Public License for more details. 15132718Skan## 16132718Skan## You should have received a copy of the GNU General Public License 17132718Skan## along with this program. If not, see <http://www.gnu.org/licenses/>. 18132718Skan 19132718Skannodist_%C%_libsim_a_SOURCES = \ 20169689Skan %D%/modules.c 21132718Skan%C%_libsim_a_SOURCES = \ 22132718Skan $(common_libcommon_a_SOURCES) 23132718Skan%C%_libsim_a_LIBADD = \ 24132718Skan $(patsubst %,%D%/%,$(SIM_NEW_COMMON_OBJS)) \ 25132718Skan $(patsubst %,%D%/dv-%.o,$(SIM_HW_DEVICES)) \ 26132718Skan $(patsubst %,%D%/dv-%.o,$(%C%_SIM_EXTRA_HW_DEVICES)) \ 27132718Skan \ 28132718Skan %D%/cgen-run.o \ 29132718Skan %D%/cgen-scache.o \ 30132718Skan %D%/cgen-trace.o \ 31132718Skan %D%/cgen-utils.o \ 32132718Skan \ 33132718Skan %D%/arch.o \ 34132718Skan %D%/cpu.o \ 35132718Skan %D%/decode.o \ 36132718Skan %D%/sem.o \ 37132718Skan %D%/mloop.o \ 38132718Skan %D%/model.o \ 39132718Skan \ 40132718Skan %D%/lm32.o \ 41132718Skan %D%/sim-if.o \ 42169689Skan %D%/traps.o \ 43132718Skan %D%/user.o 44132718Skan$(%C%_libsim_a_OBJECTS) $(%C%_libsim_a_LIBADD): %D%/hw-config.h 45132718Skan 46132718Skannoinst_LIBRARIES += %D%/libsim.a 47132718Skan 48132718Skan## Override wildcards that trigger common/modules.c to be (incorrectly) used. 49132718Skan%D%/modules.o: %D%/modules.c 50132718Skan 51132718Skan%D%/%.o: common/%.c ; $(SIM_COMPILE) 52132718Skan-@am__include@ %D%/$(DEPDIR)/*.Po 53132718Skan 54132718Skan%C%_run_SOURCES = 55132718Skan%C%_run_LDADD = \ 56132718Skan %D%/nrun.o \ 57132718Skan %D%/libsim.a \ 58132718Skan $(SIM_COMMON_LIBS) 59132718Skan 60132718Skannoinst_PROGRAMS += %D%/run 61132718Skan 62132718Skan%C%_SIM_EXTRA_HW_DEVICES = lm32cpu lm32timer lm32uart 63132718Skan 64132718Skan## List all generated headers to help Automake dependency tracking. 65132718SkanBUILT_SOURCES += %D%/eng.h 66132718Skan%C%_BUILD_OUTPUTS = \ 67132718Skan %D%/mloop.c \ 68132718Skan %D%/stamp-mloop 69132718Skan 70132718Skan## Generating modules.c requires all sources to scan. 71132718Skan%D%/modules.c: | $(%C%_BUILD_OUTPUTS) 72132718Skan 73132718Skan## FIXME: Use of `mono' is wip. 74132718Skan%D%/mloop.c %D%/eng.h: %D%/stamp-mloop ; @true 75132718Skan%D%/stamp-mloop: %D%/mloop.in $(srccom)/genmloop.sh 76132718Skan $(AM_V_GEN)$(CGEN_GEN_MLOOP) \ 77132718Skan -mono -fast -pbb -switch sem-switch.c \ 78132718Skan -cpu lm32bf 79132718Skan $(AM_V_at)$(SHELL) $(srcroot)/move-if-change %D%/eng.hin %D%/eng.h 80132718Skan $(AM_V_at)$(SHELL) $(srcroot)/move-if-change %D%/mloop.cin %D%/mloop.c 81132718Skan $(AM_V_at)touch $@ 82132718Skan 83132718SkanCLEANFILES += %D%/eng.h 84132718SkanMOSTLYCLEANFILES += $(%C%_BUILD_OUTPUTS) 85132718Skan 86132718Skan## Target that triggers all cgen targets that works when --disable-cgen-maint. 87132718Skan%D%/cgen: %D%/cgen-arch %D%/cgen-cpu-decode 88132718Skan 89132718Skan%D%/cgen-arch: 90132718Skan $(AM_V_GEN)mach=all FLAGS="with-scache with-profile=fn"; $(CGEN_GEN_ARCH) 91132718Skan$(srcdir)/%D%/arch.h $(srcdir)/%D%/arch.c $(srcdir)/%D%/cpuall.h: @CGEN_MAINT@ %D%/cgen-arch 92132718Skan 93132718Skan%D%/cgen-cpu-decode: 94132718Skan $(AM_V_GEN)cpu=lm32bf mach=lm32 FLAGS="with-scache with-profile=fn" EXTRAFILES="$(CGEN_CPU_SEM) $(CGEN_CPU_SEMSW)"; $(CGEN_GEN_CPU_DECODE) 95132718Skan$(srcdir)/%D%/cpu.h $(srcdir)/%D%/sem.c $(srcdir)/%D%/sem-switch.c $(srcdir)/%D%/model.c $(srcdir)/%D%/decode.c $(srcdir)/%D%/decode.h: @CGEN_MAINT@ %D%/cgen-cpu-decode 96132718Skan