OSDN Git Service

Updated Russian translation.
[pf3gnuchains/pf3gnuchains3x.git] / cgen / Makefile.am
1 # Process this file with "automake --cygnus Makefile" to generate Makefile.in
2
3 AUTOMAKE_OPTIONS = 1.9 cygnus
4
5 SUBDIRS = doc testsuite
6
7 GUILE = "`if test -f ../guile/libguile/guile ; then echo ../guile/libguile/guile; else echo guile ; fi`" -l $(srcdir)/guile.scm -s
8 CGENFLAGS = -v
9 ARCH = @arch@
10 ARCHFILE = $(srcroot)/cpu/$(ARCH).cpu
11
12 # for various utility rules
13 MACHS = all
14 ISAS = all
15
16 # file generation options
17 OPTIONS =
18
19 # for the html rule
20 INSN_FILE_NAME = $(ARCH)-insn.html
21
22 srcroot = $(srcdir)/..
23
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.
29
30 all-local: stamp-cgen
31
32 stamp-cgen: $(CGENFILES)
33         rm -f stamp-cgen
34         echo timestamp > stamp-cgen
35
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.
40 #
41 # NOTE: If running for a cpu other than the configured one you may wish to
42 # override ISAS and MACHS.
43
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>"
47 #
48 # -O tmp-opc.h -P tmp-opc.c -OPC $(dirname ${archfile})/${arch}.opc
49
50 .PHONY: desc
51 desc: desc.scm
52         rm -f tmp-desc.h tmp-desc.c
53         $(GUILE) $(srcdir)/cgen-opc.scm \
54                 -s $(srcdir) \
55                 $(CGENFLAGS) \
56                 -f "$(OPTIONS)" \
57                 -a $(ARCHFILE) \
58                 -i "$(ISAS)" \
59                 -m "$(MACHS)" \
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
63
64 # Build the machine generated cpu documentation.
65 # Usage: make html [ARCH=<arch>] [ARCHFILE=<arch-file>]
66 .PHONY: html
67 html: desc.scm html.scm cgen-doc.scm
68         rm -f tmp-doc.html
69         $(GUILE) $(srcdir)/cgen-doc.scm \
70                 -s $(srcdir) \
71                 $(CGENFLAGS) \
72                 -f "$(OPTIONS)" \
73                 -a $(ARCHFILE) \
74                 -i "$(ISAS)" \
75                 -m "$(MACHS)" \
76                 -N $(INSN_FILE_NAME) \
77                 -H tmp.html \
78                 -I tmp-insn.html
79         $(SHELL) $(srcroot)/move-if-change tmp.html $(ARCH).html
80         $(SHELL) $(srcroot)/move-if-change tmp-insn.html $(ARCH)-insn.html
81
82 # Build the opcodes files.
83 # We just stuff them in tmp-* files.
84 # Usage: make opcodes [ARCHFILE=<arch-file>] OPTIONS="<option list>"
85
86 .PHONY: opcodes
87 opcodes: opcodes.scm
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 \
91                 -s $(srcdir) \
92                 $(CGENFLAGS) \
93                 -f "$(OPTIONS) opinst" \
94                 -a $(ARCHFILE) \
95                 -i "$(ISAS)" \
96                 -m "$(MACHS)" \
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
100
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>"
106
107 .PHONY: sim-arch sim-cpu
108 sim-arch: sim.scm
109         rm -f tmp-arch.h tmp-arch.c tmp-cpuall.h
110         $(GUILE) $(srcdir)/cgen-sim.scm \
111                 -s $(srcdir) \
112                 $(CGENFLAGS) \
113                 -f "$(OPTIONS)" \
114                 -a $(ARCHFILE) \
115                 -i "$(ISAS)" \
116                 -m "$(MACHS)" \
117                 -A tmp-arch.h -B tmp-arch.c -N tmp-cpuall.h
118 sim-cpu: sim.scm
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 \
122                 -s $(srcdir) \
123                 $(CGENFLAGS) \
124                 -f "$(OPTIONS)" \
125                 -a $(ARCHFILE) \
126                 -i "$(ISAS)" \
127                 -m "$(MACHS)" \
128                 -C tmp-cpu.h -U tmp-cpu.c \
129                 -T tmp-decode.h -D tmp-decode.c \
130                 -M tmp-model.c \
131                 -S tmp-semantics.c -X tmp-sem-switch.c
132
133 # Build GAS testcase generator.
134 # Usage: make gas-test [ARCHFILE=<arch-file>]
135
136 .PHONY: gas-test
137 gas-test: gas-test.scm cgen-gas.scm
138         @if test -z "$(ISAS)" ; then \
139           echo "ISAS not specified!" ;\
140           exit 1 ;\
141         fi
142         $(GUILE) $(srcdir)/cgen-gas.scm \
143                 -s $(srcdir) \
144                 $(CGENFLAGS) \
145                 -a $(ARCHFILE) \
146                 -i "$(ISAS)" \
147                 -m "$(MACHS)" \
148                 -B gas-build.sh \
149                 -E gas-allinsn.exp
150
151 # Build simulator testcase generator.
152 # Usage: make sim-test [ARCHFILE=<arch-file>]
153
154 .PHONY: sim-test
155 sim-test: sim-test.scm cgen-stest.scm
156         @if test -z "$(ISAS)" ; then \
157           echo "ISAS not specified!" ;\
158           exit 1 ;\
159         fi
160         $(GUILE) $(srcdir)/cgen-stest.scm \
161                 -s $(srcdir) \
162                 $(CGENFLAGS) \
163                 -a $(ARCHFILE) \
164                 -i "$(ISAS)" \
165                 -m "$(MACHS)" \
166                 -B sim-build.sh \
167                 -E sim-allinsn.exp
168
169 CLEANFILES = tmp-*