1 # Copyright (c) 2000, Cygnus Solutions, A Red Hat Company
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 # Generic object files common to all targets.
69 GENOBJS
= _exit.o access.o chmod.o close.o crt1.o \
70 fstat.o getpid.o gettime.o isatty.o \
71 kill.o lseek.o open.o read.o \
72 sbrk.o stat.o time.o trap.o unlink.o utime.o write.o
74 # Object files specific to particular targets.
79 GCC_LDFLAGS
= `if [ -d ${objroot}/../gcc ] ; \
80 then echo -L${objroot}/../gcc ; fi`
85 # Host specific makefile fragment comes in here.
89 # build a test program for each target board. Just trying to get
90 # it to link is a good test, so we ignore all the errors for now.
93 all: ${CRT0} test.o
${BSP}
96 # here's where we build the board support packages for each target
99 libeval.a
: $(EVALOBJS
)
100 ${AR} ${ARFLAGS} $@
$(EVALOBJS
)
104 # compile a fully linked binary. The -Wl,-T*.ld is for the linker
105 # script. By using -Wl, the linker script is put on the proper place
106 # in the comand line for ld, and all the symbols will get fully
110 ${CC} $(CFLAGS_FOR_TARGET
) -L
${srcdir} -L
${objdir} \
111 test.o
-o
$@
$(NEWLIB_LDFLAGS
)
117 rm -f a.out core
*.i
*~
*.o
*-test *.srec
*.dis
*.map
*.x
119 distclean maintainer-clean
realclean: clean
120 rm -f Makefile config.status a.out
122 .PHONY
: install info install-info clean-info
124 $(INSTALL_PROGRAM
) $(CRT0
) $(tooldir
)/lib
${MULTISUBDIR}/$(CRT0
)
125 @for bsp in
${BSP}; do\
126 $(INSTALL_PROGRAM
) $${bsp} $(tooldir
)/lib
${MULTISUBDIR}; \
128 @for script in
${SCRIPTS}; do\
129 $(INSTALL_DATA
) $(srcdir)/$${script}.
ld $(tooldir
)/lib
${MULTISUBDIR}/$${script}.
ld; \
136 test.o
: ${srcdir}/test.c
138 # these are for the BSPs
139 ${CRT0}: ${srcdir}/crt0.S
141 # target specific makefile fragment comes in here.
142 @target_makefile_frag@
144 Makefile
: Makefile.in config.status @host_makefile_frag_path@ @target_makefile_frag_path@
145 $(SHELL
) config.status
147 config.status
: configure
148 $(SHELL
) config.status
--recheck