aboutsummaryrefslogtreecommitdiff
path: root/libgloss/or1k
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2023-12-29 00:00:11 -0500
committerMike Frysinger <vapier@gentoo.org>2024-01-19 22:23:47 -0500
commit8c5bb84b6b505be3dbcea97ed2c879d2df81249f (patch)
treeaa739b3802a81d3fa9c6891d06e606d39b1b91ab /libgloss/or1k
parent22257fc68191c5a95373191798c59390ebf7388b (diff)
downloadnewlib-8c5bb84b6b505be3dbcea97ed2c879d2df81249f.zip
newlib-8c5bb84b6b505be3dbcea97ed2c879d2df81249f.tar.gz
newlib-8c5bb84b6b505be3dbcea97ed2c879d2df81249f.tar.bz2
libgloss: merge or1k into top-level Makefile
Avoid a recursive make to speed things up a bit. A or1k-elf build shows installed objects & libs produce same code.
Diffstat (limited to 'libgloss/or1k')
-rw-r--r--libgloss/or1k/Makefile.in145
-rw-r--r--libgloss/or1k/Makefile.inc66
-rw-r--r--libgloss/or1k/boards/README5
3 files changed, 68 insertions, 148 deletions
diff --git a/libgloss/or1k/Makefile.in b/libgloss/or1k/Makefile.in
deleted file mode 100644
index c75d6e4..0000000
--- a/libgloss/or1k/Makefile.in
+++ /dev/null
@@ -1,145 +0,0 @@
-# Copyright (c) 1998 Cygnus Support
-#
-# The authors hereby grant permission to use, copy, modify, distribute,
-# and license this software and its documentation for any purpose, provided
-# that existing copyright notices are retained in all copies and that this
-# notice is included verbatim in any distributions. No written agreement,
-# license, or royalty fee is required for any of the authorized uses.
-# Modifications to this software may be copyrighted by their authors
-# and need not follow the licensing terms described here, provided that
-# the new terms are clearly indicated on the first page of each file where
-# they apply.
-
-DESTDIR =
-VPATH = @srcdir@
-srcdir = @srcdir@
-objdir = .
-srcroot = $(srcdir)/../..
-objroot = $(objdir)/../..
-
-prefix = @prefix@
-exec_prefix = @exec_prefix@
-
-host_alias = @host_alias@
-target_alias = @target_alias@
-program_transform_name = @program_transform_name@
-
-bindir = @bindir@
-libdir = @libdir@
-includedir = @includedir@
-tooldir = $(exec_prefix)/$(target_alias)
-
-# Multilib support variables.
-# TOP is used instead of MULTI{BUILD,SRC}TOP.
-MULTIDIRS =
-MULTISUBDIR =
-MULTIDO = true
-MULTICLEAN = true
-
-INSTALL = @INSTALL@
-INSTALL_PROGRAM = @INSTALL_PROGRAM@
-INSTALL_DATA = @INSTALL_DATA@
-
-SHELL = /bin/sh
-
-mkinstalldirs = $(SHELL) $(srcroot)/mkinstalldirs
-
-CC = @CC@
-AS = @AS@
-AR = @AR@
-LD = @LD@
-RANLIB = @RANLIB@
-
-OBJDUMP = `if [ -f ${objroot}/../binutils/objdump ] ; \
- then echo ${objroot}/../binutils/objdump ; \
- else t='$(program_transform_name)'; echo objdump | sed -e $$t ; fi`
-OBJCOPY = `if [ -f ${objroot}/../binutils/objcopy ] ; \
- then echo ${objroot}/../binutils/objcopy ; \
- else t='$(program_transform_name)'; echo objcopy | sed -e $$t ; fi`
-
-# object files needed
-COMMON_FILES = syscalls \
- or1k_uart \
- outbyte \
- caches-asm \
- exceptions \
- exceptions-asm \
- interrupts \
- interrupts-asm \
- mmu-asm \
- timer \
- sbrk \
- impure \
- util \
- sync-asm
-
-LIBOR1K_FILES = $(COMMON_FILES)
-LIBOR1K_OBJS = $(addsuffix .o,$(LIBOR1K_FILES))
-
-BOARDS = atlys \
- de0_nano \
- ml501 \
- optimsoc \
- or1ksim \
- or1ksim-uart \
- ordb1a3pe1500 \
- ordb2a \
- orpsocrefdesign
-
-BOARD_LIBS = $(addprefix libboard-,$(addsuffix .a,$(BOARDS)))
-BOARD_OBJS = $(addprefix libboard-,$(addsuffix .o,$(BOARDS)))
-
-GCC_LDFLAGS = `if [ -d ${objroot}/../gcc ] ; \
- then echo -L${objroot}/../gcc ; fi`
-
-OUTPUTS = libor1k.a crt0.o ${BOARD_LIBS}
-
-# Host specific makefile fragment comes in here.
-@host_makefile_frag@
-
-
-all: ${OUTPUTS}
-
-#
-# here's where we build the library for each target
-#
-
-libor1k.a: $(LIBOR1K_OBJS)
- ${AR} ${ARFLAGS} $@ $(LIBOR1K_OBJS)
- ${RANLIB} $@
-
-libboard-%.o: boards/%.S
- ${CC} ${CFLAGS} -o $@ -c $<
-
-libboard-%.o: boards/%.c
- ${CC} ${CFLAGS} -o $@ -c $<
-
-libboard-%.a: libboard-%.o
- ${AR} ${ARFLAGS} $@ $<
- ${RANLIB} $@
-
-doc:
-
-clean mostlyclean:
- rm -f $(OUTPUTS) $(BOARD_LIBS) *.i *~ *.o *-test *.srec *.dis *.map *.x
-
-distclean maintainer-clean realclean: clean
- rm -f Makefile config.status $(OUTPUTS)
-
-.PHONY: install info install-info clean-info
-install:
- ${mkinstalldirs} ${DESTDIR}${tooldir}/lib${MULTISUBDIR} $(DESTDIR)$(tooldir)/include
- @for outputs in ${OUTPUTS}; do\
- $(INSTALL_DATA) $${outputs} $(DESTDIR)$(tooldir)/lib${MULTISUBDIR}; \
- done
- $(INSTALL_DATA) ${srcdir}/include/or1k-support.h $(DESTDIR)$(tooldir)/include/
- $(INSTALL_DATA) ${srcdir}/include/or1k-sprs.h $(DESTDIR)$(tooldir)/include/
- $(INSTALL_DATA) ${srcdir}/include/or1k-asm.h $(DESTDIR)$(tooldir)/include/
- $(INSTALL_DATA) ${srcdir}/include/or1k-nop.h $(DESTDIR)$(tooldir)/include/
-
-info:
-install-info:
-clean-info:
-
-Makefile: Makefile.in ../config.status
- cd .. && $(SHELL) config.status
diff --git a/libgloss/or1k/Makefile.inc b/libgloss/or1k/Makefile.inc
new file mode 100644
index 0000000..ecb7a83
--- /dev/null
+++ b/libgloss/or1k/Makefile.inc
@@ -0,0 +1,66 @@
+## Copyright (c) 1998 Cygnus Support
+##
+## The authors hereby grant permission to use, copy, modify, distribute,
+## and license this software and its documentation for any purpose, provided
+## that existing copyright notices are retained in all copies and that this
+## notice is included verbatim in any distributions. No written agreement,
+## license, or royalty fee is required for any of the authorized uses.
+## Modifications to this software may be copyrighted by their authors
+## and need not follow the licensing terms described here, provided that
+## the new terms are clearly indicated on the first page of each file where
+## they apply.
+
+multilibtool_DATA += %D%/crt0.o
+libobjs_a_SOURCES += %D%/crt0.S
+
+includetool_DATA += \
+ %D%/include/or1k-asm.h \
+ %D%/include/or1k-nop.h \
+ %D%/include/or1k-sprs.h \
+ %D%/include/or1k-support.h
+
+multilibtool_LIBRARIES += %D%/libor1k.a
+%C%_libor1k_a_SOURCES = \
+ %D%/syscalls.c \
+ %D%/or1k_uart.c \
+ %D%/outbyte.c \
+ %D%/caches-asm.S \
+ %D%/exceptions.c \
+ %D%/exceptions-asm.S \
+ %D%/interrupts.c \
+ %D%/interrupts-asm.S \
+ %D%/mmu-asm.S \
+ %D%/timer.c \
+ %D%/sbrk.c \
+ %D%/impure.c \
+ %D%/util.c \
+ %D%/sync-asm.S
+
+## Now all the board definitions.
+
+multilibtool_LIBRARIES += %D%/libboard-atlys.a
+%C%_libboard_atlys_a_SOURCES = %D%/boards/atlys.S
+
+multilibtool_LIBRARIES += %D%/libboard-de0_nano.a
+%C%_libboard_de0_nano_a_SOURCES = %D%/boards/de0_nano.S
+
+multilibtool_LIBRARIES += %D%/libboard-ml501.a
+%C%_libboard_ml501_a_SOURCES = %D%/boards/ml501.S
+
+multilibtool_LIBRARIES += %D%/libboard-optimsoc.a
+%C%_libboard_optimsoc_a_SOURCES = %D%/boards/optimsoc.S
+
+multilibtool_LIBRARIES += %D%/libboard-or1ksim.a
+%C%_libboard_or1ksim_a_SOURCES = %D%/boards/or1ksim.S
+
+multilibtool_LIBRARIES += %D%/libboard-or1ksim-uart.a
+%C%_libboard_or1ksim_uart_a_SOURCES = %D%/boards/or1ksim-uart.S
+
+multilibtool_LIBRARIES += %D%/libboard-ordb1a3pe1500.a
+%C%_libboard_ordb1a3pe1500_a_SOURCES = %D%/boards/ordb1a3pe1500.S
+
+multilibtool_LIBRARIES += %D%/libboard-ordb2a.a
+%C%_libboard_ordb2a_a_SOURCES = %D%/boards/ordb2a.S
+
+multilibtool_LIBRARIES += %D%/libboard-orpsocrefdesign.a
+%C%_libboard_orpsocrefdesign_a_SOURCES = %D%/boards/orpsocrefdesign.S
diff --git a/libgloss/or1k/boards/README b/libgloss/or1k/boards/README
index b6c5abf..290b798 100644
--- a/libgloss/or1k/boards/README
+++ b/libgloss/or1k/boards/README
@@ -60,6 +60,5 @@ steps:
implementation. It is recommended to do so in assembler board files to
keep the ability to overwrite the default implementation by the user.
-When you are done with your board, add it to libgloss/or1k/Makefile.in to the
-BOARDS variable and compile.
-
+When you are done with your board, add it to libgloss/or1k/Makefile.inc like the
+other libboard-*.a definitions and compile.