# Makefile.in. Autoconf input makefile.
|
# Makefile.in. Autoconf input makefile.
|
|
|
# Copyright (c) 1998 Cygnus Support
|
# Copyright (c) 1998 Cygnus Support
|
# Copyright (C) 2004, Jacob Bower
|
# Copyright (C) 2004, Jacob Bower
|
# Copyright (C) 2010, Embecosm Limited
|
# Copyright (C) 2010, Embecosm Limited
|
# Copyright (C) 2011, ORSoC AB
|
# Copyright (C) 2011, ORSoC AB
|
|
|
# Contributor Jeremy Bennett
|
# Contributor Jeremy Bennett
|
# Contributor Julius Baxter
|
# Contributor Julius Baxter
|
|
|
# This file is part of Newlib.
|
# This file is part of Newlib.
|
|
|
# The original work by Jacob Bower is provided as-is without any kind of
|
# The original work by Jacob Bower is provided as-is without any kind of
|
# warranty. Use it at your own risk!
|
# warranty. Use it at your own risk!
|
|
|
# All subsequent work is bound by version 3 of the GPL as follows.
|
# All subsequent work is bound by version 3 of the GPL as follows.
|
|
|
# This program is free software; you can redistribute it and/or modify it
|
# This program is free software; you can redistribute it and/or modify it
|
# under the terms of the GNU General Public License as published by the Free
|
# under the terms of the GNU General Public License as published by the Free
|
# Software Foundation; either version 3 of the License, or (at your option)
|
# Software Foundation; either version 3 of the License, or (at your option)
|
# any later version.
|
# any later version.
|
|
|
# This program is distributed in the hope that it will be useful, but WITHOUT
|
# This program is distributed in the hope that it will be useful, but WITHOUT
|
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
# more details.
|
# more details.
|
|
|
# You should have received a copy of the GNU General Public License along
|
# You should have received a copy of the GNU General Public License along
|
# with this program. If not, see .
|
# with this program. If not, see .
|
|
|
DESTDIR =
|
DESTDIR =
|
VPATH = @srcdir@ @srcdir@/..
|
VPATH = @srcdir@ @srcdir@/..
|
srcdir = @srcdir@
|
srcdir = @srcdir@
|
objdir = .
|
objdir = .
|
srcroot = $(srcdir)/../..
|
srcroot = $(srcdir)/../..
|
objroot = $(objdir)/../..
|
objroot = $(objdir)/../..
|
|
|
prefix = @prefix@
|
prefix = @prefix@
|
exec_prefix = @exec_prefix@
|
exec_prefix = @exec_prefix@
|
|
|
host_alias = @host_alias@
|
host_alias = @host_alias@
|
target_alias = @target_alias@
|
target_alias = @target_alias@
|
|
|
bindir = @bindir@
|
bindir = @bindir@
|
libdir = @libdir@
|
libdir = @libdir@
|
tooldir = $(exec_prefix)/$(target_alias)
|
tooldir = $(exec_prefix)/$(target_alias)
|
|
|
# Multilib support variables.
|
# Multilib support variables.
|
# TOP is used instead of MULTI{BUILD,SRC}TOP.
|
# TOP is used instead of MULTI{BUILD,SRC}TOP.
|
MULTIDIRS =
|
MULTIDIRS =
|
MULTISUBDIR =
|
MULTISUBDIR =
|
|
|
INSTALL = @INSTALL@
|
INSTALL = @INSTALL@
|
INSTALL_PROGRAM = @INSTALL_PROGRAM@
|
INSTALL_PROGRAM = @INSTALL_PROGRAM@
|
INSTALL_DATA = @INSTALL_DATA@
|
INSTALL_DATA = @INSTALL_DATA@
|
|
|
SHELL = /bin/sh
|
SHELL = /bin/sh
|
|
|
CC = @CC@
|
CC = @CC@
|
AS = @AS@
|
AS = @AS@
|
AR = @AR@
|
AR = @AR@
|
LD = @LD@
|
LD = @LD@
|
RANLIB = @RANLIB@
|
RANLIB = @RANLIB@
|
|
|
OBJDUMP = `if [ -f ${objroot}/../binutils/objdump ] ; \
|
OBJDUMP = `if [ -f ${objroot}/../binutils/objdump ] ; \
|
then echo ${objroot}/../binutils/objdump ; \
|
then echo ${objroot}/../binutils/objdump ; \
|
else t='$(program_transform_name)'; echo objdump | sed -e $$t ; fi`
|
else t='$(program_transform_name)'; echo objdump | sed -e $$t ; fi`
|
OBJCOPY = `if [ -f ${objroot}/../binutils/objcopy ] ; \
|
OBJCOPY = `if [ -f ${objroot}/../binutils/objcopy ] ; \
|
then echo ${objroot}/../binutils/objcopy ; \
|
then echo ${objroot}/../binutils/objcopy ; \
|
else t='$(program_transform_name)'; echo objcopy | sed -e $$t ; fi`
|
else t='$(program_transform_name)'; echo objcopy | sed -e $$t ; fi`
|
|
|
# Add our own flags for C compilation
|
# Add our own flags for C compilation
|
CFLAGS = -g
|
CFLAGS = -g
|
|
|
# List new boards here - should be accompanied by own .[cS]
|
# List new boards here - should be accompanied by own .[cS]
|
BOARDS = or1ksim or1ksim-uart orpsocrefdesign ordb1a3pe1500 ml501
|
BOARDS = or1ksim or1ksim-uart orpsocrefdesign ordb1a3pe1500 ml501
|
|
|
BOARD_OBJS = $(addsuffix .o,$(BOARDS))
|
BOARD_OBJS = $(addsuffix .o,$(BOARDS))
|
BOARD_LIBS = $(addsuffix .a,$(BOARDS))
|
BOARD_LIBS = $(addsuffix .a,$(BOARDS))
|
|
|
# Generic name, used after install for each of these libraries
|
# Generic name, used after install for each of these libraries
|
LIBBOARD = libboard.a
|
LIBBOARD = libboard.a
|
|
|
# Our own C runtime startup and BSPs
|
# Our own C runtime startup and BSPs
|
CRT0 = crt0.o
|
CRT0 = crt0.o
|
LIBOR32 = libor32.a
|
LIBOR32 = libor32.a
|
|
|
OUTPUTS = $(CRT0) $(LIBOR32)
|
OUTPUTS = $(CRT0) $(LIBOR32)
|
|
|
# The standard object files for the library
|
# The standard object files for the library
|
LIBOR32_OBJS = _exit.o \
|
LIBOR32_OBJS = _exit.o \
|
close.o \
|
close.o \
|
environ.o \
|
environ.o \
|
execve.o \
|
execve.o \
|
fork.o \
|
fork.o \
|
fstat.o \
|
fstat.o \
|
getpid.o \
|
getpid.o \
|
|
impure-init.o \
|
isatty.o \
|
isatty.o \
|
kill.o \
|
kill.o \
|
link.o \
|
link.o \
|
lseek.o \
|
lseek.o \
|
open.o \
|
open.o \
|
read.o \
|
read.o \
|
sbrk.o \
|
sbrk.o \
|
stat.o \
|
stat.o \
|
times.o \
|
times.o \
|
uart.o \
|
uart.o \
|
unlink.o \
|
unlink.o \
|
wait.o \
|
wait.o \
|
write.o
|
write.o
|
|
|
# Host specific makefile fragment specifies the automatic rules
|
# Host specific makefile fragment specifies the automatic rules
|
@host_makefile_frag@
|
@host_makefile_frag@
|
|
|
# Build what we need out
|
# Build what we need out
|
all: $(OUTPUTS) $(BOARD_LIBS)
|
all: $(OUTPUTS) $(BOARD_LIBS)
|
|
|
# Rules to build the BSPs from their objects. No need for a rule to build
|
# Rules to build the BSPs from their objects. No need for a rule to build
|
# crt0.o, that happens autmatically from .S
|
# crt0.o, that happens autmatically from .S
|
$(LIBOR32): $(LIBOR32_OBJS)
|
$(LIBOR32): $(LIBOR32_OBJS)
|
${AR} ${ARFLAGS} $@ $^
|
${AR} ${ARFLAGS} $@ $^
|
${RANLIB} $@
|
${RANLIB} $@
|
|
|
%.a: %.o
|
%.a: %.o
|
${AR} ${ARFLAGS} $@ $^
|
${AR} ${ARFLAGS} $@ $^
|
${RANLIB} $@
|
${RANLIB} $@
|
|
|
# Standard clean up rules.
|
# Standard clean up rules.
|
clean mostlyclean:
|
clean mostlyclean:
|
rm -f $(OUTPUTS) *.i *~ *.o *-test *.srec *.dis *.map *.x
|
rm -f $(OUTPUTS) *.i *~ *.o *-test *.srec *.dis *.map *.x
|
|
|
distclean maintainer-clean realclean: clean
|
distclean maintainer-clean realclean: clean
|
rm -f Makefile config.status *~
|
rm -f Makefile config.status *~
|
|
|
# Standard install rules for libor32 and crt0
|
# Standard install rules for libor32 and crt0
|
# Boards installed into lib/board/$${board} and named board.a. GCC links against with
|
# Boards installed into lib/board/$${board} and named board.a. GCC links against with
|
# board specified by -mboard=whichboard and adds
|
# board specified by -mboard=whichboard and adds
|
# -lboard -L/lib/board/whichboard
|
# -lboard -L/lib/board/whichboard
|
#
|
#
|
.PHONY: install info install-info clean-info
|
.PHONY: install info install-info clean-info
|
install:
|
install:
|
@for outputs in ${OUTPUTS}; do\
|
@for outputs in ${OUTPUTS}; do\
|
mkdir -p $(DESTDIR)$(tooldir)/lib${MULTISUBDIR}; \
|
mkdir -p $(DESTDIR)$(tooldir)/lib${MULTISUBDIR}; \
|
$(INSTALL_PROGRAM) $${outputs} \
|
$(INSTALL_PROGRAM) $${outputs} \
|
$(DESTDIR)$(tooldir)/lib${MULTISUBDIR}; \
|
$(DESTDIR)$(tooldir)/lib${MULTISUBDIR}; \
|
done; \
|
done; \
|
for board in ${BOARDS}; do\
|
for board in ${BOARDS}; do\
|
mkdir -p $(DESTDIR)$(tooldir)/lib${MULTISUBDIR}/boards/$${board}; \
|
mkdir -p $(DESTDIR)$(tooldir)/lib${MULTISUBDIR}/boards/$${board}; \
|
$(INSTALL_PROGRAM) $${board}.a \
|
$(INSTALL_PROGRAM) $${board}.a \
|
$(DESTDIR)$(tooldir)/lib${MULTISUBDIR}/boards/$${board}/$(LIBBOARD); \
|
$(DESTDIR)$(tooldir)/lib${MULTISUBDIR}/boards/$${board}/$(LIBBOARD); \
|
done
|
done
|
|
|
# Deal with info if we had any.
|
# Deal with info if we had any.
|
info:
|
info:
|
install-info:
|
install-info:
|
clean-info:
|
clean-info:
|
|
|
|
|
# Standard make and configure dependencies.
|
# Standard make and configure dependencies.
|
Makefile: Makefile.in config.status @host_makefile_frag_path@
|
Makefile: Makefile.in config.status @host_makefile_frag_path@
|
$(SHELL) config.status
|
$(SHELL) config.status
|
|
|
config.status: configure
|
config.status: configure
|
$(SHELL) config.status --recheck
|
$(SHELL) config.status --recheck
|
|
|