6 VPATH
= @
srcdir@ @
srcdir@
/..
9 srcroot
= $(srcdir)/..
/..
10 objroot
= $(objdir
)/..
/..
13 exec_prefix = @
exec_prefix@
15 host_alias
= @host_alias@
16 target_alias
= @target_alias@
20 tooldir
= $(exec_prefix)/$(target_alias
)
23 INSTALL_PROGRAM
= @INSTALL_PROGRAM@
24 INSTALL_DATA
= @INSTALL_DATA@
26 # Multilib support variables.
27 # TOP is used instead of MULTI{BUILD,SRC}TOP.
33 mkinstalldirs
= $(SHELL
) $(srcroot
)/mkinstalldirs
42 OBJDUMP
= `if [ -f ${objroot}/../binutils/objdump ] ; \
43 then echo ${objroot}/../binutils/objdump ; \
44 else t='$(program_transform_name)'; echo objdump | sed -e $$t ; fi`
45 OBJCOPY
= `if [ -f ${objroot}/../binutils/objcopy ] ; \
46 then echo ${objroot}/../binutils/objcopy ; \
47 else t='$(program_transform_name)'; echo objcopy | sed -e $$t ; fi`
49 # Here is all of the handlers stuff
52 H_OBJS
= intable.o dvz_hndl.o flg_hndl.o iad_hndl.o svc_hndl.o und_hndl.o
54 H_INSTALL
= install-hndl
56 # Here is all of the simulator stuff
59 SIM_OBJS
= _exit.o close.o _getenv.o lseek.o open.o read.o \
60 _rename.o sbrk.o time.o unlink.o write.o \
61 stat.o putnum.o kill.o getpid.o isatty.o fstat.o
63 SIM_INSTALL
= install-sim
65 # Here is all of the CRT stuff
66 CRT
= crti.o crtn.o crt0.o
67 CRT_INSTALL
= install-crt
69 # Host specific makefile fragment comes in here.
73 # build a test program for each target board. Just trying to get
74 # it to link is a good test, so we ignore all the errors for now.
76 all: ${CRT} ${SIM_BSP} ${H_BSP}
79 # here's where we build the board support packages for each target
82 ${AR} ${ARFLAGS} ${H_BSP} ${H_OBJS}
85 ${SIM_BSP}: ${SIM_OBJS}
86 ${AR} ${ARFLAGS} ${SIM_BSP} ${SIM_OBJS}
90 # here's where we build the test programs for each target
93 test: ${SIM_TEST} ${H_TEST}
95 hndl-test
: hndl-test.x hndl-test.dis
97 hndl-test.x
: test.o
${H_BSP}
98 ${CC} ${LDFLAGS_FOR_TARGET} -L
${objdir} \
100 -o hndl-test.x
${LIBS_FOR_TARGET} -lc
${H_BSP} -Wl
,-T
${SIM_SCRIPTS}
102 hndl-test.dis
: hndl-test.x
103 ${OBJDUMP} -d hndl-test.x
> hndl-test.dis
106 sim-test
: sim-test.x sim-test.dis
108 sim-test.x
: test.o
${SIM_BSP}
109 ${CC} ${LDFLAGS_FOR_TARGET} -L
${objdir} \
111 -o sim-test.x
${LIBS_FOR_TARGET} -lc
${SIM_BSP} -Wl
,-T
${SIM_SCRIPTS}
113 sim-test.dis
: sim-test.x
114 ${OBJDUMP} -d sim-test.x
> sim-test.dis
120 ${CC} ${CFLAGS_FOR_TARGET} -c
$<
123 rm -f a.out core
*.i
*.o
*-test *.srec
*.dis
*.x
$(SIM_BSP
) $(H_BSP
)
125 distclean maintainer-clean
realclean: clean
128 .PHONY
: install info install-info clean-info
129 install: ${CRT_INSTALL} ${SIM_INSTALL} ${H_INSTALL}
132 ${mkinstalldirs} ${DESTDIR}${tooldir}/lib
${MULTISUBDIR}
133 set
-e
; for x in
${CRT} ; do\
134 ${INSTALL_DATA} $$x $(DESTDIR
)${tooldir}/lib
${MULTISUBDIR}/$$x; \
138 ${mkinstalldirs} ${DESTDIR}${tooldir}/lib
${MULTISUBDIR}
139 for x in
${SIM_BSP} ; do\
140 ${INSTALL_PROGRAM} $${x} $(DESTDIR
)${tooldir}/lib
${MULTISUBDIR}/$$x; \
142 for x in
${SIM_SCRIPTS}; do\
143 ${INSTALL_DATA} ${srcdir}/$${x} $(DESTDIR
)${tooldir}/lib
${MULTISUBDIR}/$$x; \
147 ${mkinstalldirs} ${DESTDIR}${tooldir}/lib
${MULTISUBDIR}
148 for x in
${H_BSP}; do\
149 ${INSTALL_PROGRAM} $${x} $(DESTDIR
)${tooldir}/lib
${MULTISUBDIR}/$$x; \
157 Makefile
: Makefile.in ..
/config.status
158 cd ..
&& $(SHELL
) config.status