1 # Copyright (c) 1995, 1996, 1997, 1998, 1999, 2000 Cygnus Support
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
16 srcroot
= $(srcdir)/..
/..
17 objroot
= $(objdir
)/..
/..
20 exec_prefix = @
exec_prefix@
22 host_alias
= @host_alias@
23 target_alias
= @target_alias@
24 program_transform_name
= @program_transform_name@
28 tooldir
= $(exec_prefix)/$(target_alias
)
30 # Multilib support variables.
31 # TOP is used instead of MULTI{BUILD,SRC}TOP.
38 INSTALL_PROGRAM
= @INSTALL_PROGRAM@
39 INSTALL_DATA
= @INSTALL_DATA@
46 AS
= `if [ -f ${objroot}/../gas/as.new ] ; \
47 then echo ${objroot}/../gas/as.new ; \
53 LD
= `if [ -f ${objroot}/../ld/ld.new ] ; \
54 then echo ${objroot}/../ld/ld.new ; \
59 OBJDUMP
= `if [ -f ${objroot}/../binutils/objdump ] ; \
60 then echo ${objroot}/../binutils/objdump ; \
61 else t='$(program_transform_name)'; echo objdump | sed -e $$t ; fi`
62 OBJCOPY
= `if [ -f ${objroot}/../binutils/objcopy ] ; \
63 then echo ${objroot}/../binutils/objcopy ; \
64 else t='$(program_transform_name)'; echo objcopy | sed -e $$t ; fi`
68 GENOBJS
= syscalls.o fstat.o getpid.o isatty.o kill.o \
69 lseek.o
print.o putnum.o stat.o unlink.o
70 GENOBJS2
= open.o close.o read.o write.o
71 IDTOBJS
= idtmon.o @part_specific_obj@
${GENOBJS}
72 PMONOBJS
= pmon.o @part_specific_obj@
${GENOBJS}
73 LSIOBJS
= lsipmon.o @part_specific_obj@
${GENOBJS}
74 DVEOBJS
= dvemon.o @part_specific_obj@
${GENOBJS} ${GENOBJS2}
75 JMR3904OBJS
= jmr3904-io.o @part_specific_obj@
${GENOBJS} ${GENOBJS2}
76 CFEOBJS
= cfe.o cfe_api.o cfe_mem.o @part_specific_obj@
${GENOBJS} ${GENOBJS2}
77 CYGMONOBJS
= open.o close.o cygmon.o @part_specific_obj@
${GENOBJS}
79 # Nullmon cannot support read and write, but the test cases pull them in via libs
80 NULLMONOBJS
= nullmon.o @part_specific_obj@
${GENOBJS}
84 GCC_LDFLAGS
= `if [ -d ${objroot}/../gcc ] ; \
85 then echo -L${objroot}/../gcc ; fi`
87 SCRIPTS
= @script_list@
90 PART_SPECIFIC_DEFINES
= @part_specific_defines@
92 # Host specific makefile fragment comes in here.
96 # build a test program for each target board. Just trying to get
97 # it to link is a good test, so we ignore all the errors for now.
100 all: ${CRT0} ${PCRT0} test.o
${BSP}
103 # here's where we build the board support packages for each target
105 mipsidt.o
: $(IDTOBJS
)
106 ${LD} -r
$(IDTOBJS
) -o
$@
108 mipspmon.o
: $(PMONOBJS
)
109 ${LD} -r
$(PMONOBJS
) -o
$@
111 mipslsi.o
: $(PMONOBJS
)
112 ${LD} -r
$(LSIOBJS
) -o
$@
115 ${AR} ${ARFLAGS} $@
$(IDTOBJS
)
118 libpmon.a
: $(PMONOBJS
)
119 ${AR} ${ARFLAGS} $@
$(PMONOBJS
)
123 ${AR} ${ARFLAGS} $@
$(LSIOBJS
)
127 ${AR} ${ARFLAGS} $@
$(DVEOBJS
)
130 libjmr3904.a
: $(JMR3904OBJS
)
131 ${AR} ${ARFLAGS} $@
$(JMR3904OBJS
)
134 libcygmon.a
: $(CYGMONOBJS
)
135 ${AR} ${ARFLAGS} $@
$(CYGMONOBJS
)
139 ${AR} ${ARFLAGS} $@
$(CFEOBJS
)
142 # nullmon.a , This is what you want if you want crt0 but NO mon services
143 # Supports GDB sim testing, board bringups, ICE operation.
144 libnullmon.a
: $(NULLMONOBJS
)
145 ${AR} ${ARFLAGS} $@
$(NULLMONOBJS
)
149 # compile a fully linked binary. The -Wl,-T*.ld is for the linker
150 # script. By using -Wl, the linker script is put on the proper place
151 # in the comand line for ld, and all the symbols will get fully
154 test: $(OBJS
) ${BSP} pmon-test idt-test cfe-test
157 dtor.o
: $(srcdir)/dtor.C
158 $(CC
) $(CFLAGS_FOR_TARGET
) $(INCLUDES
) -o
$@
-c
$<
159 dtor.x
: dtor.o
${CRT0} ${srcdir}/pmon.
ld Makefile libpmon.a
160 ${CC} $(CFLAGS_FOR_TARGET
) -L
${srcdir} -L
${objdir} \
161 dtor.o
-o
$@
$(NEWLIB_LDFLAGS
) -N
-Wl
,-Tpmon.
ld
163 pmon-test.x
: test.o
${CRT0} Makefile libpmon.a
164 ${CC} $(CFLAGS_FOR_TARGET
) -L
${srcdir} -L
${objdir} \
165 test.o
-o
$@
$(NEWLIB_LDFLAGS
) -Wl
,-Tpmon.
ld
166 pmon-test.srec
: pmon-test.x
167 $(OBJCOPY
) -O srec pmon-test.x
$@
168 pmon-test.dis
: pmon-test.x
169 @
rm -fr pmon-test.dis
170 $(OBJDUMP
) -d pmon-test.x
> $@
171 pmon-test
: pmon-test.srec pmon-test.dis
173 idt-test.x
: test.o
${CRT0} Makefile libidt.a
174 ${CC} $(CFLAGS_FOR_TARGET
) -L
${srcdir} -L
${objdir} \
175 test.o
-o
$@
$(NEWLIB_LDFLAGS
) -Wl
,-Tidt.
ld
176 idt-test.srec
: idt-test.x
177 $(OBJCOPY
) -O srec idt-test.x
$@
178 idt-test.dis
: idt-test.x
180 $(OBJDUMP
) -d idt-test.x
> $@
181 idt-test
: idt-test.srec idt-test.dis
183 cfe-test.x
: test.o
${CRT0} Makefile libcfe.a
184 ${CC} $(CFLAGS_FOR_TARGET
) -L
${srcdir} -L
${objdir} \
185 test.o
-o
$@
$(NEWLIB_LDFLAGS
) -Wl
,-Tcfe.
ld
186 cfe-test.srec
: cfe-test.x
187 $(OBJCOPY
) -O srec cfe-test.x
$@
188 cfe-test.dis
: cfe-test.x
190 $(OBJDUMP
) -d cfe-test.x
> $@
191 cfe-test
: cfe-test.srec cfe-test.dis
196 rm -f a.out core
*.i
*~
*.o
*-test *.srec
*.dis
*.map
*.x
198 distclean maintainer-clean
realclean: clean
199 rm -f Makefile config.status a.out
201 .PHONY
: install info install-info clean-info
203 @for file in
$(CRT0
) $(PCRT0
) $(BSP
); do \
204 $(INSTALL_DATA
) $${file} $(tooldir
)/lib
${MULTISUBDIR}; \
206 @for script in
${SCRIPTS}; do\
207 $(INSTALL_DATA
) ${srcdir}/$${script}.
ld $(tooldir
)/lib
${MULTISUBDIR}/$${script}.
ld; \
214 test.o
: ${srcdir}/test.c
216 # these are for the BSPs
217 crt0.o
: ${srcdir}/crt0.S
218 pcrt0.o
: ${srcdir}/crt0.S
219 $(CC
) -c
$(CFLAGS_FOR_TARGET
) $(CFLAGS
) -DGCRT0
${srcdir}/crt0.S
-o
${PCRT0}
220 crt0_cfe.o
: ${srcdir}/crt0_cfe.S
221 crt0_cygmon.o
: ${srcdir}/crt0_cygmon.S
222 idtmon.o
: ${srcdir}/idtmon.S
223 pmon.o
: ${srcdir}/pmon.S
224 $(CC
) -c
$(CFLAGS_FOR_TARGET
) $(CFLAGS
) $(PART_SPECIFIC_DEFINES
) ${srcdir}/pmon.S
-o pmon.o
225 vr4300.o
: ${srcdir}/vr4300.S
226 $(CC
) -c
$(CFLAGS_FOR_TARGET
) $(CFLAGS
) ${srcdir}/vr4300.S
227 vr5xxx.o
: ${srcdir}/vr5xxx.S
228 $(CC
) -c
$(CFLAGS_FOR_TARGET
) $(CFLAGS
) ${srcdir}/vr5xxx.S
229 lsipmon.o
: $(srcdir)/lsipmon.S
$(srcdir)/pmon.S
230 jmr3904-io.o
: ${srcdir}/jmr3904-io.c
231 $(CC
) -c
$(CFLAGS_FOR_TARGET
) $(CFLAGS
) ${srcdir}/jmr3904-io.c
-o
$@
232 cfe.o
: ${srcdir}/cfe.c
${srcdir}/cfe_api.h
233 $(CC
) -c
$(CFLAGS_FOR_TARGET
) $(CFLAGS
) ${srcdir}/cfe.c
-o
$@
234 cfe_api.o
: ${srcdir}/cfe_api.c
${srcdir}/cfe_api.h
${srcdir}/cfe_api_int.h
235 $(CC
) -c
$(CFLAGS_FOR_TARGET
) $(CFLAGS
) ${srcdir}/cfe_api.c
-o
$@
236 cfe_mem.o
: ${srcdir}/cfe_mem.c
${srcdir}/cfe_api.h
237 $(CC
) -c
$(CFLAGS_FOR_TARGET
) $(CFLAGS
) ${srcdir}/cfe_mem.c
-o
$@
239 # cma101 can not be compiled mips16, if a mips16 version is needed then
240 # it will have to be built, then this rule can be scrapped, allowing
241 # the implicit rule to run.
242 cma101.o
: ${srcdir}/cma101.c
243 $(CC
) -c
$(CFLAGS_FOR_TARGET
) $(CFLAGS
) -mno-mips16
${srcdir}/cma101.c
246 syscalls.o
: ${srcdir}/syscalls.c
248 # target specific makefile fragment comes in here.
249 @target_makefile_frag@
251 Makefile
: Makefile.in config.status @host_makefile_frag_path@ @target_makefile_frag_path@
252 $(SHELL
) config.status
254 config.status
: configure
255 $(SHELL
) config.status
--recheck