Commit | Line | Data |
---|---|---|
d45a4bef JB |
1 | #### Makefile.in --- Makefile template for the M32C simulator |
2 | ||
7b6bb8da JB |
3 | ### Copyright (C) 2005, 2007, 2008, 2009, 2010, 2011 |
4 | ### Free Software Foundation, Inc. | |
d45a4bef JB |
5 | ### Contributed by Red Hat, Inc. |
6 | ### | |
7 | ### This file is part of the GNU simulators. | |
8 | ### | |
4744ac1b JB |
9 | ### This program is free software; you can redistribute it and/or modify |
10 | ### it under the terms of the GNU General Public License as published by | |
11 | ### the Free Software Foundation; either version 3 of the License, or | |
12 | ### (at your option) any later version. | |
13 | ### | |
14 | ### This program is distributed in the hope that it will be useful, | |
15 | ### but WITHOUT ANY WARRANTY; without even the implied warranty of | |
16 | ### MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
17 | ### GNU General Public License for more details. | |
18 | ### | |
d45a4bef | 19 | ### You should have received a copy of the GNU General Public License |
4744ac1b | 20 | ### along with this program. If not, see <http://www.gnu.org/licenses/>. |
d45a4bef JB |
21 | |
22 | ## COMMON_PRE_CONFIG_FRAG | |
23 | ||
3877a145 | 24 | SIM_EXTRA_CFLAGS = -Wall -DTIMER_A |
d45a4bef JB |
25 | |
26 | SIM_RUN_OBJS = \ | |
27 | main.o \ | |
28 | $(ENDLIST) | |
29 | ||
30 | SIM_OBJS = \ | |
31 | gdb-if.o \ | |
32 | int.o \ | |
33 | load.o \ | |
34 | mem.o \ | |
35 | misc.o \ | |
36 | reg.o \ | |
37 | r8c.o \ | |
38 | m32c.o \ | |
39 | srcdest.o \ | |
40 | syscalls.o \ | |
41 | trace.o \ | |
42 | $(ENDLIST) | |
43 | ||
44 | # SIM_EXTRA_ALL = sample.x sample2.x | |
45 | ||
46 | LIBS = $B/bfd/libbfd.a $B/libiberty/libiberty.a | |
47 | ||
48 | ## COMMON_POST_CONFIG_FRAG | |
49 | ||
50 | arch = m32c | |
51 | ||
52 | r8c.c : r8c.opc opc2c | |
53 | ./opc2c -l r8c.out $(srcdir)/r8c.opc > r8c.c | |
54 | ||
55 | m32c.c : m32c.opc opc2c | |
56 | ./opc2c -l m32c.out $(srcdir)/m32c.opc > m32c.c | |
57 | ||
58 | opc2c : opc2c.o safe-fgets.o | |
cd006ce4 | 59 | $(CC_FOR_BUILD) $(BUILD_CFLAGS) $(BUILD_LDFLAGS) $^ -o $@ $(BUILD_LIBS) |
d45a4bef JB |
60 | |
61 | sample.x : $(srcdir)/sample.S $(srcdir)/sample.ld | |
62 | ../../gcc/xgcc $(CPUFLAGS) -B../../gcc/ -c $(srcdir)/sample.S -o sample.o | |
63 | ../../ld/ld-new sample.o -o sample.x -T$(srcdir)/sample.ld | |
64 | ||
65 | sample.mot : sample.x | |
66 | ../../binutils/objcopy --srec-forceS3 -O srec sample.x sample.mot | |
67 | ||
68 | sample2.x : sample2.o gloss.o $(srcdir)/sample.ld | |
69 | ../../ld/ld-new sample2.o gloss.o -o sample2.x -T$(srcdir)/sample.ld | |
70 | ||
71 | sample2.o : $(srcdir)/sample2.c | |
72 | ../../gcc/xgcc $(CPUFLAGS) -B../../gcc/ -c $(srcdir)/sample2.c -o sample2.o | |
73 | ||
74 | gloss.o : $(srcdir)/gloss.S | |
75 | ../../gcc/xgcc $(CPUFLAGS) -B../../gcc/ -c $(srcdir)/gloss.S -o gloss.o | |
76 | ||
77 | encodings: | |
78 | grep '/\* [01]' $(srcdir)/r8c.opc | sort | |
79 | ||
80 | gdb-if.o : cpu.h mem.h load.h syscalls.h | |
81 | int.o : int.h cpu.h mem.h | |
82 | load.o : load.h cpu.h mem.h | |
83 | main.o : cpu.h mem.h misc.h load.h | |
84 | mem.o : mem.h cpu.h syscalls.h | |
85 | misc.o : cpu.h misc.h | |
d45a4bef | 86 | reg.o : cpu.h |
d45a4bef JB |
87 | srcdest.c : cpu.h mem.h |
88 | syscalls.c : cpu.h mem.h syscalls.h | |
89 | ||
90 | r8c.o : cpu.h mem.h misc.h int.h | |
cd006ce4 MM |
91 | |
92 | opc2c.o : opc2c.c safe-fgets.h | |
93 | $(CC_FOR_BUILD) $(BUILD_CFLAGS) -c $(srcdir)/opc2c.c | |
94 | ||
95 | safe-fgets.o : safe-fgets.c safe-fgets.h | |
96 | $(CC_FOR_BUILD) $(BUILD_CFLAGS) -c $(srcdir)/safe-fgets.c | |
97 |