1 # Process this file with "automake --cygnus Makefile" to generate Makefile.in
3 AUTOMAKE_OPTIONS = 1.9 cygnus
5 SUBDIRS = doc testsuite
7 GUILE = "`if test -f ../guile/libguile/guile ; then echo ../guile/libguile/guile; else echo guile ; fi`" -l $(srcdir)/guile.scm -s
10 ARCHFILE = $(srcroot)/cpu/$(ARCH).cpu
12 # for various utility rules
16 # file generation options
20 INSN_FILE_NAME = $(ARCH)-insn.html
22 srcroot = $(srcdir)/..
24 # Applications depend on stamp-cgen to tell them when .scm files have
25 # been changed (so files need to be regenerated).
26 # ??? Application specific files are kept with cgen for now, but may
27 # eventually go with the app. stamp-cgen might still be useful to track
28 # app-independent files.
32 stamp-cgen: $(CGENFILES)
34 echo timestamp > stamp-cgen
36 # Phony targets to run each of the applications,
37 # though most of these are for development purposes only.
38 # When actually building the toolchain, the Makefile in the appropriate
39 # directory will run cgen.
41 # NOTE: If running for a cpu other than the configured one you may wish to
42 # override ISAS and MACHS.
44 # Build the basic description support.
45 # We just stuff them in tmp-* files.
46 # Usage: make desc [ARCH=<arch>] [ARCHFILE=<arch-file>] OPTIONS="<option list>"
48 # -O tmp-opc.h -P tmp-opc.c -OPC $(dirname ${archfile})/${arch}.opc
52 rm -f tmp-desc.h tmp-desc.c
53 $(GUILE) $(srcdir)/cgen-opc.scm \
60 -H tmp-desc.h -C tmp-desc.c
61 $(SHELL) $(srcroot)/move-if-change tmp-desc.h $(ARCH)-desc.h
62 $(SHELL) $(srcroot)/move-if-change tmp-desc.c $(ARCH)-desc.c
64 # Build the machine generated cpu documentation.
65 # Usage: make html [ARCH=<arch>] [ARCHFILE=<arch-file>]
67 html: desc.scm html.scm cgen-doc.scm
69 $(GUILE) $(srcdir)/cgen-doc.scm \
76 -N $(INSN_FILE_NAME) \
79 $(SHELL) $(srcroot)/move-if-change tmp.html $(ARCH).html
80 $(SHELL) $(srcroot)/move-if-change tmp-insn.html $(ARCH)-insn.html
82 # Build the opcodes files.
83 # We just stuff them in tmp-* files.
84 # Usage: make opcodes [ARCHFILE=<arch-file>] OPTIONS="<option list>"
88 rm -f tmp-opc.h tmp-itab.c
89 rm -f tmp-asm.in tmp-dis.in tmp-ibld.h tmp-ibld.in
90 $(GUILE) $(srcdir)/cgen-opc.scm \
93 -f "$(OPTIONS) opinst" \
97 -O tmp-opc.h -P tmp-opc.c -Q tmp-opinst.c \
98 -B tmp-ibld.h -L tmp-ibld.in \
99 -A tmp-asm.in -D tmp-dis.in
101 # Build the simulator files.
102 # We just stuff them in tmp-* files.
103 # Usage: make sim-arch [ARCHFILE=<arch-file>] OPTIONS="<option list>"
104 # make sim-cpu [ARCHFILE=<arch-file>] ISAS="<isa>" MACHS="<mach list>" \
105 # OPTIONS="<option list>"
107 .PHONY: sim-arch sim-cpu
109 rm -f tmp-arch.h tmp-arch.c tmp-cpuall.h
110 $(GUILE) $(srcdir)/cgen-sim.scm \
117 -A tmp-arch.h -B tmp-arch.c -N tmp-cpuall.h
119 rm -f tmp-cpu.h tmp-cpu.c tmp-decode.h tmp-decode.c
120 rm -f tmp-model.c tmp-sem.c tmp-sem-switch.c
121 $(GUILE) $(srcdir)/cgen-sim.scm \
128 -C tmp-cpu.h -U tmp-cpu.c \
129 -T tmp-decode.h -D tmp-decode.c \
131 -S tmp-semantics.c -X tmp-sem-switch.c
133 # Build GAS testcase generator.
134 # Usage: make gas-test [ARCHFILE=<arch-file>]
137 gas-test: gas-test.scm cgen-gas.scm
138 @if test -z "$(ISAS)" ; then \
139 echo "ISAS not specified!" ;\
142 $(GUILE) $(srcdir)/cgen-gas.scm \
151 # Build simulator testcase generator.
152 # Usage: make sim-test [ARCHFILE=<arch-file>]
155 sim-test: sim-test.scm cgen-stest.scm
156 @if test -z "$(ISAS)" ; then \
157 echo "ISAS not specified!" ;\
160 $(GUILE) $(srcdir)/cgen-stest.scm \