1 # Copyright (c) 1995, 1996, 1997 Cygnus Support
2 # Copyright (c) 1999, 2000, 2001, 2002 Stephane Carrez
4 # The authors hereby grant permission to use, copy, modify, distribute,
5 # and license this software and its documentation for any purpose, provided
6 # that existing copyright notices are retained in all copies and that this
7 # notice is included verbatim in any distributions. No written agreement,
8 # license, or royalty fee is required for any of the authorized uses.
9 # Modifications to this software may be copyrighted by their authors
10 # and need not follow the licensing terms described here, provided that
11 # the new terms are clearly indicated on the first page of each file where
14 # This currently works with Motorola's 68HC11 based target boards.
15 # (should work with 68HC12 but not tested yet)
19 srcroot
= $(srcdir)/..
/..
20 objroot
= $(objdir
)/..
/..
22 VPATH
= $(srcdir) $(srcdir)/..
25 exec_prefix = @
exec_prefix@
27 host_alias
= @host_alias@
28 target_alias
= @target_alias@
29 program_transform_name
= @program_transform_name@
33 tooldir
= $(exec_prefix)/$(target_alias
)
35 # Multilib support variables.
36 # TOP is used instead of MULTI{BUILD,SRC}TOP.
43 INSTALL_PROGRAM
= @INSTALL_PROGRAM@
44 INSTALL_DATA
= @INSTALL_DATA@
56 OBJDUMP
= `if [ -f ${objroot}/../binutils/objdump ] ; \
57 then echo ${objroot}/../binutils/objdump ; \
58 else t='$(program_transform_name)'; echo objdump | sed -e $$t ; fi`
59 OBJCOPY
= `if [ -f ${objroot}/../binutils/objcopy ] ; \
60 then echo ${objroot}/../binutils/objcopy ; \
61 else t='$(program_transform_name)'; echo objcopy | sed -e $$t ; fi`
65 OBJS
= syscalls.o close.o fstat.o getpid.o isatty.o kill.o \
66 lseek.o open.o
print.o stat.o \
74 # here's all the generic target stuff
76 GEN_LDFLAGS
= -L
${srcdir}
79 # Host specific makefile fragment comes in here.
83 # build a test program for each target board. Just trying to get
84 # it to link is a good test, so we ignore all the errors for now.
89 # here's where we build the board support packages for each target
92 ${AR} ${ARFLAGS} $@
$(OBJS
)
96 syscalls.o
: $(srcdir)/syscalls.c
97 $(CC
) $(CFLAGS_FOR_TARGET
) -O2
$(INCLUDES
) -c
$(CFLAGS
) $<
99 close.o
: $(srcdir)/..
/close.c
100 $(CC
) $(CFLAGS_FOR_TARGET
) -O2
$(INCLUDES
) -c
$(CFLAGS
) $<
102 fstat.o
: $(srcdir)/..
/fstat.c
103 $(CC
) $(CFLAGS_FOR_TARGET
) -O2
$(INCLUDES
) -c
$(CFLAGS
) $<
105 getpid.o
: $(srcdir)/..
/getpid.c
106 $(CC
) $(CFLAGS_FOR_TARGET
) -O2
$(INCLUDES
) -c
$(CFLAGS
) $<
108 isatty.o
: $(srcdir)/..
/isatty.c
109 $(CC
) $(CFLAGS_FOR_TARGET
) -O2
$(INCLUDES
) -c
$(CFLAGS
) $<
111 kill.o
: $(srcdir)/..
/kill.c
112 $(CC
) $(CFLAGS_FOR_TARGET
) -O2
$(INCLUDES
) -c
$(CFLAGS
) $<
114 lseek.o
: $(srcdir)/..
/lseek.c
115 $(CC
) $(CFLAGS_FOR_TARGET
) -O2
$(INCLUDES
) -c
$(CFLAGS
) $<
117 open.o
: $(srcdir)/..
/open.c
118 $(CC
) $(CFLAGS_FOR_TARGET
) -O2
$(INCLUDES
) -c
$(CFLAGS
) $<
120 print.o
: $(srcdir)/..
/print.c
121 $(CC
) $(CFLAGS_FOR_TARGET
) -O2
$(INCLUDES
) -c
$(CFLAGS
) $<
123 putnum.o
: $(srcdir)/..
/putnum.c
124 $(CC
) $(CFLAGS_FOR_TARGET
) -O2
$(INCLUDES
) -c
$(CFLAGS
) $<
126 stat.o
: $(srcdir)/..
/stat.c
127 $(CC
) $(CFLAGS_FOR_TARGET
) -O2
$(INCLUDES
) -c
$(CFLAGS
) $<
129 unlink.o
: $(srcdir)/..
/unlink.c
130 $(CC
) $(CFLAGS_FOR_TARGET
) -O2
$(INCLUDES
) -c
$(CFLAGS
) $<
133 .PHONY
: install info dvi doc install-info clean-info
136 rm -f a.out core
*.
[oais
] *-test *.srec
*.dis
*.x syscall.h
138 distclean maintainer-clean
realclean: clean
139 rm -f Makefile config.status
*~
141 .PHONY
: install info install-info clean-info
142 install: install-scripts
143 $(INSTALL_PROGRAM
) $(CRT0
) $(tooldir
)/lib
${MULTISUBDIR}/$(CRT0
)
144 @for bsp in
${BSP}; do\
145 $(INSTALL_PROGRAM
) $${bsp} $(tooldir
)/lib
${MULTISUBDIR}; \
148 # Install the linker script in the correct place.
150 if
[ -f
${objroot}/..
/binutils
/objdump
] ; then \
151 objdump
="${objroot}/../binutils/objdump"; \
153 t
='$(program_transform_name)'; \
154 objdump
=`echo objdump | sed -e $$t`; \
156 name
=`$$objdump -f $(CRT0) | sed '/^$$/d'`; \
159 $(INSTALL_DATA
) ${srcdir}/sim-valid-m68hc11.
ld $(tooldir
)/lib
${MULTISUBDIR}/sim-valid.
ld \
162 $(INSTALL_DATA
) ${srcdir}/sim-valid-m68hc12.
ld $(tooldir
)/lib
${MULTISUBDIR}/sim-valid.
ld \
171 Makefile
: Makefile.in config.status @host_makefile_frag_path@
172 $(SHELL
) config.status
174 config.status
: configure
175 $(SHELL
) config.status
--recheck