Commit | Line | Data |
---|---|---|
cbb38b47 | 1 | # Makefile template for Configure for the SH64 simulator |
61baf725 | 2 | # Copyright (C) 2000-2017 Free Software Foundation, Inc. |
cbb38b47 BE |
3 | # Contributed by Red Hat, 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 | |
4744ac1b | 7 | # the Free Software Foundation; either version 3 of the License, or |
cbb38b47 BE |
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 | # | |
4744ac1b JB |
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/>. | |
cbb38b47 BE |
17 | |
18 | ## COMMON_PRE_CONFIG_FRAG | |
19 | ||
20 | SH64_OBJS = sh64.o cpu.o sh-desc.o \ | |
21 | decode-compact.o sem-compact.o mloop-compact.o \ | |
22 | decode-media.o sem-media.o mloop-media.o | |
23 | ||
cbb38b47 BE |
24 | SIM_OBJS = \ |
25 | $(SIM_NEW_COMMON_OBJS) \ | |
cbb38b47 | 26 | cgen-utils.o cgen-trace.o cgen-scache.o \ |
797eee42 | 27 | cgen-run.o \ |
cbb38b47 | 28 | sim-if.o arch.o \ |
8a863336 | 29 | $(SH64_OBJS) |
cbb38b47 BE |
30 | |
31 | # Extra headers included by sim-main.h. | |
32 | SIM_EXTRA_DEPS = \ | |
33 | $(CGEN_INCLUDE_DEPS) \ | |
62d08856 | 34 | arch.h cpuall.h sh64-sim.h sh-desc.h sh-opc.h |
cbb38b47 BE |
35 | |
36 | SIM_EXTRA_CFLAGS = | |
37 | ||
cbb38b47 BE |
38 | SIM_EXTRA_CLEAN = sh64-clean |
39 | ||
40 | ## COMMON_POST_CONFIG_FRAG | |
41 | ||
42 | arch = sh | |
43 | ||
44 | sim-if.o: sim-if.c $(SIM_MAIN_DEPS) $(srcdir)/../common/sim-core.h | |
45 | ||
46 | arch.o: arch.c $(SIM_MAIN_DEPS) | |
47 | ||
62d08856 DE |
48 | sh-desc.o: sh-desc.c $(SIM_MAIN_DEPS) |
49 | ||
cbb38b47 BE |
50 | devices.o: devices.c $(SIM_MAIN_DEPS) |
51 | ||
52 | # SH64 objs | |
53 | ||
54 | SH64_INCLUDE_DEPS = \ | |
55 | $(CGEN_MAIN_CPU_DEPS) \ | |
56 | cpu.h decode.h \ | |
57 | decode-compact.h eng-compact.h defs-compact.h \ | |
58 | decode-media.h eng-media.h defs-media.h | |
59 | ||
60 | sh64.o: sh64.c $(SH64_INCLUDE_DEPS) | |
61 | ||
62 | mloop-compact.o: mloop-compact.c sem-compact-switch.c $(SH64_INCLUDE_DEPS) | |
63 | $(CC) -c $(srcdir)/mloop-compact.c $(ALL_CFLAGS) -DWANT_ISA_COMPACT | |
64 | ||
65 | mloop-media.o: mloop-media.c sem-media-switch.c $(SH64_INCLUDE_DEPS) | |
66 | $(CC) -c $(srcdir)/mloop-media.c $(ALL_CFLAGS) -DWANT_ISA_MEDIA | |
67 | ||
62d08856 | 68 | cpu.o: $(srcdir)/cpu.c $(SH64_INCLUDE_DEPS) |
cbb38b47 BE |
69 | |
70 | decode-compact.o: decode-compact.c $(SH64_INCLUDE_DEPS) | |
71 | $(CC) -c $(srcdir)/decode-compact.c $(ALL_CFLAGS) -DWANT_ISA_COMPACT | |
72 | ||
73 | sem-compact.o: sem-compact.c $(SH64_INCLUDE_DEPS) | |
74 | $(CC) -c $(srcdir)/sem-compact.c $(ALL_CFLAGS) -DWANT_ISA_COMPACT | |
75 | ||
76 | decode-media.o: decode-media.c $(SH64_INCLUDE_DEPS) | |
77 | $(CC) -c $(srcdir)/decode-media.c $(ALL_CFLAGS) -DWANT_ISA_MEDIA | |
78 | ||
79 | sem-media.o: sem-media.c $(SH64_INCLUDE_DEPS) | |
80 | $(CC) -c $(srcdir)/sem-media.c $(ALL_CFLAGS) -DWANT_ISA_MEDIA | |
81 | ||
82 | sh64-clean: | |
83 | rm -f tmp-* | |
84 | rm -f stamp-defs-{compact,media} | |
85 | rm -f stamp-arch stamp-desc stamp-cpu stamp-decode-{compact,media} | |
86 | ||
87 | # cgen support, enable with --enable-cgen-maint | |
88 | CGEN_MAINT = ; @true | |
89 | # The following line is commented in or out depending upon --enable-cgen-maint. | |
90 | @CGEN_MAINT@CGEN_MAINT = | |
91 | ||
62d08856 | 92 | # Utility rules for humans. |
cbb38b47 | 93 | .PHONY: stamp-all stamp-decode stamp-defs |
cbb38b47 BE |
94 | stamp-all: stamp-arch stamp-desc stamp-cpu stamp-decode stamp-defs |
95 | stamp-decode: stamp-decode-compact stamp-decode-media | |
96 | stamp-defs: stamp-defs-compact stamp-defs-media | |
97 | ||
62d08856 DE |
98 | # NOTE: Generated source files are specified as full paths, |
99 | # e.g. $(srcdir)/arch.c, because make may decide the files live | |
100 | # in objdir otherwise. | |
101 | ||
c7e628df DB |
102 | stamp-arch: $(CGEN_READ_SCM) $(CGEN_ARCH_SCM) $(CGEN_CPU_DIR)/sh.cpu $(CGEN_CPU_DIR)/sh.opc $(CGEN_CPU_DIR)/sh64-media.cpu $(CGEN_CPU_DIR)/sh64-compact.cpu $(CGEN_CPU_DIR)/sh-sim.cpu Makefile |
103 | $(MAKE) cgen-arch $(CGEN_FLAGS_TO_PASS) mach=all isa=compact,media archfile=$(CGEN_CPU_DIR)/sh.cpu \ | |
cbb38b47 BE |
104 | FLAGS="with-scache" |
105 | touch $@ | |
62d08856 | 106 | $(srcdir)/arch.h $(srcdir)/arch.c $(srcdir)/cpuall.h: $(CGEN_MAINT) stamp-arch |
cbb38b47 BE |
107 | @true |
108 | ||
c7e628df DB |
109 | stamp-desc: $(CGEN_READ_SCM) $(CGEN_CPU_SCM) $(CGEN_CPU_DIR)/sh.cpu $(CGEN_CPU_DIR)/sh.opc $(CGEN_CPU_DIR)/sh64-compact.cpu $(CGEN_CPU_DIR)/sh64-media.cpu $(CGEN_CPU_DIR)/sh-sim.cpu Makefile |
110 | $(MAKE) cgen-desc $(CGEN_FLAGS_TO_PASS) cpu=sh64 mach=all isa=compact,media archfile=$(CGEN_CPU_DIR)/sh.cpu | |
cbb38b47 | 111 | touch $@ |
62d08856 | 112 | $(srcdir)/sh-desc.h $(srcdir)/sh-desc.c $(srcdir)/sh-opc.h: $(CGEN_MAINT) stamp-desc |
cbb38b47 BE |
113 | @true |
114 | ||
c7e628df | 115 | stamp-cpu: $(CGEN_READ_SCM) $(CGEN_CPU_SCM) $(CGEN_CPU_DIR)/sh.cpu $(CGEN_CPU_DIR)/sh.opc $(CGEN_CPU_DIR)/sh64-compact.cpu $(CGEN_CPU_DIR)/sh64-media.cpu $(CGEN_CPU_DIR)/sh-sim.cpu Makefile |
cbb38b47 | 116 | $(MAKE) cgen-cpu $(CGEN_FLAGS_TO_PASS) \ |
c7e628df | 117 | cpu=sh64 mach=sh4,sh5 isa=compact,media FLAGS="with-multiple-isa with-scache" archfile=$(CGEN_CPU_DIR)/sh.cpu |
cbb38b47 BE |
118 | rm -f $(srcdir)/model.c |
119 | touch $@ | |
62d08856 | 120 | $(srcdir)/cpu.h $(srcdir)/cpu.c: $(CGEN_MAINT) stamp-cpu |
cbb38b47 BE |
121 | @true |
122 | ||
c7e628df | 123 | stamp-defs-compact: $(CGEN_READ_SCM) $(CGEN_CPU_SCM) $(CGEN_CPU_DIR)/sh.cpu $(CGEN_CPU_DIR)/sh.opc $(CGEN_CPU_DIR)/sh64-compact.cpu $(CGEN_CPU_DIR)/sh-sim.cpu Makefile |
cbb38b47 | 124 | $(MAKE) cgen-defs $(CGEN_FLAGS_TO_PASS) \ |
c7e628df | 125 | cpu=sh64 mach=sh5 isa=compact FLAGS="with-scache" SUFFIX="-compact" archfile=$(CGEN_CPU_DIR)/sh.cpu |
cbb38b47 | 126 | touch $@ |
62d08856 | 127 | $(srcdir)/defs-compact.h: $(CGEN_MAINT) stamp-defs-compact |
cbb38b47 BE |
128 | @true |
129 | ||
c7e628df | 130 | stamp-defs-media: $(CGEN_READ_SCM) $(CGEN_CPU_SCM) $(CGEN_CPU_DIR)/sh.cpu $(CGEN_CPU_DIR)/sh.opc $(CGEN_CPU_DIR)/sh64-media.cpu $(CGEN_CPU_DIR)/sh-sim.cpu Makefile |
cbb38b47 | 131 | $(MAKE) cgen-defs $(CGEN_FLAGS_TO_PASS) \ |
c7e628df | 132 | cpu=sh64 mach=sh5 isa=media FLAGS="with-scache" SUFFIX="-media" archfile=$(CGEN_CPU_DIR)/sh.cpu |
cbb38b47 | 133 | touch $@ |
62d08856 | 134 | $(srcdir)/defs-media.h: $(CGEN_MAINT) stamp-defs-media |
cbb38b47 | 135 | |
c7e628df | 136 | stamp-decode-compact: $(CGEN_READ_SCM) $(CGEN_CPU_SCM) $(CGEN_DECODE_SCM) $(CGEN_CPU_DIR)/sh.cpu $(CGEN_CPU_DIR)/sh.opc $(CGEN_CPU_DIR)/sh64-compact.cpu $(CGEN_CPU_DIR)/sh-sim.cpu Makefile |
cbb38b47 | 137 | $(MAKE) cgen-decode $(CGEN_FLAGS_TO_PASS) \ |
c7e628df DB |
138 | cpu=sh64 mach=sh5 isa=compact FLAGS="with-scache" SUFFIX="-compact" EXTRAFILES="$(CGEN_CPU_SEM) $(CGEN_CPU_SEMSW)" \ |
139 | archfile=$(CGEN_CPU_DIR)/sh.cpu | |
cbb38b47 | 140 | touch $@ |
62d08856 | 141 | $(srcdir)/sem-compact.c $(srcdir)/sem-compact-switch.c $(srcdir)/decode-compact.c $(srcdir)/decode-compact.h: $(CGEN_MAINT) stamp-decode-compact |
cbb38b47 BE |
142 | @true |
143 | ||
c7e628df | 144 | stamp-decode-media: $(CGEN_READ_SCM) $(CGEN_CPU_SCM) $(CGEN_DECODE_SCM) $(CGEN_CPU_DIR)/sh.cpu $(CGEN_CPU_DIR)/sh.opc $(CGEN_CPU_DIR)/sh64-media.cpu $(CGEN_CPU_DIR)/sh-sim.cpu Makefile |
cbb38b47 | 145 | $(MAKE) cgen-decode $(CGEN_FLAGS_TO_PASS) \ |
c7e628df DB |
146 | cpu=sh64 mach=sh5 isa=media FLAGS="with-scache" SUFFIX="-media" EXTRAFILES="$(CGEN_CPU_SEM) $(CGEN_CPU_SEMSW)" \ |
147 | archfile=$(CGEN_CPU_DIR)/sh.cpu | |
cbb38b47 | 148 | touch $@ |
62d08856 | 149 | $(srcdir)/sem-media.c $(srcdir)/sem-media-switch.c $(srcdir)/decode-media.c $(srcdir)/decode-media.h: $(CGEN_MAINT) stamp-decode-media |
cbb38b47 | 150 | @true |