[444] | 1 | # Copyright 2007, 2009 Xilinx, Inc. All rights reserved. |
---|
| 2 | # |
---|
| 3 | # Redistribution and use in source and binary forms, with or without |
---|
| 4 | # modification, are permitted provided that the following conditions are |
---|
| 5 | # met: |
---|
| 6 | # |
---|
| 7 | # 1. Redistributions source code must retain the above copyright notice, |
---|
| 8 | # this list of conditions and the following disclaimer. |
---|
| 9 | # |
---|
| 10 | # 2. Redistributions in binary form must reproduce the above copyright |
---|
| 11 | # notice, this list of conditions and the following disclaimer in the |
---|
| 12 | # documentation and/or other materials provided with the distribution. |
---|
| 13 | # |
---|
| 14 | # 3. Neither the name of Xilinx nor the names of its contributors may be |
---|
| 15 | # used to endorse or promote products derived from this software without |
---|
| 16 | # specific prior written permission. |
---|
| 17 | # |
---|
| 18 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS |
---|
| 19 | # IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED |
---|
| 20 | # TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A |
---|
| 21 | # PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT |
---|
| 22 | # HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
---|
| 23 | # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED |
---|
| 24 | # TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR |
---|
| 25 | # PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF |
---|
| 26 | # LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING |
---|
| 27 | # NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS |
---|
| 28 | # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
---|
| 29 | |
---|
| 30 | # Makefile for libgloss/microblaze. This is the board support |
---|
| 31 | # code for the various microblaze targets. |
---|
| 32 | |
---|
| 33 | DESTDIR = |
---|
| 34 | VPATH = @srcdir@ |
---|
| 35 | srcdir = @srcdir@ |
---|
| 36 | objdir = . |
---|
| 37 | srcroot = $(srcdir)/../.. |
---|
| 38 | objroot = $(objdir)/../.. |
---|
| 39 | |
---|
| 40 | prefix = @prefix@ |
---|
| 41 | exec_prefix = @exec_prefix@ |
---|
| 42 | |
---|
| 43 | host_alias = @host_alias@ |
---|
| 44 | target_alias = @target_alias@ |
---|
| 45 | |
---|
| 46 | bindir = @bindir@ |
---|
| 47 | libdir = @libdir@ |
---|
| 48 | tooldir = $(exec_prefix)/$(target_alias) |
---|
| 49 | |
---|
| 50 | # Multilib support variables. |
---|
| 51 | # TOP is used instead of MULTI{BUILD,SRC}TOP. |
---|
| 52 | MULTIDIRS = |
---|
| 53 | MULTISUBDIR = |
---|
| 54 | MULTIDO = true |
---|
| 55 | MULTICLEAN = true |
---|
| 56 | |
---|
| 57 | INSTALL = @INSTALL@ |
---|
| 58 | INSTALL_PROGRAM = @INSTALL_PROGRAM@ |
---|
| 59 | INSTALL_DATA = @INSTALL_DATA@ |
---|
| 60 | |
---|
| 61 | SHELL = /bin/sh |
---|
| 62 | |
---|
| 63 | CC = @CC@ |
---|
| 64 | |
---|
| 65 | AS = @AS@ |
---|
| 66 | AR = @AR@ |
---|
| 67 | LD = @LD@ |
---|
| 68 | RANLIB = @RANLIB@ |
---|
| 69 | AR_FLAGS = qrv |
---|
| 70 | |
---|
| 71 | OBJDUMP = `if [ -f ${objroot}/../binutils/objdump ] ; \ |
---|
| 72 | then echo ${objroot}/../binutils/objdump ; \ |
---|
| 73 | else t='$(program_transform_name)'; echo objdump | sed -e $$t ; fi` |
---|
| 74 | OBJCOPY = `if [ -f ${objroot}/../binutils/objcopy ] ; \ |
---|
| 75 | then echo ${objroot}/../binutils/objcopy ; \ |
---|
| 76 | else t='$(program_transform_name)'; echo objcopy | sed -e $$t ; fi` |
---|
| 77 | |
---|
| 78 | CRT = crt0.o crt1.o crt2.o crt3.o crt4.o crtinit.o pgcrtinit.o sim-crtinit.o sim-pgcrtinit.o |
---|
| 79 | LIB = libgloss.a |
---|
| 80 | GENOBJS = fstat.o getpid.o isatty.o kill.o lseek.o print.o putnum.o stat.o unlink.o \ |
---|
| 81 | open.o close.o read.o write.o |
---|
| 82 | OBJS = ${GENOBJS} sbrk.o timer.o _exception_handler.o _hw_exception_handler.o \ |
---|
| 83 | _interrupt_handler.o _program_clean.o _program_init.o \ |
---|
| 84 | xil_malloc.o xil_sbrk.o xil_printf.o |
---|
| 85 | SCRIPTS = xilinx.ld |
---|
| 86 | |
---|
| 87 | # Tiny Linux BSP. |
---|
| 88 | LINUX_BSP = libgloss-linux.a |
---|
| 89 | CRT += linux-crt0.o |
---|
| 90 | LINUX_OBJS = linux-syscalls.o linux-syscalls-wrap.o |
---|
| 91 | LINUX_OBJS += linux-outbyte.o linux-inbyte.o |
---|
| 92 | LINUX_SCRIPTS = elf-gloss-linux.specs |
---|
| 93 | |
---|
| 94 | CPU = @CPU@ |
---|
| 95 | |
---|
| 96 | #### Host specific Makefile fragment comes in here. |
---|
| 97 | @host_makefile_frag@ |
---|
| 98 | |
---|
| 99 | all: ${CRT} ${LIB} ${LINUX_BSP} |
---|
| 100 | |
---|
| 101 | install: ${CRT} ${LIB} install-linux |
---|
| 102 | @for crt in ${CRT}; do \ |
---|
| 103 | $(INSTALL_PROGRAM) $${crt} $(DESTDIR)$(tooldir)/lib${MULTISUBDIR}/$${crt}; \ |
---|
| 104 | done |
---|
| 105 | $(INSTALL_PROGRAM) ${LIB} $(DESTDIR)$(tooldir)/lib${MULTISUBDIR} |
---|
| 106 | $(INSTALL_PROGRAM) $(srcdir)/${SCRIPTS} $(DESTDIR)$(tooldir)/lib/ |
---|
| 107 | |
---|
| 108 | install-linux: ${LINUX_BSP} |
---|
| 109 | $(INSTALL_PROGRAM) ${LINUX_BSP} $(DESTDIR)$(tooldir)/lib${MULTISUBDIR} |
---|
| 110 | set -e; for x in ${LINUX_SCRIPTS}; do ${INSTALL_DATA} ${srcdir}/${objtype}$$x $(DESTDIR)${tooldir}/lib${MULTISUBDIR}/$$x; done |
---|
| 111 | |
---|
| 112 | crt0.o: crt0.S |
---|
| 113 | crt1.o: crt1.S |
---|
| 114 | crt2.o: crt2.S |
---|
| 115 | crt3.o: crt3.S |
---|
| 116 | crt4.o: crt4.S |
---|
| 117 | linux-crt0.o: linux-crt0.S |
---|
| 118 | crtinit.o: crtinit.S |
---|
| 119 | sim-crtinit.o: sim-crtinit.S |
---|
| 120 | sim-pgcrtinit.o: sim-pgcrtinit.S |
---|
| 121 | |
---|
| 122 | # target specific makefile fragment comes in here. |
---|
| 123 | @target_makefile_frag@ |
---|
| 124 | |
---|
| 125 | clean mostlyclean: |
---|
| 126 | rm -f *.o *.a *.map *.x |
---|
| 127 | |
---|
| 128 | distclean maintainer-clean realclean: clean |
---|
| 129 | rm -f Makefile config.cache config.log config.status |
---|
| 130 | |
---|
| 131 | ${LIB}: ${OBJS} |
---|
| 132 | ${AR} ${ARFLAGS} $@ ${OBJS} |
---|
| 133 | ${RANLIB} $@ |
---|
| 134 | |
---|
| 135 | ${LINUX_BSP}: ${LINUX_OBJS} |
---|
| 136 | ${AR} ${ARFLAGS} $@ ${LINUX_OBJS} |
---|
| 137 | ${RANLIB} $@ |
---|
| 138 | |
---|
| 139 | .PHONY: info dvi doc install-info clean-info |
---|
| 140 | info doc dvi: |
---|
| 141 | install-info: |
---|
| 142 | clean-info: |
---|
| 143 | |
---|
| 144 | Makefile: Makefile.in config.status @host_makefile_frag_path@ @target_makefile_frag_path@ \ |
---|
| 145 | $(SHELL) config.status |
---|
| 146 | |
---|
| 147 | config.status: configure |
---|
| 148 | $(SHELL) config.status --recheck |
---|