1 | # Copyright (c) 2008, 2010 Anthony Green |
---|
2 | # |
---|
3 | # The authors hereby grant permission to use, copy, modify, distribute, |
---|
4 | # and license this software and its documentation for any purpose, provided |
---|
5 | # that existing copyright notices are retained in all copies and that this |
---|
6 | # notice is included verbatim in any distributions. No written agreement, |
---|
7 | # license, or royalty fee is required for any of the authorized uses. |
---|
8 | # Modifications to this software may be copyrighted by their authors |
---|
9 | # and need not follow the licensing terms described here, provided that |
---|
10 | # the new terms are clearly indicated on the first page of each file where |
---|
11 | # they apply. |
---|
12 | |
---|
13 | # Makefile for libgloss/spro. This is the board support code for the |
---|
14 | # moxie target. |
---|
15 | |
---|
16 | DESTDIR = |
---|
17 | VPATH = @srcdir@ @srcdir@/.. |
---|
18 | srcdir = @srcdir@ |
---|
19 | objdir = . |
---|
20 | srcroot = $(srcdir)/../.. |
---|
21 | objroot = $(objdir)/../.. |
---|
22 | |
---|
23 | prefix = @prefix@ |
---|
24 | exec_prefix = @exec_prefix@ |
---|
25 | |
---|
26 | host_alias = @host_alias@ |
---|
27 | target_alias = @target_alias@ |
---|
28 | |
---|
29 | bindir = @bindir@ |
---|
30 | libdir = @libdir@ |
---|
31 | tooldir = $(exec_prefix)/$(target_alias) |
---|
32 | |
---|
33 | # Multilib support variables. |
---|
34 | # TOP is used instead of MULTI{BUILD,SRC}TOP. |
---|
35 | MULTIDIRS = |
---|
36 | MULTISUBDIR = |
---|
37 | MULTIDO = true |
---|
38 | MULTICLEAN = true |
---|
39 | |
---|
40 | INSTALL = @INSTALL@ |
---|
41 | INSTALL_PROGRAM = @INSTALL_PROGRAM@ |
---|
42 | INSTALL_DATA = @INSTALL_DATA@ |
---|
43 | |
---|
44 | SHELL = /bin/sh |
---|
45 | |
---|
46 | CC = @CC@ |
---|
47 | |
---|
48 | AS = @AS@ |
---|
49 | AR = @AR@ |
---|
50 | LD = @LD@ |
---|
51 | RANLIB = @RANLIB@ |
---|
52 | AR_FLAGS = rc |
---|
53 | |
---|
54 | OBJDUMP = `if [ -f ${objroot}/../binutils/objdump ] ; \ |
---|
55 | then echo ${objroot}/../binutils/objdump ; \ |
---|
56 | else t='$(program_transform_name)'; echo objdump | sed -e $$t ; fi` |
---|
57 | OBJCOPY = `if [ -f ${objroot}/../binutils/objcopy ] ; \ |
---|
58 | then echo ${objroot}/../binutils/objcopy ; \ |
---|
59 | else t='$(program_transform_name)'; echo objcopy | sed -e $$t ; fi` |
---|
60 | |
---|
61 | LD_SCRIPTS = moxie-elf-common.ld qemu.ld sim.ld moxiebox.ld |
---|
62 | |
---|
63 | @BUILD_CRT0_TRUE@CRT0 = crt0.o |
---|
64 | @BUILD_CRT0_TRUE@CRT0_INSTALL = install-crt0 |
---|
65 | @BUILD_CRT0_FALSE@CRT0 = |
---|
66 | @BUILD_CRT0_FALSE@CRT0_INSTALL = |
---|
67 | |
---|
68 | SIM_BSP = libsim.a |
---|
69 | SIM_OBJS = fstat.o \ |
---|
70 | getpid.o \ |
---|
71 | isatty.o \ |
---|
72 | kill.o \ |
---|
73 | putnum.o \ |
---|
74 | sbrk.o \ |
---|
75 | sim-close.o \ |
---|
76 | sim-exit.o \ |
---|
77 | sim-inbyte.o \ |
---|
78 | sim-lseek.o \ |
---|
79 | sim-open.o \ |
---|
80 | sim-read.o \ |
---|
81 | sim-time.o \ |
---|
82 | sim-unlink.o \ |
---|
83 | sim-write.o \ |
---|
84 | stat.o |
---|
85 | |
---|
86 | QEMU_BSP = libqemu.a |
---|
87 | QEMU_OBJS = qemu-write.o \ |
---|
88 | qemu-time.o \ |
---|
89 | sim-exit.o \ |
---|
90 | sbrk.o \ |
---|
91 | sim-close.o \ |
---|
92 | fstat.o \ |
---|
93 | getpid.o \ |
---|
94 | isatty.o \ |
---|
95 | kill.o \ |
---|
96 | putnum.o \ |
---|
97 | sim-lseek.o \ |
---|
98 | sim-read.o |
---|
99 | |
---|
100 | #### Host specific Makefile fragment comes in here. |
---|
101 | @host_makefile_frag@ |
---|
102 | |
---|
103 | all: ${CRT0} $(SIM_BSP) $(QEMU_BSP) |
---|
104 | |
---|
105 | $(SIM_BSP): $(SIM_OBJS) |
---|
106 | $(AR) $(ARFLAGS) $@ $? |
---|
107 | $(RANLIB) $@ |
---|
108 | |
---|
109 | $(QEMU_BSP): $(QEMU_OBJS) |
---|
110 | $(AR) $(ARFLAGS) $@ $? |
---|
111 | $(RANLIB) $@ |
---|
112 | |
---|
113 | fstat.o: $(srcdir)/fstat.c |
---|
114 | getpid.o: $(srcdir)/getpid.c |
---|
115 | isatty.o: $(srcdir)/isatty.c |
---|
116 | kill.o: $(srcdir)/kill.c |
---|
117 | putnum.o: $(srcdir)/putnum.c |
---|
118 | sbrk.o: $(srcdir)/sbrk.c |
---|
119 | sim-close.o: $(srcdir)/sim-close.S |
---|
120 | sim-exit.o: $(srcdir)/sim-exit.S |
---|
121 | sim-inbyte.o: $(srcdir)/sim-inbyte.c |
---|
122 | sim-lseek.o: $(srcdir)/sim-lseek.c |
---|
123 | sim-open.o: $(srcdir)/sim-open.S |
---|
124 | sim-read.o: $(srcdir)/sim-read.S |
---|
125 | sim-time.o: $(srcdir)/sim-time.c |
---|
126 | sim-unlink.o: $(srcdir)/sim-unlink.S |
---|
127 | sim-write.o: $(srcdir)/sim-write.S |
---|
128 | stat.o: $(srcdir)/stat.c |
---|
129 | qemu-write.o: $(srcdir)/qemu-write.c |
---|
130 | |
---|
131 | install: ${CRT0_INSTALL} $($(CPU)_INSTALL) |
---|
132 | $(INSTALL_DATA) $(SIM_BSP) $(DESTDIR)$(tooldir)/lib${MULTISUBDIR}/$(SIM_BSP) |
---|
133 | $(INSTALL_DATA) $(QEMU_BSP) $(DESTDIR)$(tooldir)/lib${MULTISUBDIR}/$(QEMU_BSP) |
---|
134 | for x in ${LD_SCRIPTS}; do \ |
---|
135 | ${INSTALL_DATA} ${srcdir}/$$x $(DESTDIR)${tooldir}/lib/$$x; \ |
---|
136 | done; |
---|
137 | |
---|
138 | install-crt0: |
---|
139 | ${INSTALL_DATA} ${CRT0} $(DESTDIR)${tooldir}/lib${MULTISUBDIR}/$$x |
---|
140 | |
---|
141 | clean mostlyclean: |
---|
142 | rm -f *.o *.a |
---|
143 | |
---|
144 | distclean maintainer-clean realclean: clean |
---|
145 | rm -f Makefile config.cache config.log config.status |
---|
146 | |
---|
147 | .PHONY: info dvi doc install-info clean-info |
---|
148 | info doc dvi: |
---|
149 | install-info: |
---|
150 | clean-info: |
---|
151 | |
---|
152 | Makefile: Makefile.in config.status @host_makefile_frag_path@ |
---|
153 | $(SHELL) config.status |
---|
154 | |
---|
155 | config.status: configure |
---|
156 | $(SHELL) config.status --recheck |
---|